Changeset 25757 for trunk/Ohana/src/opihi
- Timestamp:
- Oct 2, 2009, 3:15:42 PM (17 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 17 edited
- 12 copied
-
cmd.astro/Makefile (modified) (2 diffs)
-
cmd.astro/cdot.c (copied) (copied from branches/eam_branches/20090715/Ohana/src/opihi/cmd.astro/cdot.c )
-
cmd.astro/cgrid.c (modified) (2 diffs)
-
cmd.astro/elliprofile.c (copied) (copied from branches/eam_branches/20090715/Ohana/src/opihi/cmd.astro/elliprofile.c )
-
cmd.astro/galcontour.c (copied) (copied from branches/eam_branches/20090715/Ohana/src/opihi/cmd.astro/galcontour.c )
-
cmd.astro/galprofiles.c (copied) (copied from branches/eam_branches/20090715/Ohana/src/opihi/cmd.astro/galprofiles.c )
-
cmd.astro/galradbins.c (copied) (copied from branches/eam_branches/20090715/Ohana/src/opihi/cmd.astro/galradbins.c )
-
cmd.astro/galradius.c (copied) (copied from branches/eam_branches/20090715/Ohana/src/opihi/cmd.astro/galradius.c )
-
cmd.astro/galsectors.c (copied) (copied from branches/eam_branches/20090715/Ohana/src/opihi/cmd.astro/galsectors.c )
-
cmd.astro/init.c (modified) (4 diffs)
-
cmd.astro/mksersic.c (copied) (copied from branches/eam_branches/20090715/Ohana/src/opihi/cmd.astro/mksersic.c )
-
cmd.astro/petrosian.c (copied) (copied from branches/eam_branches/20090715/Ohana/src/opihi/cmd.astro/petrosian.c )
-
cmd.astro/region.c (modified) (3 diffs)
-
cmd.basic/substr.c (modified) (1 diff)
-
cmd.data/Makefile (modified) (4 diffs)
-
cmd.data/init.c (modified) (4 diffs)
-
cmd.data/relocate.c (copied) (copied from branches/eam_branches/20090715/Ohana/src/opihi/cmd.data/relocate.c )
-
cmd.data/subset.c (modified) (3 diffs)
-
cmd.data/tvcolors.c (modified) (1 diff)
-
cmd.data/vellipse.c (copied) (copied from branches/eam_branches/20090715/Ohana/src/opihi/cmd.data/vellipse.c )
-
cmd.data/vgroup.c (copied) (copied from branches/eam_branches/20090715/Ohana/src/opihi/cmd.data/vgroup.c )
-
dvo/Makefile (modified) (1 diff)
-
dvo/gimages.c (modified) (2 diffs)
-
dvo/imbox.c (modified) (4 diffs)
-
dvo/init.c (modified) (1 diff)
-
dvo/photometry.c (modified) (1 diff)
-
dvo/region_list.c (modified) (1 diff)
-
dvo/skycoverage.c (modified) (6 diffs)
-
lib.data/mrqmin.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.astro/Makefile
r21061 r25757 21 21 $(SRC)/cgrid.$(ARCH).o \ 22 22 $(SRC)/coords.$(ARCH).o \ 23 $(SRC)/cdot.$(ARCH).o \ 23 24 $(SRC)/cplot.$(ARCH).o \ 24 25 $(SRC)/csystem.$(ARCH).o \ … … 36 37 $(SRC)/medianmap.$(ARCH).o \ 37 38 $(SRC)/mkgauss.$(ARCH).o \ 39 $(SRC)/mksersic.$(ARCH).o \ 40 $(SRC)/galradius.$(ARCH).o \ 41 $(SRC)/galradbins.$(ARCH).o \ 42 $(SRC)/galsectors.$(ARCH).o \ 43 $(SRC)/galprofiles.$(ARCH).o \ 44 $(SRC)/elliprofile.$(ARCH).o \ 45 $(SRC)/petrosian.$(ARCH).o \ 38 46 $(SRC)/multifit.$(ARCH).o \ 39 47 $(SRC)/objload.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.astro/cgrid.c
r20936 r25757 37 37 /* set spacings for RA */ 38 38 minorRA = minorDEC = 0.1; 39 range = MIN (fabs(graphmode. xmax-graphmode.xmin), fabs(graphmode.ymax-graphmode.ymin));39 range = MIN (fabs(graphmode.coords.cdelt1*(graphmode.xmax-graphmode.xmin)), fabs(graphmode.coords.cdelt2*(graphmode.ymax-graphmode.ymin))); 40 40 if (NorthPole || SouthPole) range = 360; 41 41 lrange = log10(MAX(fabs(range), 1e-30)); … … 58 58 } 59 59 dR = range / 100.0; 60 60 61 /* set spacings for DEC */ 61 range = MIN (fabs(graphmode. xmax-graphmode.xmin), fabs(graphmode.ymax-graphmode.ymin));62 range = MIN (fabs(graphmode.coords.cdelt1*(graphmode.xmax-graphmode.xmin)), fabs(graphmode.coords.cdelt2*(graphmode.ymax-graphmode.ymin))); 62 63 lrange = log10(MAX(fabs(range), 1e-30)); 63 64 factor = (int) (lrange); -
trunk/Ohana/src/opihi/cmd.astro/init.c
r21061 r25757 5 5 int cgrid PROTO((int, char **)); 6 6 int coords PROTO((int, char **)); 7 int cdot PROTO((int, char **)); 7 8 int cplot PROTO((int, char **)); 8 9 int csystem PROTO((int, char **)); … … 22 23 int imsub PROTO((int, char **)); 23 24 int medianmap PROTO((int, char **)); 25 int galsectors PROTO((int, char **)); 26 int galprofiles PROTO((int, char **)); 27 int galradius PROTO((int, char **)); 28 int galradbins PROTO((int, char **)); 29 int elliprofile PROTO((int, char **)); 30 int petrosian PROTO((int, char **)); 24 31 int mkgauss PROTO((int, char **)); 32 int mksersic PROTO((int, char **)); 25 33 int multifit PROTO((int, char **)); 26 34 int objload PROTO((int, char **)); … … 44 52 {1, "cgrid", cgrid, "plot sky coordinate grid"}, 45 53 {1, "coords", coords, "load coordinates for buffer from file"}, 54 {1, "cdot", cdot, "plot point in sky coordinates"}, 46 55 {1, "cplot", cplot, "plot vectors in sky coordinates"}, 47 56 {1, "csystem", csystem, "convert between coordinate systems"}, … … 61 70 {1, "medianmap", medianmap, "small median image"}, 62 71 {1, "mkgauss", mkgauss, "generate a 2-D gaussian centered in image"}, 72 {1, "mksersic", mksersic, "generate a 2-D sersic profile"}, 73 {1, "galsectors", galsectors, "generate radial vectors for sectors of width dtheta"}, 74 {1, "galprofiles", galprofiles, "generate radial vectors with interpolation along paths"}, 75 {1, "galradius", galradius, "generate radial vectors with interpolation along paths"}, 76 {1, "galradbins", galradbins, "generate radial vectors with interpolation along paths"}, 77 {1, "elliprofile", elliprofile, "generate radial vectors with interpolation along paths"}, 78 {1, "petrosian", petrosian, "petrosian parameters given radial bins"}, 63 79 {1, "multifit", multifit, "fit multi-order spectrum"}, 64 80 {1, "objload", objload, "plot obj data on Ximage "}, -
trunk/Ohana/src/opihi/cmd.astro/region.c
r14590 r25757 6 6 double Ra, Dec, Radius; 7 7 float dx, dy; 8 int N, kapa ;8 int N, kapa, NoClear; 9 9 char *name; 10 10 Graphdata graphmode; … … 46 46 remove_argument (N, &argc, argv); 47 47 graphmode.flipnorth = FALSE; 48 } 49 50 NoClear = FALSE; 51 if ((N = get_argument (argc, argv, "-no-clear"))) { 52 remove_argument (N, &argc, argv); 53 NoClear = TRUE; 48 54 } 49 55 … … 122 128 graphmode.coords.cdelt1 = graphmode.coords.cdelt2 = 1.0; 123 129 124 KapaClearSections (kapa);130 if (!NoClear) KapaClearSections (kapa); 125 131 KapaSetLimits (kapa, &graphmode); 126 132 127 133 /* drop this? */ 128 sprintf (string, "%8.4f %8.4f (%f)", Ra, Dec, Radius);129 KapaSendLabel (kapa, string, 2);134 // sprintf (string, "%8.4f %8.4f (%f)", Ra, Dec, Radius); 135 // KapaSendLabel (kapa, string, 2); 130 136 131 137 // XXX is this the right thing to be doing? -
trunk/Ohana/src/opihi/cmd.basic/substr.c
r18705 r25757 16 16 // add a range check here 17 17 if ((N1 < 0) || (N1 >= strlen(argv[1]))) { 18 gprint (GP_ERR, "ERROR: N1 out of range\n");18 gprint (GP_ERR, "ERROR: start value out of range in substr command\n"); 19 19 return (FALSE); 20 20 } 21 21 if ((N2 < 0) || ((N2+N1) > strlen(argv[1]))) { 22 gprint (GP_ERR, "ERROR: N2 out of range\n");22 gprint (GP_ERR, "ERROR: end value out of range in substr command\n"); 23 23 return (FALSE); 24 24 } -
trunk/Ohana/src/opihi/cmd.data/Makefile
r21508 r25757 97 97 $(SRC)/rebin.$(ARCH).o \ 98 98 $(SRC)/resize.$(ARCH).o \ 99 $(SRC)/relocate.$(ARCH).o \ 99 100 $(SRC)/roll.$(ARCH).o \ 100 101 $(SRC)/rotate.$(ARCH).o \ … … 110 111 $(SRC)/style.$(ARCH).o \ 111 112 $(SRC)/subraster.$(ARCH).o \ 112 $(SRC)/subset.$(ARCH).o \113 $(SRC)/subset.$(ARCH).o \ 113 114 $(SRC)/svd.$(ARCH).o \ 114 115 $(SRC)/swapbytes.$(ARCH).o \ … … 118 119 $(SRC)/tvcolors.$(ARCH).o \ 119 120 $(SRC)/tvcontour.$(ARCH).o \ 120 $(SRC)/tvgrid.$(ARCH).o \121 $(SRC)/tvgrid.$(ARCH).o \ 121 122 $(SRC)/uniq.$(ARCH).o \ 122 $(SRC)/unsign.$(ARCH).o \123 $(SRC)/unsign.$(ARCH).o \ 123 124 $(SRC)/vbin.$(ARCH).o \ 125 $(SRC)/vgroup.$(ARCH).o \ 124 126 $(SRC)/vclip.$(ARCH).o \ 125 $(SRC)/vgauss.$(ARCH).o \ 126 $(SRC)/vmaxwell.$(ARCH).o \ 127 $(SRC)/vgauss.$(ARCH).o \ 128 $(SRC)/vellipse.$(ARCH).o \ 129 $(SRC)/vmaxwell.$(ARCH).o \ 127 130 $(SRC)/vgrid.$(ARCH).o \ 128 131 $(SRC)/vload.$(ARCH).o \ … … 130 133 $(SRC)/vpop.$(ARCH).o \ 131 134 $(SRC)/vroll.$(ARCH).o \ 132 $(SRC)/vsmooth.$(ARCH).o \135 $(SRC)/vsmooth.$(ARCH).o \ 133 136 $(SRC)/vstats.$(ARCH).o \ 134 137 $(SRC)/wd.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.data/init.c
r24219 r25757 85 85 int rebin PROTO((int, char **)); 86 86 int resize PROTO((int, char **)); 87 int relocate PROTO((int, char **)); 87 88 int roll PROTO((int, char **)); 88 89 int rotate PROTO((int, char **)); … … 110 111 int unsign PROTO((int, char **)); 111 112 int vbin PROTO((int, char **)); 113 int vgroup PROTO((int, char **)); 112 114 int vclip PROTO((int, char **)); 113 115 int vect_select PROTO((int, char **)); 114 116 int vgrid PROTO((int, char **)); 115 117 int vgauss PROTO((int, char **)); 118 int vellipse PROTO((int, char **)); 116 119 int vmaxwell PROTO((int, char **)); 117 120 int vload PROTO((int, char **)); … … 218 221 {1, "rebin", rebin, "rebin image data by factor of N"}, 219 222 {1, "resize", resize, "set graphics/image window size"}, 223 {1, "relocate", relocate, "set graphics/image window position"}, 220 224 {1, "roll", roll, "roll image to new start point"}, 221 225 {1, "rotate", rotate, "rotate image"}, … … 243 247 {1, "uniq", uniq, "create a uniq vector subset from a vector"}, 244 248 {1, "unsign", unsign, "toggle the UNSIGN status"}, 245 {1, "vbin", vbin, "rebin vector data by a fector of N"}, 249 {1, "vbin", vbin, "rebin vector data by a factor of N"}, 250 {1, "vgroup", vgroup, "group y vector into bins defined by x vector values"}, 246 251 {1, "vclip", vclip, "clip values in a vector to be within a range"}, 247 252 {1, "vectors", list_vectors, "list vectors"}, 248 253 {1, "vgauss", vgauss, "fit a Gaussian to a vector"}, 254 {1, "vellipse", vellipse, "fit a Ellipse to a vector pair"}, 249 255 {1, "vgrid", vgrid, "generate an image from a triplet of vectors"}, 250 256 {1, "vhistogram", histogram, "generate histogram from vector"}, -
trunk/Ohana/src/opihi/cmd.data/subset.c
r20936 r25757 6 6 7 7 char *out; 8 int i, Npts, size ;8 int i, Npts, size, valid; 9 9 Vector *ivec, *ovec, *tvec; 10 10 … … 12 12 ivec = ovec = tvec = NULL; 13 13 14 if ((argc < 6) || strcmp(argv[2], "=") || strcmp (argv[4], "if")) { 15 gprint (GP_ERR, "SYNTAX: subset vec = vec if (logic expression)\n"); 14 valid = TRUE; 15 valid &= (argc >= 6); 16 valid &= !strcmp(argv[2], "="); 17 valid &= !strcmp(argv[4], "if") || !strcmp (argv[4], "where"); 18 if (!valid) { 19 gprint (GP_ERR, "SYNTAX: subset vec = vec [if/where] (logic expression)\n"); 16 20 return (FALSE); 17 21 } … … 76 80 return (TRUE); 77 81 78 error:82 error: 79 83 DeleteVector (tvec); 80 84 DeleteVector (ovec); -
trunk/Ohana/src/opihi/cmd.data/tvcolors.c
r16059 r25757 19 19 if (argc != 2) { 20 20 gprint (GP_ERR, "USAGE: tvcolors (colormap)\n"); 21 gprint (GP_ERR, " colormap options : greyscale, -greyscale, rainbow, heat, fullcolor, ruffcolor (also grayscale, -grayscale)\n"); 21 22 return (FALSE); 22 23 } -
trunk/Ohana/src/opihi/dvo/Makefile
r20936 r25757 73 73 $(SRC)/imrough.$(ARCH).o \ 74 74 $(SRC)/imsearch.$(ARCH).o \ 75 $(SRC)/imstats.$(ARCH).o \76 75 $(SRC)/lcat.$(ARCH).o \ 77 76 $(SRC)/lcurve.$(ARCH).o \ -
trunk/Ohana/src/opihi/dvo/gimages.c
r21508 r25757 124 124 } 125 125 126 // find coordinates of image center 126 127 XY_to_RD (&Ro, &Do, Xo, Yo, &image[i].coords); 128 if (fabs(Ro - Ra) > 120.0) continue; 127 129 128 130 local.crval1 = Ro; … … 138 140 Xs = -0.5*image[i].NX; 139 141 Ys = -0.5*image[i].NY; 140 Xe = +0.5*image[i].NX;141 Ye = +0.5*image[i].NY;142 142 } else { 143 143 Xs = 0.0; 144 144 Ys = 0.0; 145 Xe = image[i].NX;146 Ye = image[i].NY;147 145 } 148 146 147 // find coordinates of an image corner 149 148 XY_to_RD (&Ro, &Do, Xs, Ys, &image[i].coords); 150 RD_to_XY (&Xo, &Xo, Ro, Do, &local); 149 150 // find radius of image in arcsec 151 RD_to_XY (&Xo, &Yo, Ro, Do, &local); 151 152 Radius = hypot (Xo, Yo); 152 153 // fprintf (stderr, "%s: %f %f %f ", image[i].name, local.crval1, local.crval2, Radius); 153 154 154 XY_to_RD (&Ro, &Do, Xs, Ye, &image[i].coords); 155 RD_to_XY (&Xo, &Xo, Ro, Do, &local); 156 Radius = MAX (Radius, hypot (Xo, Yo)); 157 // fprintf (stderr, "%f ", Radius); 158 159 XY_to_RD (&Ro, &Do, Xe, Ys, &image[i].coords); 160 RD_to_XY (&Xo, &Xo, Ro, Do, &local); 161 Radius = MAX (Radius, hypot (Xo, Yo)); 162 // fprintf (stderr, "%f ", Radius); 163 164 XY_to_RD (&Ro, &Do, Xe, Ye, &image[i].coords); 165 RD_to_XY (&Xo, &Xo, Ro, Do, &local); 166 Radius = MAX (Radius, hypot (Xo, Yo)); 167 // fprintf (stderr, "%f ", Radius); 168 155 // check for distances to coordinates in arcsec 169 156 RD_to_XY (&Xo, &Yo, Ra, Dec, &local); 170 157 // fprintf (stderr, " : %f\n", hypot(Xo,Yo)); 158 159 // skip images with center too far from coordinaes 171 160 if (hypot(Xo,Yo) > 1.5*Radius) continue; 172 161 // fprintf (stderr, " ** try me **\n"); -
trunk/Ohana/src/opihi/dvo/imbox.c
r21065 r25757 3 3 int imbox (int argc, char **argv) { 4 4 5 int j, kapa, Nskip, status, InPic, flipped, N, haveNx, haveNy, Nx, Ny, SOLO_PHU ;5 int j, kapa, Nskip, status, InPic, flipped, N, haveNx, haveNy, Nx, Ny, SOLO_PHU, Npts, NPTS; 6 6 Vector Xvec, Yvec; 7 7 double r, d, x[4], y[4], Rmin, Rmax, Rmid; … … 36 36 37 37 /* project this image to screen display coords */ 38 SetVector (&Xvec, OPIHI_FLT, 8); 39 SetVector (&Yvec, OPIHI_FLT, 8); 38 Npts = 0; 39 NPTS = 200; 40 SetVector (&Xvec, OPIHI_FLT, NPTS); 41 SetVector (&Yvec, OPIHI_FLT, NPTS); 40 42 41 43 while (gfits_fread_header (f, &header)) { … … 82 84 while (r > Rmid) r-= 360.0; 83 85 } 84 status |= RD_to_XY (&Xvec.elements.Flt[ 2*j], &Yvec.elements.Flt[2*j], r, d, &graphmode.coords);86 status |= RD_to_XY (&Xvec.elements.Flt[Npts + 2*j], &Yvec.elements.Flt[Npts + 2*j], r, d, &graphmode.coords); 85 87 if (j > 0) { 86 Xvec.elements.Flt[ 2*j - 1] = Xvec.elements.Flt[2*j];87 Yvec.elements.Flt[ 2*j - 1] = Yvec.elements.Flt[2*j];88 Xvec.elements.Flt[Npts + 2*j - 1] = Xvec.elements.Flt[Npts + 2*j]; 89 Yvec.elements.Flt[Npts + 2*j - 1] = Yvec.elements.Flt[Npts + 2*j]; 88 90 } 89 91 } 90 Xvec.elements.Flt[7] = Xvec.elements.Flt[0]; 91 Yvec.elements.Flt[7] = Yvec.elements.Flt[0]; 92 Xvec.elements.Flt[Npts + 7] = Xvec.elements.Flt[Npts + 0]; 93 Yvec.elements.Flt[Npts + 7] = Yvec.elements.Flt[Npts + 0]; 94 92 95 InPic = FALSE; 93 96 for (j = 0; j < 8; j+=2) { 94 if ((Xvec.elements.Flt[j] >= graphmode.xmin) && 95 (Xvec.elements.Flt[j] <= graphmode.xmax) && 96 (Yvec.elements.Flt[j] >= graphmode.ymin) && 97 (Yvec.elements.Flt[j] <= graphmode.ymax)) 98 InPic = TRUE; 97 if ((Xvec.elements.Flt[Npts + j] >= graphmode.xmin) && 98 (Xvec.elements.Flt[Npts + j] <= graphmode.xmax) && 99 (Yvec.elements.Flt[Npts + j] >= graphmode.ymin) && 100 (Yvec.elements.Flt[Npts + j] <= graphmode.ymax)) 101 InPic = TRUE; 102 } 103 if (!InPic) continue; 104 105 Npts += 8; 106 if (Npts + 8 >= NPTS) { /* need to leave room for 4 point image */ 107 NPTS += 200; 108 REALLOCATE (Xvec.elements.Flt, opihi_flt, NPTS); 109 REALLOCATE (Yvec.elements.Flt, opihi_flt, NPTS); 99 110 } 100 111 101 Xvec.Nelements = Yvec.Nelements = 8;102 if (InPic) {103 graphmode.style = 2; /* points */104 graphmode.ptype = 100; /* connect pairs of points */105 graphmode.etype = 0;106 PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);107 }108 112 skip: 109 113 Nskip = gfits_data_size (&header); … … 111 115 gfits_free_header (&header); 112 116 } 117 118 Xvec.Nelements = Yvec.Nelements = Npts; 119 if (Npts > 0) { 120 graphmode.style = 2; /* points */ 121 graphmode.ptype = 100; /* connect pairs of points */ 122 graphmode.etype = 0; 123 PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode); 124 } 125 113 126 fclose (f); 114 127 free (Xvec.elements.Flt); -
trunk/Ohana/src/opihi/dvo/init.c
r21541 r25757 102 102 {1, "subpix", subpix, "get subpixel positions"}, 103 103 {1, "version", version, "show version information"}, 104 //{1, "imstats", imstats, "plot image statistics"},105 104 //{1, "addxtra", addxtra, "add extra data to object"}, 106 105 //{1, "getxtra", getxtra, "get extra data from object"}, -
trunk/Ohana/src/opihi/dvo/photometry.c
r21508 r25757 325 325 return (FALSE); 326 326 } 327 if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile)) { 327 328 // XXX now that DVO does not allow write access, we can drop the MasterPhotcodeFile 329 if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile, FALSE)) { 328 330 gprint (GP_ERR, "error loading photcode table %s or master file %s\n", CatdirPhotcodeFile, MasterPhotcodeFile); 329 331 return (FALSE); -
trunk/Ohana/src/opihi/dvo/region_list.c
r15753 r25757 42 42 43 43 if (sky != NULL) SkyTableFree (sky); 44 sky = SkyTableLoadOptimal (CATDIR, skyfile, gscfile, skydepth, verbose);44 sky = SkyTableLoadOptimal (CATDIR, skyfile, gscfile, FALSE, skydepth, verbose); 45 45 if (sky == NULL) return FALSE; 46 46 -
trunk/Ohana/src/opihi/dvo/skycoverage.c
r21153 r25757 16 16 Coords coords; 17 17 int typehash; 18 int PhotcodeSelect; 19 PhotCode *PhotcodeValue; 18 20 19 21 WITH_MOSAIC = FALSE; … … 43 45 remove_argument (N, &argc, argv); 44 46 ByName = TRUE; 47 } 48 49 PhotcodeValue = NULL; 50 PhotcodeSelect = FALSE; 51 if ((N = get_argument (argc, argv, "-photcode"))) { 52 if (!InitPhotcodes ()) return (FALSE); 53 PhotcodeSelect = TRUE; 54 remove_argument (N, &argc, argv); 55 PhotcodeValue = GetPhotcodebyName (argv[N]); 56 if (PhotcodeValue == NULL) { 57 gprint (GP_ERR, "photcode not found in photcode table\n"); 58 return (FALSE); 59 } 60 remove_argument (N, &argc, argv); 45 61 } 46 62 … … 85 101 86 102 if (argc != 4) { 87 gprint (GP_ERR, "USAGE: skycoverage (buffer) (pixscale) (Npts) [-time start range] [-name name]\n"); 103 gprint (GP_ERR, "USAGE: skycoverage (buffer) (pixscale) (Npts)\n"); 104 gprint (GP_ERR, " options: [-time start range] [-trange start stop] [-name name] [-photcode name] [+mosaic] [-mosaic] [-ra-center RA]\n"); 88 105 gprint (GP_ERR, " (buffer) saves bitmapped AIT plot\n"); 89 106 gprint (GP_ERR, " (pixscale) specifies the pixel size in degrees\n"); … … 128 145 for (xs = 0; xs < Nx; xs++) { 129 146 status = XY_to_RD (&r, &d, (double)(xs), (double)(ys), &coords); 130 status &= (r > 0);131 status &= (r < 360);147 status &= (r >= 0); 148 status &= (r <= 360); 132 149 if (status) { 133 150 V[ys*Nx + xs] = 2; … … 141 158 if (ByName && strcmp (name, image[i].name)) continue; 142 159 if (TimeSelect && ((image[i].tzero < tzero) || (image[i].tzero+image[i].trate*image[i].NY > tzero + trange))) continue; 160 161 if (PhotcodeSelect) { 162 if (PhotcodeValue[0].type == PHOT_DEP) { 163 if (PhotcodeValue[0].code != image[i].photcode) continue; 164 } else { 165 if (PhotcodeValue[0].code != GetPhotcodeEquivCodebyCode (image[i].photcode)) continue; 166 } 167 } 168 143 169 if (!FindMosaicForImage (image, Nimage, i)) continue; 144 170 … … 167 193 XY_to_RD (&r, &d, Xi, Yi, &image[i].coords); 168 194 r = ohana_normalize_angle (r); 195 if (r - RaCenter > +180.0) r -= 360.0; 196 if (r - RaCenter < -180.0) r += 360.0; 169 197 status = RD_to_XY (&Xs, &Ys, r, d, &coords); 170 198 if (Xs < 0) continue; -
trunk/Ohana/src/opihi/lib.data/mrqmin.c
r20936 r25757 17 17 18 18 int k, j, i; 19 opihi_flt y diff, wt, chisq;19 opihi_flt ymodel, ydiff, wt, chisq; 20 20 21 21 for (j = 0; j < Npar; j++) { … … 27 27 for (i = 0; i < Npts; i++) { 28 28 29 ydiff = funcs (x[i], par, Npar, dyda) - y[i]; 29 ymodel = funcs (x[i], par, Npar, dyda); 30 ydiff = ymodel - y[i]; 30 31 chisq += SQ(ydiff) * dy[i]; 32 33 // fprintf (stderr, "%f %f - %f : %f -> %f\n", x[i], y[i], ymodel, dy[i], chisq); 31 34 32 35 for (j = 0; j < Npar; j++) { … … 85 88 86 89 /* if good, save temp values */ 87 if ( rho > 0) {90 if ((chisq > 1e-3) && (rho > -1e-6)) { 88 91 lambda *= 0.1; 89 92 ochisq = chisq;
Note:
See TracChangeset
for help on using the changeset viewer.
