Changeset 31160 for trunk/Ohana/src/opihi
- Timestamp:
- Apr 4, 2011, 1:19:27 PM (15 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 14 edited
-
cmd.astro/region.c (modified) (2 diffs)
-
cmd.data/densify.c (modified) (3 diffs)
-
cmd.data/fit1d.c (modified) (1 diff)
-
cmd.data/fit2d.c (modified) (1 diff)
-
cmd.data/histogram.c (modified) (1 diff)
-
cmd.data/limits.c (modified) (3 diffs)
-
cmd.data/section.c (modified) (2 diffs)
-
dvo/dbExtractImages.c (modified) (2 diffs)
-
dvo/dbFields.c (modified) (1 diff)
-
dvo/imextract.c (modified) (1 diff)
-
dvo/skycoverage.c (modified) (7 diffs)
-
include/dvoshell.h (modified) (2 diffs)
-
lib.data/graphtools.c (modified) (2 diffs)
-
lib.shell/VectorOps.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.astro/region.c
r30611 r31160 5 5 double Ra, Dec, Radius; 6 6 float dx, dy; 7 int N, kapa, NoClear ;7 int N, kapa, NoClear, dXpix, dYpix; 8 8 char *name; 9 9 Graphdata graphmode; … … 27 27 remove_argument (N, &argc, argv); 28 28 KapaGetImageCoords (kapa, &graphmode.coords); 29 KapaGetImageRange (kapa, &graphmode.xmin, &graphmode.xmax, &graphmode.ymax, &graphmode.ymin );29 KapaGetImageRange (kapa, &graphmode.xmin, &graphmode.xmax, &graphmode.ymax, &graphmode.ymin, &dXpix, &dYpix); 30 30 31 31 set_variable ("XMIN", graphmode.xmin); -
trunk/Ohana/src/opihi/cmd.data/densify.c
r29938 r31160 1 1 # include "data.h" 2 3 # define CHECKVAL(ARG) if (!isfinite(ARG)) { gprint (GP_ERR, "illegal value for %s: %f\n", #ARG, ARG); return (FALSE); } 2 4 3 5 int densify (int argc, char **argv) { 4 6 5 int i, Nx, Ny, Xb, Yb, Normalize, N ;6 floatXmin, Xmax, dX, Ymin, Ymax, dY;7 int i, Nx, Ny, Xb, Yb, Normalize, N, Xpix, Ypix, good, UseGraph; 8 double Xmin, Xmax, dX, Ymin, Ymax, dY; 7 9 float *val; 8 10 Buffer *bf; … … 16 18 } 17 19 18 if (argc != 10) { 20 UseGraph = FALSE; 21 if ((N = get_argument (argc, argv, "-graph"))) { 22 remove_argument (N, &argc, argv); 23 UseGraph = TRUE; 24 } 25 26 good = UseGraph ? (argc == 4) : (argc == 10); 27 if (!good) { 19 28 gprint (GP_ERR, "USAGE: densify buffer x y Xmin Xmax dX Ymin Ymax dY\n"); 29 gprint (GP_ERR, " OR: densify buffer x y -graph\n"); 20 30 return (FALSE); 21 31 } … … 30 40 REQUIRE_VECTOR_FLT (vy, FALSE); 31 41 32 Xmin = atof (argv[4]); 33 Xmax = atof (argv[5]); 34 dX = atof (argv[6]); 42 if (UseGraph) { 43 int kapa; 44 Graphdata graphmode; 45 if (!GetGraph (&graphmode, &kapa, NULL)) return (FALSE); 46 KapaGetImageRange (kapa, &Xmin, &Xmax, &Ymax, &Ymin, &Xpix, &Ypix); 47 Xmax = graphmode.xmax; 48 Xmin = graphmode.xmin; 49 Ymax = graphmode.ymax; 50 Ymin = graphmode.ymin; 51 dX = (Xmax - Xmin) / (Xpix - 1); 52 dY = (Ymax - Ymin) / (Ypix - 1); 53 } else { 54 Xmin = atof (argv[4]); 55 Xmax = atof (argv[5]); 56 dX = atof (argv[6]); 35 57 36 Ymin = atof (argv[7]); 37 Ymax = atof (argv[8]); 38 dY = atof (argv[9]); 58 Ymin = atof (argv[7]); 59 Ymax = atof (argv[8]); 60 dY = atof (argv[9]); 61 } 62 63 CHECKVAL(Xmin); 64 CHECKVAL(Xmax); 65 CHECKVAL(dX); 66 67 CHECKVAL(Ymin); 68 CHECKVAL(Ymax); 69 CHECKVAL(dY); 39 70 40 71 Nx = (Xmax - Xmin) / dX + 1; -
trunk/Ohana/src/opihi/cmd.data/fit1d.c
r27817 r31160 42 42 43 43 if (argc != 4) { 44 gprint (GP_ERR, "USAGE: fit x y order [-dy wt] [-quiet/-q] [-clip Nsigma Niter]\n");44 gprint (GP_ERR, "USAGE: fit1d x y order [-dy wt] [-quiet/-q] [-clip Nsigma Niter]\n"); 45 45 return (FALSE); 46 46 } -
trunk/Ohana/src/opihi/cmd.data/fit2d.c
r29001 r31160 48 48 49 49 if (argc != 5) { 50 gprint (GP_ERR, "USAGE: fit x y z order [-dz wt]\n");50 gprint (GP_ERR, "USAGE: fit2d x y z order [-dz wt] [-quiet/-q] [-clip Nsigma Niter]\n"); 51 51 return (FALSE); 52 52 } -
trunk/Ohana/src/opihi/cmd.data/histogram.c
r27817 r31160 61 61 opihi_int *V = xvec[0].elements.Int; 62 62 for (i = 0; i < xvec[0].Nelements; i++, V++) { 63 if (isnan(*V)) continue;64 63 bin = MIN (MAX (0, (*V - start) / delta), Nbins - 1); 65 64 OUT[bin]++; -
trunk/Ohana/src/opihi/cmd.data/limits.c
r30610 r31160 3 3 int limits (int argc, char **argv) { 4 4 5 int N, APPLY ;5 int N, APPLY, dX, dY; 6 6 int kapa; 7 7 char *name; … … 28 28 if ((N = get_argument (argc, argv, "-image"))) { 29 29 remove_argument (N, &argc, argv); 30 KapaGetImageRange (kapa, &graphmode.xmin, &graphmode.xmax, &graphmode.ymax, &graphmode.ymin );30 KapaGetImageRange (kapa, &graphmode.xmin, &graphmode.xmax, &graphmode.ymax, &graphmode.ymin, &dX, &dY); 31 31 32 32 set_variable ("XMIN", graphmode.xmin); … … 34 34 set_variable ("YMIN", graphmode.ymin); 35 35 set_variable ("YMAX", graphmode.ymax); 36 37 set_variable ("KAPA_XMIN", graphmode.xmin); 38 set_variable ("KAPA_XMAX", graphmode.xmax); 39 set_variable ("KAPA_YMIN", graphmode.ymin); 40 set_variable ("KAPA_YMAX", graphmode.ymax); 41 42 set_variable ("KAPA_XPIX", dX); 43 set_variable ("KAPA_YPIX", dY); 36 44 37 45 // if (!NoClear) KapaClearSections (kapa); -
trunk/Ohana/src/opihi/cmd.data/section.c
r29938 r31160 68 68 if ((argc == 1) && (action == NONE)) { 69 69 KapaGetSection (kapa, "*"); 70 gprint (GP_ERR, "USAGE: section name [x y dx dy] [options]\n");70 gprint (GP_ERR, "USAGE: section name [x y dx dy] or [options]\n"); 71 71 gprint (GP_ERR, "OPTIONS: -list : show properties of all sections\n"); 72 72 gprint (GP_ERR, " -up : move section up in display stack\n"); … … 76 76 gprint (GP_ERR, " -imtool (position) : set location of image zoom / status box\n"); 77 77 gprint (GP_ERR, " (position may be: -x, +x, -y, +y, none)\n"); 78 gprint (GP_ERR, " -image : define section upper-right corner so image fills the section\n"); 79 gprint (GP_ERR, " -bg (color) : set background color (see style -c help for color choices)\n"); 80 78 81 return (TRUE); 79 82 } 80 83 84 if ((argc != 2) && (action != NONE)) { 85 gprint (GP_ERR, "can only use dash options without numbers\n"); 86 return (FALSE); 87 } 88 81 89 if (argc == 2) { 82 90 /* select / show section */ -
trunk/Ohana/src/opihi/dvo/dbExtractImages.c
r30612 r31160 59 59 time_t t; 60 60 dbValue value; 61 off_t Nmosaic; 61 62 62 63 value.Flt = NAN; … … 236 237 value.Flt = image[N].fwhm_y / 25.0; 237 238 break; 239 240 case IMAGE_FWHM_MEDIAN: 241 if (!(Nmosaic = FindMosaicForImage (image, Nimage, N))) return value; 242 Nmosaic --; // XXX kind of a hack: FindMosaicForImage returns 0 or the mosaic seq number + 1 243 value.Flt = (image[Nmosaic].fwhm_x + image[Nmosaic].fwhm_y) / 50.0; 244 break; 245 case IMAGE_FWHM_MAJ_MEDIAN: 246 if (!(Nmosaic = FindMosaicForImage (image, Nimage, N))) return value; 247 Nmosaic --; // XXX kind of a hack: FindMosaicForImage returns 0 or the mosaic seq number + 1 248 value.Flt = image[Nmosaic].fwhm_x / 25.0; 249 break; 250 case IMAGE_FWHM_MIN_MEDIAN: 251 if (!(Nmosaic = FindMosaicForImage (image, Nimage, N))) return value; 252 Nmosaic --; // XXX kind of a hack: FindMosaicForImage returns 0 or the mosaic seq number + 1 253 value.Flt = image[Nmosaic].fwhm_y / 25.0; 254 break; 255 238 256 case IMAGE_TRATE: 239 257 value.Flt = image[N].trate / 10000.0; -
trunk/Ohana/src/opihi/dvo/dbFields.c
r30612 r31160 395 395 if (!strcasecmp (fieldName, "cerror" )) ESCAPE (IMAGE_CERROR, MAG_NONE, OPIHI_FLT); 396 396 397 if (!strcasecmp (fieldName, "FWHM" )) ESCAPE (IMAGE_FWHM, MAG_NONE, OPIHI_FLT); 398 if (!strcasecmp (fieldName, "FWHM_MAJ" )) ESCAPE (IMAGE_FWHM_MAJ, MAG_NONE, OPIHI_FLT); 399 if (!strcasecmp (fieldName, "FWHM_MIN" )) ESCAPE (IMAGE_FWHM_MIN, MAG_NONE, OPIHI_FLT); 397 if (!strcasecmp (fieldName, "FWHM" )) ESCAPE (IMAGE_FWHM, MAG_NONE, OPIHI_FLT); 398 if (!strcasecmp (fieldName, "FWHM_MAJ" )) ESCAPE (IMAGE_FWHM_MAJ, MAG_NONE, OPIHI_FLT); 399 if (!strcasecmp (fieldName, "FWHM_MIN" )) ESCAPE (IMAGE_FWHM_MIN, MAG_NONE, OPIHI_FLT); 400 if (!strcasecmp (fieldName, "FWHM_MAJOR" )) ESCAPE (IMAGE_FWHM_MAJ, MAG_NONE, OPIHI_FLT); 401 if (!strcasecmp (fieldName, "FWHM_MINOR" )) ESCAPE (IMAGE_FWHM_MIN, MAG_NONE, OPIHI_FLT); 402 403 if (!strcasecmp (fieldName, "FWHM_MEDIAN" )) ESCAPE (IMAGE_FWHM_MEDIAN, MAG_NONE, OPIHI_FLT); 404 if (!strcasecmp (fieldName, "FWHM_MAJ_MEDIAN")) ESCAPE (IMAGE_FWHM_MAJ_MEDIAN, MAG_NONE, OPIHI_FLT); 405 if (!strcasecmp (fieldName, "FWHM_MIN_MEDIAN")) ESCAPE (IMAGE_FWHM_MIN_MEDIAN, MAG_NONE, OPIHI_FLT); 406 if (!strcasecmp (fieldName, "FWHM_MAJOR_MEDIAN")) ESCAPE (IMAGE_FWHM_MAJ_MEDIAN, MAG_NONE, OPIHI_FLT); 407 if (!strcasecmp (fieldName, "FWHM_MINOR_MEDIAN")) ESCAPE (IMAGE_FWHM_MIN_MEDIAN, MAG_NONE, OPIHI_FLT); 408 400 409 if (!strcasecmp (fieldName, "trate" )) ESCAPE (IMAGE_TRATE, MAG_NONE, OPIHI_FLT); 401 410 -
trunk/Ohana/src/opihi/dvo/imextract.c
r30612 r31160 197 197 gprint (GP_ERR, " cerror : astrometric scatter\n"); 198 198 199 gprint (GP_ERR, " FWHM : mean fwhm of exposure\n"); 200 gprint (GP_ERR, " FWHM_MAJ : fwhm of major axis\n"); 201 gprint (GP_ERR, " FWHM_MIN : fwhm of minor axis\n"); 199 gprint (GP_ERR, " -- Note: the follow FWHM are from the PSF model --\n"); 200 gprint (GP_ERR, " FWHM : mean fwhm of chip\n"); 201 gprint (GP_ERR, " FWHM_MAJ : fwhm of chip (major axis)\n"); 202 gprint (GP_ERR, " FWHM_MIN : fwhm of chip (minor axis)\n"); 203 gprint (GP_ERR, " FWHM_MAJOR : fwhm of chip (major axis)\n"); 204 gprint (GP_ERR, " FWHM_MININ : fwhm of chip (minor axis)\n"); 205 206 gprint (GP_ERR, " FWHM_MEDIAN : median fwhm of exposure\n"); 207 gprint (GP_ERR, " FWHM_MAJ_MEDIAN : median fwhm of major axis\n"); 208 gprint (GP_ERR, " FWHM_MIN_MEDIAN : median fwhm of minor axis\n"); 209 gprint (GP_ERR, " FWHM_MAJOR_MEDIAN : median fwhm of major axis\n"); 210 gprint (GP_ERR, " FWHM_MININ_MEDIAN : median fwhm of minor axis\n"); 211 202 212 gprint (GP_ERR, " trate : tracking rate for TDI images\n"); 203 213 -
trunk/Ohana/src/opihi/dvo/skycoverage.c
r29540 r31160 5 5 int skycoverage (int argc, char **argv) { 6 6 7 int WITH_MOSAIC, SOLO_MOSAIC ;7 int WITH_MOSAIC, SOLO_MOSAIC, ShowDensity; 8 8 off_t i, Nimage; 9 9 int N, status, TimeSelect, ByName, xs, ys; … … 60 60 } 61 61 62 ShowDensity = FALSE; 63 if ((N = get_argument (argc, argv, "-density"))) { 64 remove_argument (N, &argc, argv); 65 ShowDensity = TRUE; 66 } 67 62 68 ByName = FALSE; 63 69 if ((N = get_argument (argc, argv, "-name"))) { … … 141 147 if (argc != 3) { 142 148 gprint (GP_ERR, "USAGE: skycoverage (buffer) (Npts)\n"); 143 gprint (GP_ERR, " options: [-scale pixscale] [-center ra dec] [-size Nx Nx] [-proj projection] [-time start range] [-trange start stop] [-name name] [-photcode name] [+mosaic] [-mosaic] \n");149 gprint (GP_ERR, " options: [-scale pixscale] [-center ra dec] [-size Nx Nx] [-proj projection] [-time start range] [-trange start stop] [-name name] [-photcode name] [+mosaic] [-mosaic] [-density]\n"); 144 150 gprint (GP_ERR, " (buffer) saves bitmapped image\n"); 145 151 gprint (GP_ERR, " (Npts) gives the number of test points per image in each dimension\n"); … … 148 154 gprint (GP_ERR, " -size (Nx) (Ny) : specifies the size of the image [360/scale, 180/scale]\n"); 149 155 gprint (GP_ERR, " -proj (projection) : specifies the projection choice [AIT]\n"); 156 gprint (GP_ERR, " -density : create image with relative density (else binary on/off)\n"); 150 157 gprint (GP_ERR, " note: we need 64800 / (pixscale)^2 pixels to represent the sky\n"); 151 158 return (FALSE); … … 186 193 187 194 V = (float *)buf[0].matrix.buffer; 188 bzero (V, Nx*Ny*sizeof(float));189 195 190 196 for (ys = 0; ys < Ny; ys++) { … … 194 200 status &= (r <= 360); 195 201 if (status) { 196 V[ys*Nx + xs] = 2; 202 V[ys*Nx + xs] = ShowDensity ? 0 : 2; 203 } else { 204 V[ys*Nx + xs] = ShowDensity ? -1 : 0; 197 205 } 198 206 } … … 249 257 xs = (int)Xs; 250 258 ys = (int)Ys; 251 V[ys*Nx + xs] = 1; 259 if (ShowDensity) { 260 V[ys*Nx + xs] += 1; 261 } else { 262 V[ys*Nx + xs] = 1; 263 } 252 264 } 253 265 } -
trunk/Ohana/src/opihi/include/dvoshell.h
r30614 r31160 179 179 IMAGE_TIME, 180 180 IMAGE_FWHM, 181 IMAGE_FWHM_MEDIAN, 181 182 IMAGE_EXPTIME, 182 183 IMAGE_NSTAR, … … 200 201 IMAGE_FWHM_MAJ, 201 202 IMAGE_FWHM_MIN, 203 IMAGE_FWHM_MAJ_MEDIAN, 204 IMAGE_FWHM_MIN_MEDIAN, 202 205 IMAGE_TRATE, 203 206 IMAGE_IMAGE_ID, -
trunk/Ohana/src/opihi/lib.data/graphtools.c
r20936 r31160 59 59 set_variable ("YMIN", graphmode[0].ymin); 60 60 set_variable ("YMAX", graphmode[0].ymax); 61 62 set_variable ("KAPA_XMIN", graphmode[0].xmin); 63 set_variable ("KAPA_XMAX", graphmode[0].xmax); 64 set_variable ("KAPA_YMIN", graphmode[0].ymin); 65 set_variable ("KAPA_YMAX", graphmode[0].ymax); 61 66 } 62 67 … … 95 100 SetGraph (graphmode); 96 101 102 set_variable ("KAPA_XMIN", graphmode[0].xmin); 103 set_variable ("KAPA_XMAX", graphmode[0].xmax); 104 set_variable ("KAPA_YMIN", graphmode[0].ymin); 105 set_variable ("KAPA_YMAX", graphmode[0].ymax); 106 97 107 set_variable ("XMIN", graphmode[0].xmin); 98 108 set_variable ("XMAX", graphmode[0].xmax); -
trunk/Ohana/src/opihi/lib.shell/VectorOps.c
r30614 r31160 218 218 } 219 219 free (vec[0].elements.Int); 220 vec[0].elements.Flt = vo;220 vec[0].elements.Flt = temp; 221 221 vec[0].type = OPIHI_FLT; 222 222 } else { … … 229 229 } 230 230 free (vec[0].elements.Flt); 231 vec[0].elements.Int = vo;231 vec[0].elements.Int = temp; 232 232 vec[0].type = OPIHI_INT; 233 233 }
Note:
See TracChangeset
for help on using the changeset viewer.
