Changeset 37807 for trunk/Ohana/src/opihi
- Timestamp:
- Jan 11, 2015, 2:14:39 PM (12 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 60 edited
- 12 copied
-
. (modified) (1 prop)
-
src/opihi/cmd.astro/Makefile (modified) (1 diff)
-
src/opihi/cmd.astro/cdensify.c (modified) (1 diff)
-
src/opihi/cmd.astro/coords.c (modified) (1 diff)
-
src/opihi/cmd.astro/csystem.c (modified) (1 diff)
-
src/opihi/cmd.astro/fitplx.c (modified) (1 diff)
-
src/opihi/cmd.astro/fitpm.c (modified) (1 diff)
-
src/opihi/cmd.astro/gauss.c (modified) (1 diff)
-
src/opihi/cmd.astro/getcoords.c (modified) (2 diffs)
-
src/opihi/cmd.astro/init.c (modified) (2 diffs)
-
src/opihi/cmd.astro/objload.c (modified) (1 diff)
-
src/opihi/cmd.astro/region.c (modified) (4 diffs)
-
src/opihi/cmd.astro/shimage.c (copied) (copied from branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.astro/shimage.c )
-
src/opihi/cmd.astro/vshimage.c (copied) (copied from branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.astro/vshimage.c )
-
src/opihi/cmd.data/Makefile (modified) (2 diffs)
-
src/opihi/cmd.data/center.c (modified) (1 diff)
-
src/opihi/cmd.data/dft2d.c (copied) (copied from branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.data/dft2d.c )
-
src/opihi/cmd.data/dimenup.c (modified) (1 diff)
-
src/opihi/cmd.data/erase.c (modified) (1 diff)
-
src/opihi/cmd.data/fit2d.c (modified) (1 diff)
-
src/opihi/cmd.data/init.c (modified) (5 diffs)
-
src/opihi/cmd.data/load.c (modified) (1 diff)
-
src/opihi/cmd.data/point.c (modified) (1 diff)
-
src/opihi/cmd.data/read_vectors.c (modified) (9 diffs)
-
src/opihi/cmd.data/relocate.c (modified) (1 diff)
-
src/opihi/cmd.data/resize.c (modified) (1 diff)
-
src/opihi/cmd.data/save.c (modified) (1 diff)
-
src/opihi/cmd.data/shapply.c (copied) (copied from branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.data/shapply.c )
-
src/opihi/cmd.data/shdot.c (copied) (copied from branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.data/shdot.c )
-
src/opihi/cmd.data/shfit.c (copied) (copied from branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.data/shfit.c )
-
src/opihi/cmd.data/shterms.c (copied) (copied from branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.data/shterms.c )
-
src/opihi/cmd.data/tv.c (modified) (1 diff)
-
src/opihi/cmd.data/tvchannel.c (modified) (1 diff)
-
src/opihi/cmd.data/tvcontour.c (modified) (1 diff)
-
src/opihi/cmd.data/tvgrid.c (modified) (1 diff)
-
src/opihi/cmd.data/vload.c (modified) (1 diff)
-
src/opihi/cmd.data/vsh.c (copied) (copied from branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.data/vsh.c )
-
src/opihi/cmd.data/vshfit.c (copied) (copied from branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.data/vshfit.c )
-
src/opihi/cmd.data/vzload.c (modified) (1 diff)
-
src/opihi/dvo/Makefile (modified) (1 diff)
-
src/opihi/dvo/avextract.c (modified) (5 diffs)
-
src/opihi/dvo/avmatch.c (modified) (3 diffs)
-
src/opihi/dvo/catname.c (copied) (copied from branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/catname.c )
-
src/opihi/dvo/cmpload.c (modified) (1 diff)
-
src/opihi/dvo/dvo_host_utils.c (modified) (1 diff)
-
src/opihi/dvo/find_matches.c (modified) (2 diffs)
-
src/opihi/dvo/gimages.c (modified) (3 diffs)
-
src/opihi/dvo/images.c (modified) (5 diffs)
-
src/opihi/dvo/imbox.c (modified) (1 diff)
-
src/opihi/dvo/imdata.c (modified) (2 diffs)
-
src/opihi/dvo/imdense.c (modified) (2 diffs)
-
src/opihi/dvo/imextract.c (modified) (1 diff)
-
src/opihi/dvo/imlist.c (modified) (4 diffs)
-
src/opihi/dvo/imstats.c (modified) (2 diffs)
-
src/opihi/dvo/init.c (modified) (2 diffs)
-
src/opihi/dvo/mextract.c (modified) (3 diffs)
-
src/opihi/dvo/mmatch.c (modified) (3 diffs)
-
src/opihi/dvo/mmextract.c (modified) (2 diffs)
-
src/opihi/dvo/objectcoverage.c (modified) (2 diffs)
-
src/opihi/dvo/showtile.c (modified) (1 diff)
-
src/opihi/dvo/simage.c (modified) (1 diff)
-
src/opihi/dvo/skycoverage.c (modified) (4 diffs)
-
src/opihi/dvo/subpix.c (modified) (2 diffs)
-
src/opihi/include/astro.h (modified) (1 diff)
-
src/opihi/include/data.h (modified) (1 diff)
-
src/opihi/include/dvomath.h (modified) (1 diff)
-
src/opihi/lib.shell/BufferOps.c (modified) (1 diff)
-
src/opihi/pantasks/controller_status.c (modified) (2 diffs)
-
src/opihi/pantasks/test/runmacro.sh (copied) (copied from branches/eam_branches/ipp-20140904/Ohana/src/opihi/pantasks/test/runmacro.sh )
-
src/opihi/pantasks/test/trange.sh (copied) (copied from branches/eam_branches/ipp-20140904/Ohana/src/opihi/pantasks/test/trange.sh )
-
src/opihi/pcontrol/Makefile (modified) (1 diff)
-
src/opihi/pcontrol/status.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
- Property svn:mergeinfo changed
-
trunk/Ohana/src/opihi/cmd.astro/Makefile
r36489 r37807 71 71 $(SRC)/star.$(ARCH).o \ 72 72 $(SRC)/transform.$(ARCH).o \ 73 $(SRC)/vshimage.$(ARCH).o \ 74 $(SRC)/shimage.$(ARCH).o \ 73 75 $(SRC)/imsub.$(ARCH).o \ 74 76 $(SRC)/imfit.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.astro/cdensify.c
r36489 r37807 97 97 // generate the PSF in a local tangent plane 98 98 Coords coords; 99 coords.crpix1 = coords.crpix2 = 0.0; 100 coords.crval1 = coords.crval2 = 0.0; 101 coords.cdelt1 = coords.cdelt2 = 1.0; 102 coords.pc1_1 = coords.pc2_2 = 1.0; 103 coords.pc1_2 = coords.pc2_1 = 0.0; 104 coords.Npolyterms = 0; 105 strcpy (coords.ctype, "DEC--TAN"); 99 InitCoords (&coords, "DEC--TAN"); 106 100 107 101 r = vr[0].elements.Flt; -
trunk/Ohana/src/opihi/cmd.astro/coords.c
r33662 r37807 71 71 if ((mosbuffer = SelectBuffer (MOSAIC, OLDBUFFER, TRUE)) == NULL) goto escape; 72 72 GetCoords (&moscoords, &mosbuffer[0].header); 73 RegisterMosaic (&moscoords);73 coords.mosaic = &moscoords; 74 74 } 75 75 -
trunk/Ohana/src/opihi/cmd.astro/csystem.c
r34342 r37807 13 13 if (argc != 5) goto syntax; 14 14 15 switch (argv[1][0]) { 16 case 'C': input = COORD_CELESTIAL; break; 17 case 'G': input = COORD_GALACTIC; break; 18 case 'E': input = COORD_ECLIPTIC; break; 19 default: goto syntax; 15 if (!strcmp(argv[1], "G2004")) { 16 input = COORD_GALACTIC_REID_2004; 17 } else { 18 switch (argv[1][0]) { 19 case 'C': input = COORD_CELESTIAL; break; 20 case 'G': input = COORD_GALACTIC; break; 21 case 'E': input = COORD_ECLIPTIC; break; 22 default: goto syntax; 23 } 20 24 } 21 25 22 switch (argv[2][0]) { 23 case 'C': output = COORD_CELESTIAL; break; 24 case 'G': output = COORD_GALACTIC; break; 25 case 'E': output = COORD_ECLIPTIC; break; 26 default: goto syntax; 26 if (!strcmp(argv[2], "G2004")) { 27 output = COORD_GALACTIC_REID_2004; 28 } else { 29 switch (argv[2][0]) { 30 case 'C': output = COORD_CELESTIAL; break; 31 case 'G': output = COORD_GALACTIC; break; 32 case 'E': output = COORD_ECLIPTIC; break; 33 default: goto syntax; 34 } 27 35 } 28 36 -
trunk/Ohana/src/opihi/cmd.astro/fitplx.c
r36489 r37807 104 104 /* project coordinates to a plane centered on the object with units of arcsec */ 105 105 Coords coords; 106 InitCoords (&coords, "DEC--SIN"); 106 107 coords.crval1 = Rmean; 107 108 coords.crval2 = Dmean; 108 coords.crpix1 = 0;109 coords.crpix2 = 0;110 109 coords.cdelt1 = coords.cdelt2 = 1.0 / 3600.0; 111 coords.pc1_1 = coords.pc2_2 = 1.0;112 coords.pc1_2 = coords.pc2_1 = 0.0;113 coords.Npolyterms = 1;114 strcpy (coords.ctype, "DEC--SIN");115 110 116 111 double *X, *Y, *t, *pX, *pY, *dX, *dY; -
trunk/Ohana/src/opihi/cmd.astro/fitpm.c
r36489 r37807 100 100 /* project coordinates to a plane centered on the object with units of arcsec */ 101 101 Coords coords; 102 InitCoords (&coords, "DEC--SIN"); 102 103 coords.crval1 = Rmean; 103 104 coords.crval2 = Dmean; 104 coords.crpix1 = 0;105 coords.crpix2 = 0;106 105 coords.cdelt1 = coords.cdelt2 = 1.0 / 3600.0; 107 coords.pc1_1 = coords.pc2_2 = 1.0;108 coords.pc1_2 = coords.pc2_1 = 0.0;109 coords.Npolyterms = 1;110 strcpy (coords.ctype, "DEC--SIN");111 106 112 107 double *X, *Y, *t, *dX, *dY; -
trunk/Ohana/src/opihi/cmd.astro/gauss.c
r36679 r37807 30 30 if (!GetImageData (&data, &kapa, name)) return (FALSE); 31 31 FREE (name); 32 33 int channel = 0; 34 if ((N = get_argument (argc, argv, "-ch"))) { 35 channel = GetKapaChannelFromString (argv[N]); 36 if (!channel) return FALSE; 37 KiiSetChannel (kapa, channel - 1); 38 } 32 39 33 40 Nborder = 3; -
trunk/Ohana/src/opihi/cmd.astro/getcoords.c
r34345 r37807 54 54 if (!strcmp(&coords.ctype[4], "-WRP")) { 55 55 if (MOSAIC == NULL) { 56 gprint (GP_ERR, "must supply mosaic for WRP coords \n");56 gprint (GP_ERR, "must supply mosaic for WRP coords with -mosaic [buffer]\n"); 57 57 return (FALSE); 58 58 } … … 65 65 } 66 66 GetCoords (&moscoords, &mosbuffer[0].header); 67 RegisterMosaic (&moscoords);67 coords.mosaic = &moscoords; 68 68 } 69 69 -
trunk/Ohana/src/opihi/cmd.astro/init.c
r36489 r37807 61 61 int times PROTO((int, char **)); 62 62 int transform PROTO((int, char **)); 63 int vshimage PROTO((int, char **)); 64 int shimage PROTO((int, char **)); 63 65 64 66 static Command cmds[] = { … … 121 123 {1, "star", star, "star stats at rough coords"}, 122 124 {1, "transform", transform, "geometric transformation of image"}, 125 {1, "vshimage", vshimage, "generate images for vector spherical harmonic terms"}, 126 {1, "shimage", shimage, "generate images for spherical harmonic terms"}, 123 127 }; 124 128 -
trunk/Ohana/src/opihi/cmd.astro/objload.c
r34088 r37807 19 19 if (!GetImage (NULL, &kapa, name)) return (FALSE); 20 20 FREE (name); 21 22 int channel = 0; 23 if ((N = get_argument (argc, argv, "-ch"))) { 24 channel = GetKapaChannelFromString (argv[N]); 25 if (!channel) return FALSE; 26 KiiSetChannel (kapa, channel - 1); 27 } 21 28 22 29 Objtype = 0; -
trunk/Ohana/src/opihi/cmd.astro/region.c
r36489 r37807 17 17 if (!GetGraph (&graphmode, &kapa, name)) return (FALSE); 18 18 FREE (name); 19 20 int channel = 0; 21 if ((N = get_argument (argc, argv, "-ch"))) { 22 channel = GetKapaChannelFromString (argv[N]); 23 if (!channel) return FALSE; 24 KiiSetChannel (kapa, channel - 1); 25 } 19 26 20 27 NoClear = FALSE; … … 80 87 if (!ohana_str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE); 81 88 Radius = atof (argv[3]); 82 strcpy (graphmode.coords.ctype, "DEC--TAN"); 89 InitCoords (&graphmode.coords, "DEC--TAN"); 90 83 91 if (argc == 5) { 84 92 if (!strcasecmp (argv[4], "TAN")) … … 99 107 strcpy (graphmode.coords.ctype, "DEC--PAR"); 100 108 } 109 110 graphmode.coords.crval1 = Ra; 111 graphmode.coords.crval2 = Dec; 101 112 102 113 graphmode.coords.pc1_1 = (graphmode.flipeast) ? -1 : 1; 114 graphmode.coords.pc2_2 = (graphmode.flipnorth) ? -1 : 1; 115 103 116 /* ask kapa for coordinate limits, to get the right aspect ratio */ 104 117 KapaGetLimits (kapa, &dx, &dy); … … 132 145 set_int_variable ("NORTH_UP", !graphmode.flipnorth); 133 146 134 graphmode.coords.pc1_1 = (graphmode.flipeast) ? -1 : 1;135 graphmode.coords.pc2_2 = (graphmode.flipnorth) ? -1 : 1;136 137 graphmode.coords.pc1_2 = graphmode.coords.pc2_1 = 0.0;138 graphmode.coords.crval1 = Ra;139 graphmode.coords.crval2 = Dec;140 graphmode.coords.crpix1 = 0.0;141 graphmode.coords.crpix2 = 0.0;142 graphmode.coords.cdelt1 = graphmode.coords.cdelt2 = 1.0;143 144 147 if (!NoClear) KapaClearSections (kapa); 145 148 KapaSetLimits (kapa, &graphmode); -
trunk/Ohana/src/opihi/cmd.data/Makefile
r37049 r37807 39 39 $(SRC)/densify.$(ARCH).o \ 40 40 $(SRC)/device.$(ARCH).o \ 41 $(SRC)/dft2d.$(ARCH).o \ 41 42 $(SRC)/dimendown.$(ARCH).o \ 42 43 $(SRC)/dimenup.$(ARCH).o \ … … 160 161 $(SRC)/vstats.$(ARCH).o \ 161 162 $(SRC)/xsection.$(ARCH).o \ 163 $(SRC)/vsh.$(ARCH).o \ 164 $(SRC)/vshfit.$(ARCH).o \ 165 $(SRC)/shterms.$(ARCH).o \ 166 $(SRC)/shfit.$(ARCH).o \ 167 $(SRC)/shdot.$(ARCH).o \ 168 $(SRC)/shapply.$(ARCH).o \ 162 169 $(SRC)/wd.$(ARCH).o \ 163 170 $(SRC)/write_vectors.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.data/center.c
r29540 r37807 16 16 if (!GetImage (NULL, &kapa, name)) return (FALSE); 17 17 FREE (name); 18 19 int channel = 0; 20 if ((N = get_argument (argc, argv, "-ch"))) { 21 channel = GetKapaChannelFromString (argv[N]); 22 if (!channel) return FALSE; 23 KiiSetChannel (kapa, channel - 1); 24 } 18 25 19 26 // XXX need an option to center the image based on the current plot limits -
trunk/Ohana/src/opihi/cmd.data/dimenup.c
r20936 r37807 23 23 return (FALSE); 24 24 } 25 26 gfits_free_matrix (&buf[0].matrix); 27 gfits_free_header (&buf[0].header); 28 CreateBuffer (buf, Nx, Ny, -32, 0.0, 1.0); 25 ResetBuffer (buf, Nx, Ny, -32, 0.0, 1.0); 29 26 30 27 out = (float *) buf[0].matrix.buffer; -
trunk/Ohana/src/opihi/cmd.data/erase.c
r13479 r37807 15 15 if (!GetImage (NULL, &kapa, name)) return (FALSE); 16 16 FREE (name); 17 18 int channel = 0; 19 if ((N = get_argument (argc, argv, "-ch"))) { 20 channel = GetKapaChannelFromString (argv[N]); 21 if (!channel) return FALSE; 22 KiiSetChannel (kapa, channel - 1); 23 } 17 24 18 25 if (argc < 2) { -
trunk/Ohana/src/opihi/cmd.data/fit2d.c
r31160 r37807 138 138 y = yvec[0].elements.Flt; 139 139 z = zvec[0].elements.Flt; 140 if (Weight) dz = dzvec[0].elements.Flt; 141 140 142 for (i = 0; i < xvec[0].Nelements; i++, x++, y++, z++) { 141 143 if (mask[i]) continue; -
trunk/Ohana/src/opihi/cmd.data/init.c
r37049 r37807 1 1 # include "data.h" 2 // XXX adding a comment 2 3 3 4 int accum PROTO((int, char **)); … … 31 32 int densify PROTO((int, char **)); 32 33 int device PROTO((int, char **)); 34 int dft2d PROTO((int, char **)); 33 35 int dimendown PROTO((int, char **)); 34 36 int dimenup PROTO((int, char **)); … … 147 149 int vpop PROTO((int, char **)); 148 150 int vsmooth PROTO((int, char **)); 151 int vsh PROTO((int, char **)); 152 int vshfit PROTO((int, char **)); 153 int shterms PROTO((int, char **)); 154 int shfit PROTO((int, char **)); 155 int shdot PROTO((int, char **)); 156 int shapply PROTO((int, char **)); 149 157 int wd PROTO((int, char **)); 150 158 int write_vectors PROTO((int, char **)); … … 189 197 {1, "densify", densify, "create an image histogram from a set of vectors"}, 190 198 {1, "device", device, "set / get current graphics device"}, 199 {1, "dft2d", dft2d, "2D discrete fourier transform"}, 191 200 {1, "dimendown", dimendown, "convert image to vector"}, 192 201 {1, "dimenup", dimenup, "convert vector to image"}, … … 314 323 {1, "vstats", vstats, "statistics on a vector"}, 315 324 {1, "vzload", vzload, "load vectors as overlay on image display (scaled points)"}, 325 {1, "vsh", vsh, "Vector Spherical Harmonics"}, 326 {1, "vshfit", vshfit, "Vector Spherical Harmonics fits"}, 327 {1, "shterms", shterms, "Spherical Harmonics terms"}, 328 {1, "shfit", shfit, "Spherical Harmonics fits"}, 329 {1, "shdot", shdot, "Spherical Harmonics dot product"}, 330 {1, "shapply", shapply, "Spherical Harmonics fit application"}, 316 331 {1, "wd", wd, "write an image to a file"}, 317 332 {1, "write", write_vectors, "write vectors to datafile"}, -
trunk/Ohana/src/opihi/cmd.data/load.c
r34088 r37807 23 23 if (!GetImageData (&data, &kapa, name)) return (FALSE); 24 24 FREE (name); 25 26 int channel = 0; 27 if ((N = get_argument (argc, argv, "-ch"))) { 28 channel = GetKapaChannelFromString (argv[N]); 29 if (!channel) return FALSE; 30 KiiSetChannel (kapa, channel - 1); 31 } 25 32 26 33 ISCEL = FALSE; -
trunk/Ohana/src/opihi/cmd.data/point.c
r15620 r37807 21 21 if (!GetImageData (&data, &kapa, name)) return (FALSE); 22 22 FREE (name); 23 24 int channel = 0; 25 if ((N = get_argument (argc, argv, "-ch"))) { 26 channel = GetKapaChannelFromString (argv[N]); 27 if (!channel) return FALSE; 28 KiiSetChannel (kapa, channel - 1); 29 } 23 30 24 31 celestial = FALSE; -
trunk/Ohana/src/opihi/cmd.data/read_vectors.c
r37049 r37807 5 5 6 6 void read_vectors_cleanup (); 7 int read_table_sizes (Header *header); 7 8 8 9 int datafile (int argc, char **argv) { … … 331 332 332 333 off_t Nbytes; 333 int i, j, N, N extend, Ny, Binary, vecType, padIfShort;334 char type[16], ID[80] , *CCDKeyword;334 int i, j, N, Ny, Binary, vecType; 335 char type[16], ID[80]; 335 336 FTable table; 336 337 Header header; 337 338 Vector **vec; 338 int FITS_TRANSPOSE;339 339 340 340 table.buffer = NULL; 341 341 header.buffer = NULL; 342 342 343 FITS_TRANSPOSE = FALSE;343 int FITS_TRANSPOSE = FALSE; 344 344 if ((N = get_argument (argc, argv, "-transpose"))) { 345 345 remove_argument (N, &argc, argv); … … 347 347 } 348 348 349 CCDKeyword = NULL;349 char *CCDKeyword = NULL; 350 350 if ((N = get_argument (argc, argv, "-keyword"))) { 351 351 remove_argument (N, &argc, argv); … … 354 354 } 355 355 356 padIfShort = FALSE;356 int padIfShort = FALSE; 357 357 if ((N = get_argument (argc, argv, "-pad-if-short"))) { 358 358 remove_argument (N, &argc, argv); … … 360 360 } 361 361 362 Nextend = -1; 362 int getSizes = FALSE; 363 if ((N = get_argument (argc, argv, "-sizes"))) { 364 remove_argument (N, &argc, argv); 365 getSizes = TRUE; 366 } 367 368 int Nextend = -1; 363 369 if ((N = get_argument (argc, argv, "-extnum"))) { 364 370 remove_argument (N, &argc, argv); 365 371 Nextend = atoi (extname); 372 } 373 374 int start = 0; 375 int Nrows = -1; // -1 : read entire table 376 if ((N = get_argument (argc, argv, "-range"))) { 377 remove_argument (N, &argc, argv); 378 start = atoi (argv[N]); 379 remove_argument (N, &argc, argv); 380 Nrows = atoi (argv[N]); 381 remove_argument (N, &argc, argv); 382 } 383 384 // if CharAsVectors, char fields will be saved as vectors NAME:0 -- NAME:n for n characters 385 // else char fields will be saved as $NAME:0 - $NAME:m for m rows 386 // if (Ny > 10000), force CharAsVectors 387 int CharAsVectors = FALSE; 388 if ((N = get_argument (argc, argv, "-char-vectors"))) { 389 remove_argument (N, &argc, argv); 390 CharAsVectors = TRUE; 366 391 } 367 392 … … 397 422 } 398 423 if (!gfits_load_header (f, &header)) ESCAPE ("error reading header for extension %d\n", Nextend); 399 if (!gfits_fread_ftable_data (f, &table, padIfShort)) ESCAPE ("error reading table for extension %d\n", Nextend); 400 424 425 if (getSizes) { 426 read_table_sizes (&header); 427 if (CCDKeyword != NULL) free (CCDKeyword); 428 gfits_free_header (&header); 429 return TRUE; 430 } 431 432 if (Nrows == -1) { 433 Nrows = header.Naxis[1] - start; 434 } 435 if (start < 0) ESCAPE ("invalid range: start < 0\n"); 436 if (start >= header.Naxis[1]) ESCAPE ("invalid range: start >= Ny (%d)\n", header.Naxis[1]); 437 if (Nrows < 0) ESCAPE ("invalid range: Nrows < 0\n"); 438 if (start + Nrows > header.Naxis[1]) ESCAPE ("invalid range: start + Nrows > Ny (%d)\n", header.Naxis[1]); 439 440 // Ny = 100, start = 0, Nrows = -1 -> Nrows => 100 441 // Ny = 100, start = 10, Nrows = 90 442 443 if (!gfits_fread_ftable_range (f, padIfShort, &table, start, Nrows)) ESCAPE ("error reading table for extension %d\n", Nextend); 401 444 } else { 402 445 if (CCDKeyword == NULL) { … … 428 471 continue; 429 472 } 430 if (!gfits_fread_ftable_data (f, &table, padIfShort)) ESCAPE ("error reading table for extension\n"); 473 474 if (Nrows == -1) { 475 Nrows = header.Naxis[1] - start; 476 } 477 if (start < 0) ESCAPE ("invalid range: start < 0\n"); 478 if (start >= header.Naxis[1]) ESCAPE ("invalid range: start >= Ny (%d)\n", header.Naxis[1]); 479 if (Nrows < 0) ESCAPE ("invalid range: Nrows < 0\n"); 480 if (start + Nrows > header.Naxis[1]) ESCAPE ("invalid range: start + Nrows > Ny (%d)\n", header.Naxis[1]); 481 482 if (!gfits_fread_ftable_range (f, padIfShort, &table, start, Nrows)) ESCAPE ("error reading table for extension %d\n", Nextend); 483 484 // if (!gfits_fread_ftable_data (f, &table, padIfShort)) ESCAPE ("error reading table for extension\n"); 485 431 486 break; 432 487 } … … 465 520 if (!FITS_TRANSPOSE) { 466 521 // read string column into a list rather than a vector 467 if (!strcmp (type, "char") ) {522 if (!strcmp (type, "char") && !CharAsVectors && (Ny < 3000)) { 468 523 char *fieldName = argv[i]; 469 524 char *Ptr = data; … … 537 592 if (vec) free (vec); 538 593 } 594 595 // read -fits foo -sizes -- Nx, Ny, Nfields -> $table:Nx, $table:Ny, $table:$Nfields 596 // read -fits foo -fields 597 598 int read_table_sizes (Header *header) { 599 600 int Nfields; 601 602 gfits_scan (header, "TFIELDS", "%d", 1, &Nfields); 603 604 set_int_variable ("table:Nx", header->Naxis[0]); 605 set_int_variable ("table:Nx", header->Naxis[0]); 606 set_int_variable ("table:Nfields", Nfields); 607 608 return TRUE; 609 } 610 -
trunk/Ohana/src/opihi/cmd.data/relocate.c
r27435 r37807 17 17 FREE (name); 18 18 19 int channel = 0; 20 if ((N = get_argument (argc, argv, "-ch"))) { 21 channel = GetKapaChannelFromString (argv[N]); 22 if (!channel) return FALSE; 23 KiiSetChannel (kapa, channel - 1); 24 } 25 19 26 if (argc != 3) { 20 27 gprint (GP_ERR, "USAGE: relocate x y [-n]\n"); -
trunk/Ohana/src/opihi/cmd.data/resize.c
r29938 r37807 17 17 if (!GetImage (NULL, &kapa, name)) return (FALSE); 18 18 FREE (name); 19 20 int channel = 0; 21 if ((N = get_argument (argc, argv, "-ch"))) { 22 channel = GetKapaChannelFromString (argv[N]); 23 if (!channel) return FALSE; 24 KiiSetChannel (kapa, channel - 1); 25 } 19 26 20 27 if ((N = get_argument (argc, argv, "-by-image"))) { -
trunk/Ohana/src/opihi/cmd.data/save.c
r13479 r37807 16 16 FREE (name); 17 17 18 int channel = 0; 19 if ((N = get_argument (argc, argv, "-ch"))) { 20 channel = GetKapaChannelFromString (argv[N]); 21 if (!channel) return FALSE; 22 KiiSetChannel (kapa, channel - 1); 23 } 24 18 25 celestial = FALSE; 19 26 if ((N = get_argument (argc, argv, "-c"))) { -
trunk/Ohana/src/opihi/cmd.data/tv.c
r35757 r37807 18 18 if (!GetImage (&data, &kapa, name)) return (FALSE); 19 19 FREE (name); 20 21 int channel = 0; 22 if ((N = get_argument (argc, argv, "-ch"))) { 23 remove_argument (N, &argc, argv); 24 channel = GetKapaChannelFromString (argv[N]); 25 remove_argument (N, &argc, argv); 26 if (!channel) return FALSE; 27 KiiSetChannel (kapa, channel - 1); 28 } 20 29 21 30 /* shell exits on pipe close, FIX */ -
trunk/Ohana/src/opihi/cmd.data/tvchannel.c
r16038 r37807 22 22 } 23 23 24 Nchannel = atoi (argv[1]); 24 Nchannel = GetKapaChannelFromString (argv[1]); 25 if (!Nchannel) return FALSE; 26 27 KiiSetChannel (kapa, Nchannel - 1); 28 return (TRUE); 29 } 30 31 int GetKapaChannelFromString (char *string) { 32 33 int Nchannel = atoi (string); 25 34 if (Nchannel == 0) { 26 35 // try the string values R/Red, G/Green, B/Blue 27 if (!strcasecmp ( argv[1], "R") || !strcasecmp (argv[1], "RED")) {36 if (!strcasecmp (string, "R") || !strcasecmp (string, "RED")) { 28 37 Nchannel = 1; 29 38 } 30 if (!strcasecmp ( argv[1], "G") || !strcasecmp (argv[1], "GREEN")) {39 if (!strcasecmp (string, "G") || !strcasecmp (string, "GREEN")) { 31 40 Nchannel = 2; 32 41 } 33 if (!strcasecmp ( argv[1], "B") || !strcasecmp (argv[1], "BLUE")) {42 if (!strcasecmp (string, "B") || !strcasecmp (string, "BLUE")) { 34 43 Nchannel = 3; 35 44 } 36 45 } 37 if ((Nchannel < 1) || (Nchannel > 3)) { 38 gprint (GP_ERR, "invalid channel : use 1 - 3 or (R)ed, (G)reen, (B)lue\n"); 39 return (FALSE); 46 if ((Nchannel < 1) || (Nchannel > 10)) { 47 gprint (GP_ERR, "invalid channel : use 1 - 10 or (R)ed, (G)reen, (B)lue\n"); 48 gprint (GP_ERR, " (R)ed, (G)reen, (B)lue == (1,2,3)\n"); 49 return (0); 40 50 } 41 42 KiiSetChannel (kapa, Nchannel - 1); 43 return (TRUE); 51 return Nchannel; 44 52 } -
trunk/Ohana/src/opihi/cmd.data/tvcontour.c
r13479 r37807 71 71 if (!GetImage (NULL, &kapa, name)) return (FALSE); 72 72 FREE (name); 73 74 int channel = 0; 75 if ((N = get_argument (argc, argv, "-ch"))) { 76 channel = GetKapaChannelFromString (argv[N]); 77 if (!channel) return FALSE; 78 KiiSetChannel (kapa, channel - 1); 79 } 73 80 74 81 if ((argc != 4) && (argc != 5)) { -
trunk/Ohana/src/opihi/cmd.data/tvgrid.c
r13479 r37807 24 24 if (!GetImage (NULL, &kapa, name)) return (FALSE); 25 25 FREE (name); 26 27 int channel = 0; 28 if ((N = get_argument (argc, argv, "-ch"))) { 29 channel = GetKapaChannelFromString (argv[N]); 30 if (!channel) return FALSE; 31 KiiSetChannel (kapa, channel - 1); 32 } 26 33 27 34 if (argc != 3) { -
trunk/Ohana/src/opihi/cmd.data/vload.c
r20936 r37807 18 18 if (!GetImage (NULL, &kapa, name)) return (FALSE); 19 19 FREE (name); 20 21 int channel = 0; 22 if ((N = get_argument (argc, argv, "-ch"))) { 23 channel = GetKapaChannelFromString (argv[N]); 24 if (!channel) return FALSE; 25 KiiSetChannel (kapa, channel - 1); 26 } 20 27 21 28 type = KII_OVERLAY_BOX; -
trunk/Ohana/src/opihi/cmd.data/vzload.c
r20936 r37807 18 18 if (!GetImage (NULL, &kapa, name)) return (FALSE); 19 19 FREE (name); 20 21 int channel = 0; 22 if ((N = get_argument (argc, argv, "-ch"))) { 23 channel = GetKapaChannelFromString (argv[N]); 24 if (!channel) return FALSE; 25 KiiSetChannel (kapa, channel - 1); 26 } 20 27 21 28 MAX_OUTPUT_SIZE = 10.0; -
trunk/Ohana/src/opihi/dvo/Makefile
r37049 r37807 46 46 $(SRC)/badimages.$(ARCH).o \ 47 47 $(SRC)/catdir.$(ARCH).o \ 48 $(SRC)/catname.$(ARCH).o \ 48 49 $(SRC)/cmatch.$(ARCH).o \ 49 50 $(SRC)/cmpload.$(ARCH).o \ -
trunk/Ohana/src/opihi/dvo/avextract.c
r37049 r37807 5 5 off_t i, j, n, m; 6 6 int N, Npts, NPTS, last, next, state, Nfields, Nreturn, Ncstack, Nstack; 7 int Nsecfilt, VERBOSE , needMeasures;7 int Nsecfilt, VERBOSE; 8 8 char **cstack, name[1024]; 9 9 void *Signal; … … 137 137 // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results 138 138 if (PARALLEL && !HOST_ID) { 139 int status = HostTableParallelOps (skylist, argc, argv, RESULT_FILE, TRUE, 0, VERBOSE);139 int status = HostTableParallelOps (skylist, argc, argv, RESULT_FILE, TRUE, 0, VERBOSE); 140 140 141 141 dbFreeFields (fields, Nfields); … … 163 163 } 164 164 165 // check the requested fields : are all average/secfilt entries, or do we need measures? 166 needMeasures = FALSE; 167 for (i = 0; !needMeasures && (i < Nfields); i++) { 168 if (fields[i].photcode == NULL) continue; // non-measure fields do not have a photcode 169 if (fields[i].photcode[0].type == PHOT_REF) needMeasures = TRUE; 170 if (fields[i].photcode[0].type == PHOT_DEP) needMeasures = TRUE; 171 } 165 // check the requested fields 166 int needMeasure = dbFieldNeedMeasure (fields, Nfields); 167 int needLensobj = dbFieldNeedLensobj (fields, Nfields); 168 int needStarpar = dbFieldNeedStarpar (fields, Nfields, TRUE); 172 169 173 170 // grab data from all selected sky regions … … 189 186 catalog.filename = (HOST_ID || PARALLEL_LOCAL) ? hostfile : skylist[0].filename[i]; 190 187 catalog.catflags = LOAD_AVES | LOAD_SECF; 191 catalog.catflags |= needMeasures ? LOAD_MEAS : SKIP_MEAS; 188 catalog.catflags |= needMeasure ? LOAD_MEAS : SKIP_MEAS; 189 catalog.catflags |= needLensobj ? LOAD_LENSOBJ : SKIP_LENSOBJ; 190 catalog.catflags |= needStarpar ? LOAD_STARPAR : SKIP_STARPAR; 192 191 catalog.Nsecfilt = 0; 193 192 … … 205 204 // XXX for measure values, this could be optimized for one loop over measures... 206 205 207 m = catalog.average[j].measureOffset;208 209 206 dbExtractAveragesInitAve (); // reset counters for saved fields (costs very little) 210 207 208 Average *average = &catalog.average[j]; 209 210 m = average->measureOffset; 211 Measure *measure = needMeasure ? &catalog.measure[m] : NULL; 212 213 m = average->lensobjOffset; 214 Lensobj *lensobj = needLensobj ? &catalog.lensobj[m] : NULL; 215 216 m = average->starparOffset; 217 StarPar *starpar = needStarpar ? &catalog.starpar[m] : NULL; 218 219 m = j*Nsecfilt; 220 SecFilt *secfilt = &catalog.secfilt[m]; 221 211 222 for (n = 0; n < Nfields; n++) { 212 values[n] = dbExtractAverages ( &catalog.average[j], &catalog.secfilt[j*Nsecfilt], &catalog.measure[m], &fields[n]);223 values[n] = dbExtractAverages (average, secfilt, measure, lensobj, starpar, &fields[n]); 213 224 } 214 225 -
trunk/Ohana/src/opihi/dvo/avmatch.c
r37049 r37807 149 149 } 150 150 151 // check the requested fields : are all average/secfilt entries, or do we need measures? 152 int needMeasures = FALSE; 153 for (i = 0; !needMeasures && (i < Nfields); i++) { 154 if (fields[i].photcode == NULL) continue; // assert this? 155 if (fields[i].photcode[0].type == PHOT_REF) needMeasures = TRUE; 156 if (fields[i].photcode[0].type == PHOT_DEP) needMeasures = TRUE; 157 } 151 // check the requested fields 152 int needMeasure = dbFieldNeedMeasure (fields, Nfields); 153 int needLensobj = dbFieldNeedLensobj (fields, Nfields); 154 int needStarpar = dbFieldNeedStarpar (fields, Nfields, TRUE); 158 155 159 156 /* create output storage vectors */ … … 194 191 catalog.filename = HOST_ID ? hostfile : skylist[0].filename[i]; 195 192 catalog.catflags = LOAD_AVES | LOAD_SECF; 196 catalog.catflags |= needMeasures ? LOAD_MEAS : SKIP_MEAS; 193 catalog.catflags |= needMeasure ? LOAD_MEAS : SKIP_MEAS; 194 catalog.catflags |= needLensobj ? LOAD_LENSOBJ : SKIP_LENSOBJ; 195 catalog.catflags |= needStarpar ? LOAD_STARPAR : SKIP_STARPAR; 197 196 catalog.Nsecfilt = 0; 198 197 … … 219 218 if (Ncat == -2) continue; // no matches to this point 220 219 221 m = catalog.average[Ncat].measureOffset; 220 m = Ncat; 221 Average *average = &catalog.average[m]; 222 223 m = average->measureOffset; 224 Measure *measure = needMeasure ? &catalog.measure[m] : NULL; 225 226 m = average->lensobjOffset; 227 Lensobj *lensobj = needLensobj ? &catalog.lensobj[m] : NULL; 228 229 m = average->starparOffset; 230 StarPar *starpar = needStarpar ? &catalog.starpar[m] : NULL; 231 232 m = Ncat*Nsecfilt; 233 SecFilt *secfilt = &catalog.secfilt[m]; 222 234 223 235 // reset counters for saved fields, extract fields 224 236 dbExtractAveragesInitAve (); 225 237 for (n = 0; n < Nfields; n++) { 226 values[n] = dbExtractAverages ( &catalog.average[Ncat], &catalog.secfilt[Ncat*Nsecfilt], &catalog.measure[m], &fields[n]);238 values[n] = dbExtractAverages (average, secfilt, measure, lensobj, starpar, &fields[n]); 227 239 } 228 240 -
trunk/Ohana/src/opihi/dvo/cmpload.c
r34088 r37807 24 24 if (!GetImage (NULL, &kapa, name)) return (FALSE); 25 25 FREE (name); 26 27 int channel = 0; 28 if ((N = get_argument (argc, argv, "-ch"))) { 29 channel = GetKapaChannelFromString (argv[N]); 30 if (!channel) return FALSE; 31 KiiSetChannel (kapa, channel - 1); 32 } 26 33 27 34 Objtype = 0; -
trunk/Ohana/src/opihi/dvo/dvo_host_utils.c
r35416 r37807 137 137 138 138 // determine the sky region 139 // XXX EAM 20141230 : this needs to respect the -region selection 139 140 double Rmin, Rmax, Dmin, Dmax; 140 141 get_skyregion (&Rmin, &Rmax, &Dmin, &Dmax); -
trunk/Ohana/src/opihi/dvo/find_matches.c
r36489 r37807 38 38 * far from the projection pole. We use the center of the region (catalog) for crval1,2. 39 39 */ 40 InitCoords (&tcoords, "DEC--ARC"); 40 41 tcoords.crval1 = 0.5*(region[0].Rmin + region[0].Rmax); 41 42 if (region[0].Dmax < 90) { … … 44 45 tcoords.crval2 = 90.0; 45 46 } 46 tcoords.crpix1 = 0;47 tcoords.crpix2 = 0;48 47 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 49 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;50 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;51 tcoords.Npolyterms = 1;52 strcpy (tcoords.ctype, "DEC--ARC");53 48 54 49 // this region includes a boundary layer of size RADIUS -
trunk/Ohana/src/opihi/dvo/gimages.c
r36489 r37807 85 85 if ((image = LoadImagesDVO (&Nimage)) == NULL) return (FALSE); 86 86 image_subset (image, Nimage, &subset, &Nsubset, selection, tzero, trange, TimeSelect); 87 BuildChipMatch (image, Nimage);87 // BuildChipMatch (image, Nimage); 88 88 89 89 int DistortImage = wordhash ("-DIS"); … … 102 102 } 103 103 } 104 if (!FindMosaicForImage (image, Nimage, i)) continue;105 104 106 105 typehash = wordhash (&image[i].coords.ctype[4]); … … 129 128 if (fabs(Ro - Ra) > 120.0) continue; 130 129 130 InitCoords (&local, "DEC--TAN"); 131 131 local.crval1 = Ro; 132 132 local.crval2 = Do; 133 local.crpix1 = local.crpix2 = 0.0;134 133 local.cdelt1 = local.cdelt2 = 1.0/3600.0; 135 local.pc1_1 = local.pc2_2 = 1.0;136 local.pc2_1 = local.pc1_2 = 0.0;137 local.Npolyterms = 1;138 strcpy (local.ctype, "DEC--TAN");139 134 140 135 if (typehash == DistortImage) { -
trunk/Ohana/src/opihi/dvo/images.c
r34584 r37807 131 131 /* it is not an error for the database not to have any images */ 132 132 if ((image = LoadImagesDVO (&Nimage)) == NULL) return (TRUE); 133 BuildChipMatch (image, Nimage);133 // BuildChipMatch (image, Nimage); 134 134 135 135 if (SOLO_MOSAIC && photcode) { … … 152 152 SetVector (&Yvec, OPIHI_FLT, NPTS); 153 153 154 Image *mosaic = NULL; 155 154 156 ALLOCATE (plist, int, NPTS); 155 157 n = N = 0; … … 157 159 if (ByName && strncmp (image[i].name, name, strlen(name))) continue; 158 160 if (TimeSelect && ((image[i].tzero < tzero) || (image[i].tzero+image[i].trate*image[i].NY > tzero + trange))) continue; 159 if (!(Nmosaic = FindMosaicForImage (image, Nimage, i))) continue; 160 Nmosaic --; // XXX kind of a hack: FindMosaicForImage returns 0 or the mosaic seq number + 1 161 162 mosaic = image[i].parent; 163 Nmosaic = (SOLO_MOSAIC && mosaic) ? mosaic - image : -1; 164 161 165 if (photcode) { 162 166 if ( photcodeEquiv && (photcode[0].code != GetPhotcodeEquivCodebyCode(image[i].photcode))) continue; … … 170 174 typehash = wordhash (&image[i].coords.ctype[4]); 171 175 172 if (photcode && SOLO_MOSAIC ) {176 if (photcode && SOLO_MOSAIC && (Nmosaic >= 0)) { 173 177 // mosaic (DIS) images are not currently given a photcode : plot these via the WRP entries 174 178 /* DIS images represent a field, not a chip */ 175 179 if (typehash != ChipImage) continue; 176 180 if (foundMosaic[Nmosaic]) continue; 177 x[0] = -0.5* image[Nmosaic].NX; y[0] = -0.5*image[Nmosaic].NY;178 x[1] = +0.5* image[Nmosaic].NX; y[1] = -0.5*image[Nmosaic].NY;179 x[2] = +0.5* image[Nmosaic].NX; y[2] = +0.5*image[Nmosaic].NY;180 x[3] = -0.5* image[Nmosaic].NX; y[3] = +0.5*image[Nmosaic].NY;181 x[0] = -0.5*mosaic->NX; y[0] = -0.5*mosaic->NY; 182 x[1] = +0.5*mosaic->NX; y[1] = -0.5*mosaic->NY; 183 x[2] = +0.5*mosaic->NX; y[2] = +0.5*mosaic->NY; 184 x[3] = -0.5*mosaic->NX; y[3] = +0.5*mosaic->NY; 181 185 for (j = 0; j < Npts; j++) { 182 status = XY_to_RD (&r[j], &d[j], x[j], y[j], & image[Nmosaic].coords);186 status = XY_to_RD (&r[j], &d[j], x[j], y[j], &mosaic->coords); 183 187 if (!status) break; 184 188 r[j] = ohana_normalize_angle (r[j]); … … 198 202 199 203 /* DIS images represent a field, not a chip */ 200 if ((typehash == DistortImage) && !WITH_MOSAIC) continue; 201 if ((typehash != DistortImage) && SOLO_MOSAIC) continue; 204 if ((typehash == DistortImage) && !WITH_MOSAIC) continue; // do not plot the mosaic images 205 if ((typehash != DistortImage) && SOLO_MOSAIC) continue; // plot only the mosaic images 206 202 207 if (typehash == DistortImage) { 203 208 x[0] = -0.5*image[i].NX; y[0] = -0.5*image[i].NY; -
trunk/Ohana/src/opihi/dvo/imbox.c
r34584 r37807 43 43 SetVector (&Yvec, OPIHI_FLT, NPTS); 44 44 45 mosaic.ctype[0] = 0; 46 45 47 while (gfits_fread_header (f, &header)) { 46 48 if (!GetCoords (&coords, &header)) goto skip; 47 49 if (!SOLO_PHU && !strcmp (&coords.ctype[4], "-DIS")) { 48 50 mosaic = coords; 49 RegisterMosaic (&mosaic);50 51 goto skip; 52 } 53 if (!strcmp (&coords.ctype[4], "-WRP")) { 54 if (!mosaic.ctype[0]) { 55 fprintf (stderr, "PHU mosaic not found\n"); 56 return FALSE; 57 } 58 coords.mosaic = &mosaic; 51 59 } 52 60 -
trunk/Ohana/src/opihi/dvo/imdata.c
r37049 r37807 87 87 if ((image = LoadImagesDVO (&Nimage)) == NULL) return (FALSE); 88 88 image_subset (image, Nimage, &subset, &Nsubset, selection, tzero, trange, TimeSelect); 89 BuildChipMatch (image, Nimage);89 // BuildChipMatch (image, Nimage); 90 90 GetTimeFormat (&TimeReference, &TimeFormat); 91 91 … … 103 103 I = subset[i]; 104 104 105 if (!FindMosaicForImage (image, Nimage, I)) continue;106 105 skyset = SkyListByImage (sky, -1, &image[I]); 107 106 -
trunk/Ohana/src/opihi/dvo/imdense.c
r34584 r37807 22 22 23 23 if ((image = LoadImagesDVO (&Nimage)) == NULL) return (FALSE); 24 BuildChipMatch (image, Nimage);24 // BuildChipMatch (image, Nimage); 25 25 26 26 Rmin = graphmode.coords.crval1 - 182.0; … … 42 42 /* project this image to screen display coords */ 43 43 status = FALSE; 44 if (!FindMosaicForImage (image, Nimage, i)) continue;45 44 XY_to_RD (&r, &d, x, y, &image[i].coords); 46 45 r = ohana_normalize_angle (r); -
trunk/Ohana/src/opihi/dvo/imextract.c
r37049 r37807 90 90 91 91 if ((image = LoadImagesDVO (&Nimage)) == NULL) goto escape; 92 BuildChipMatch (image, Nimage);92 // BuildChipMatch (image, Nimage); 93 93 dbExtractImagesInit (); 94 94 -
trunk/Ohana/src/opihi/dvo/imlist.c
r34088 r37807 38 38 } 39 39 40 // int RegionSelect = FALSE;41 // if ((N = get_argument (argc, argv, "-region"))) {42 // remove_argument (N, &argc, argv);43 // RegionSelect = TRUE;44 // }45 46 40 PhotcodeValue = NULL; 47 41 PhotcodeSelect = FALSE; … … 76 70 } 77 71 72 int MAX_LIST = -1; 73 if ((N = get_argument (argc, argv, "-max-list"))) { 74 remove_argument (N, &argc, argv); 75 MAX_LIST = atoi (argv[N]); 76 remove_argument (N, &argc, argv); 77 } 78 78 79 if (argc != 1) { 79 gprint (GP_ERR, "USAGE: image [-time start range] [-region] [-name string] \n");80 gprint (GP_ERR, "USAGE: image [-time start range] [-region] [-name string] [-photcode code] [-Nphotcode N] [-max-list N]\n"); 80 81 return (FALSE); 81 82 } … … 83 84 if ((image = LoadImagesDVO (&Nimage)) == NULL) return (FALSE); 84 85 image_subset (image, Nimage, &subset, &Nsubset, selection, tzero, trange, TimeSelect); 85 BuildChipMatch (image, Nimage);86 MAX_LIST = MAX_LIST < 0 ? Nsubset : MIN(MAX_LIST, Nsubset); 86 87 87 88 GetTimeFormat (&TimeReference, &TimeFormat); 88 89 89 for (j = 0; j < Nsubset; j++) {90 for (j = 0; j < MAX_LIST; j++) { 90 91 i = subset[j]; 91 92 if (NameSelect && (strstr (image[i].name, name) == (char *) NULL)) continue; … … 97 98 } 98 99 } 99 if (!FindMosaicForImage (image, Nimage, i)) continue;100 100 t = TimeValue (image[i].tzero, TimeReference, TimeFormat); 101 101 if (!strcmp(&image[i].coords.ctype[4], "-DIS")) { -
trunk/Ohana/src/opihi/dvo/imstats.c
r34584 r37807 31 31 32 32 if ((image = LoadImagesDVO (&Nimage)) == NULL) return (FALSE); 33 BuildChipMatch (image, Nimage);33 // BuildChipMatch (image, Nimage); 34 34 35 35 /* assign vector values */ … … 44 44 else 45 45 Yvec.elements.Flt[i] = image[i].dMcal; 46 if (!FindMosaicForImage (image, Nimage, i)) continue;47 46 XY_to_RD (&r, &d, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords); 48 47 gprint (GP_ERR, "%d %8.4f %8.4f %10d %6d %5.3f %6.3f %6.3f\n", -
trunk/Ohana/src/opihi/dvo/init.c
r37049 r37807 7 7 int calmextract PROTO((int, char **)); 8 8 int catlog PROTO((int, char **)); 9 int catname PROTO((int, char **)); 9 10 int catdir_define PROTO((int, char **)); 10 11 int ccd PROTO((int, char **)); … … 68 69 // {1, "calextract", calextract, "extract photometry calibration"}, 69 70 // {1, "calmextract", calmextract, "extract photometry calibration"}, 71 {1, "catname", catname, "list catalog files by name"}, 70 72 {1, "catdir", catdir_define,"re-define CATDIR"}, 71 73 // {1, "ccd", ccd, "plot color-color diagram"}, -
trunk/Ohana/src/opihi/dvo/mextract.c
r35416 r37807 211 211 } 212 212 213 // int needLensing = dbFieldNeedLensing (fields, Nfields); 214 int needStarpar = dbFieldNeedStarpar (fields, Nfields, FALSE); 215 213 216 // grab data from all selected sky regions 214 217 Signal = signal (SIGINT, handle_interrupt); … … 227 230 catalog.filename = HOST_ID ? hostfile : skylist[0].filename[i]; 228 231 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 232 // catalog.catflags |= needLensing ? LOAD_LENSING : SKIP_LENSING; 233 catalog.catflags |= needStarpar ? LOAD_STARPAR : SKIP_STARPAR; 229 234 catalog.Nsecfilt = Nsecfilt; 230 235 … … 259 264 // extract the relevant values for this measurement 260 265 dbExtractMeasuresInitMeas (); // reset counters for saved fields (costs very little 266 267 Average *average = &catalog.average[j]; 268 269 int Nstarpar = average->starparOffset; 270 StarPar *starpar = needStarpar ? &catalog.starpar[Nstarpar] : NULL; 271 272 // int Nlensing = average->lensobjOffset; 273 // Lensobj *lensobj = needLensobj ? &catalog.lensobj[m] : NULL; 274 275 int Nsec = j*Nsecfilt; 276 SecFilt *secfilt = &catalog.secfilt[Nsec]; 277 261 278 for (n = 0; n < Nfields; n++) { 262 values[n] = dbExtractMeasures ( &catalog.average[j], &catalog.secfilt[j*Nsecfilt], &catalog.measure[m], &fields[n]);279 values[n] = dbExtractMeasures (average, secfilt, &catalog.measure[m], NULL, starpar, &fields[n]); 263 280 } 264 281 // fprintf (stderr, "object: ave: %f, cat: %f, averef %d\n", fields[n].name, values[2], values[3], catalog.measure[m].averef); -
trunk/Ohana/src/opihi/dvo/mmatch.c
r35416 r37807 233 233 ALLOCATE (index, off_t, Nelem); 234 234 235 // int needLensing = dbFieldNeedLensing (fields, Nfields); 236 int needStarpar = dbFieldNeedStarpar (fields, Nfields, FALSE); 237 235 238 // grab data from all selected sky regions 236 239 Signal = signal (SIGINT, handle_interrupt); … … 246 249 catalog.filename = HOST_ID ? hostfile : skylist[0].filename[i]; 247 250 catalog.catflags = LOAD_AVES | LOAD_SECF | LOAD_MEAS; 251 catalog.catflags |= needStarpar ? LOAD_STARPAR : SKIP_STARPAR; 248 252 catalog.Nsecfilt = Nsecfilt; 249 253 … … 282 286 // extract the relevant values for this measurement 283 287 dbExtractMeasuresInitMeas (); // reset counters for saved fields (costs very little 288 289 Average *average = &catalog.average[Ncat]; 290 291 int Nstarpar = average->starparOffset; 292 StarPar *starpar = needStarpar ? &catalog.starpar[Nstarpar] : NULL; 293 294 // int Nlensing = average->lensobjOffset; 295 // Lensobj *lensobj = needLensobj ? &catalog.lensobj[m] : NULL; 296 297 int Nsec = Ncat*Nsecfilt; 298 SecFilt *secfilt = &catalog.secfilt[Nsec]; 299 284 300 for (n = 0; n < Nfields; n++) { 285 values[n] = dbExtractMeasures ( &catalog.average[Ncat], &catalog.secfilt[Ncat*Nsecfilt], &catalog.measure[m], &fields[n]);301 values[n] = dbExtractMeasures (average, secfilt, &catalog.measure[m], NULL, starpar, &fields[n]); 286 302 } 287 303 -
trunk/Ohana/src/opihi/dvo/mmextract.c
r35263 r37807 174 174 } 175 175 176 // int needLensing = dbFieldNeedLensing (fields, Nfields); 177 int needStarpar = dbFieldNeedStarpar (fields, Nfields, FALSE); 178 176 179 // grab data from all selected sky regions 177 180 Signal = signal (SIGINT, handle_interrupt); … … 213 216 // extract the relevant values for this measurement 214 217 dbExtractMeasuresInitMeas (); // reset counters for saved fields 218 219 Average *average = &catalog.average[j]; 220 221 int Nstarpar = average->starparOffset; 222 StarPar *starpar = needStarpar ? &catalog.starpar[Nstarpar] : NULL; 223 224 // int Nlensing = average->lensobjOffset; 225 // Lensobj *lensobj = needLensobj ? &catalog.lensobj[m] : NULL; 226 227 int Nsec = j*Nsecfilt; 228 SecFilt *secfilt = &catalog.secfilt[Nsec]; 229 215 230 for (n = 0; n < Nfields; n++) { 216 231 // values needs to be a pointer to a type with FLT and INT (with a union, we would save a bit of memory...) 217 values[n] = dbExtractMeasures ( &catalog.average[j], &catalog.secfilt[j*Nsecfilt], &catalog.measure[m], &fields[n]);232 values[n] = dbExtractMeasures (average, secfilt, &catalog.measure[m], NULL, starpar, &fields[n]); 218 233 } 219 234 // fprintf (stderr, "object: ave: %f, cat: %f, averef %d\n", fields[n].name, values[2], values[3], catalog.measure[m].averef); -
trunk/Ohana/src/opihi/dvo/objectcoverage.c
r34088 r37807 147 147 strcpy (buf[0].file, "(empty)"); 148 148 149 InitCoords (&coords, projection); 149 150 coords.crval1 = RaCenter; 150 151 coords.crval2 = DecCenter; 151 152 coords.crpix1 = 0.5*Nx; 152 153 coords.crpix2 = 0.5*Ny; 153 strcpy (coords.ctype, projection); 154 coords.pc1_1 = -1.0; 154 coords.pc1_1 = -1.0; // sky parity 155 155 coords.pc2_2 = +1.0; 156 coords.pc1_2 = 0.0;157 coords.pc2_1 = 0.0;158 156 coords.cdelt1 = coords.cdelt2 = pixscale; 159 coords.Npolyterms = 0;160 157 161 158 PutCoords (&coords, &buf[0].header); … … 166 163 for (xs = 0; xs < Nx; xs++) { 167 164 status = XY_to_RD (&r, &d, (double)(xs), (double)(ys), &coords); 168 status &= (r >= 0); 169 status &= (r <= 360); 165 r = ohana_normalize_angle (r); 170 166 if (status) { 171 167 V[ys*Nx + xs] = ShowDensity ? 0 : 2; -
trunk/Ohana/src/opihi/dvo/showtile.c
r36489 r37807 28 28 29 29 /* reference for coords is this image */ 30 coords.crpix1 = coords.crpix2 = 0.0; 31 coords.crval1 = coords.crval2 = 0.0; 32 coords.cdelt1 = coords.cdelt2 = 1.0; 33 coords.pc1_1 = coords.pc2_2 = 1.0; 34 coords.pc1_2 = coords.pc2_1 = 0.0; 35 coords.Npolyterms = 0; 36 strcpy (coords.ctype, "DEC--TAN"); 30 InitCoords (&coords, "DEC--TAN"); 37 31 38 32 /* fill in top-left region */ -
trunk/Ohana/src/opihi/dvo/simage.c
r36489 r37807 42 42 } 43 43 /* get astrometry information */ 44 strcpy (coords.ctype, "NONE"); 45 gfits_scan (&header, "CTYPE2", "%s", 1, coords.ctype); 46 if (strcmp (coords.ctype, "DEC--PLY")) { 47 gprint (GP_ERR, "ERROR: wrong astrometric info in header\n"); 44 if (!GetCoords (&coords, &header)) { 45 gprint (GP_ERR, "ERROR: can't get coord info from header\n"); 48 46 return (FALSE); 49 47 } 50 gfits_scan (&header, "CDELT1", "%f", 1, &coords.cdelt1);51 gfits_scan (&header, "CDELT2", "%f", 1, &coords.cdelt2);52 gfits_scan (&header, "CRVAL1", "%lf", 1, &coords.crval1);53 gfits_scan (&header, "CRVAL2", "%lf", 1, &coords.crval2);54 gfits_scan (&header, "CRPIX1", "%f", 1, &coords.crpix1);55 gfits_scan (&header, "CRPIX2", "%f", 1, &coords.crpix2);56 gfits_scan (&header, "PC001001", "%f", 1, &coords.pc1_1);57 gfits_scan (&header, "PC001002", "%f", 1, &coords.pc1_2);58 gfits_scan (&header, "PC002001", "%f", 1, &coords.pc2_1);59 gfits_scan (&header, "PC002002", "%f", 1, &coords.pc2_2);60 /* RA Terms */61 gfits_scan (&header, "PCA1X2Y0", "%f", 1, &coords.polyterms[0][0]);62 gfits_scan (&header, "PCA1X1Y1", "%f", 1, &coords.polyterms[1][0]);63 gfits_scan (&header, "PCA1X0Y2", "%f", 1, &coords.polyterms[2][0]);64 gfits_scan (&header, "PCA1X3Y0", "%f", 1, &coords.polyterms[3][0]);65 gfits_scan (&header, "PCA1X2Y1", "%f", 1, &coords.polyterms[4][0]);66 gfits_scan (&header, "PCA1X1Y2", "%f", 1, &coords.polyterms[5][0]);67 gfits_scan (&header, "PCA1X0Y3", "%f", 1, &coords.polyterms[6][0]);68 /* Dec Terms */69 gfits_scan (&header, "PCA2X2Y0", "%f", 1, &coords.polyterms[0][1]);70 gfits_scan (&header, "PCA2X1Y1", "%f", 1, &coords.polyterms[1][1]);71 gfits_scan (&header, "PCA2X0Y2", "%f", 1, &coords.polyterms[2][1]);72 gfits_scan (&header, "PCA2X3Y0", "%f", 1, &coords.polyterms[3][1]);73 gfits_scan (&header, "PCA2X2Y1", "%f", 1, &coords.polyterms[4][1]);74 gfits_scan (&header, "PCA2X1Y2", "%f", 1, &coords.polyterms[5][1]);75 gfits_scan (&header, "PCA2X0Y3", "%f", 1, &coords.polyterms[6][1]);76 coords.Npolyterms = 2; /* how many do we use? */77 48 78 49 /* find number of stars */ -
trunk/Ohana/src/opihi/dvo/skycoverage.c
r33963 r37807 204 204 strcpy (buf[0].file, "(empty)"); 205 205 206 InitCoords (&coords, projection); 206 207 coords.crval1 = RaCenter; 207 208 coords.crval2 = DecCenter; 208 209 coords.crpix1 = 0.5*Nx; 209 210 coords.crpix2 = 0.5*Ny; 210 strcpy (coords.ctype, projection); 211 coords.pc1_1 = -1.0; 211 coords.pc1_1 = -1.0; // sky parity 212 212 coords.pc2_2 = +1.0; 213 coords.pc1_2 = 0.0;214 coords.pc2_1 = 0.0;215 213 coords.cdelt1 = coords.cdelt2 = pixscale; 216 coords.Npolyterms = 0;217 214 218 215 PutCoords (&coords, &buf[0].header); … … 222 219 return (FALSE); 223 220 } 224 BuildChipMatch (image, Nimage);221 // BuildChipMatch (image, Nimage); 225 222 226 223 V = (float *)buf[0].matrix.buffer; … … 230 227 for (xs = 0; xs < Nx; xs++) { 231 228 status = XY_to_RD (&r, &d, (double)(xs), (double)(ys), &coords); 232 status &= (r >= 0);233 status &= (r <= 360); 229 r = ohana_normalize_angle (r); 230 234 231 // are we in a part of the projection covering the sky or not? 235 232 if (status) { … … 284 281 } 285 282 } 286 287 if (!FindMosaicForImage (image, Nimage, i)) continue;288 283 289 284 typehash = wordhash (&image[i].coords.ctype[4]); -
trunk/Ohana/src/opihi/dvo/subpix.c
r37049 r37807 115 115 /* load all images, extract those touching Ra, Dec */ 116 116 if ((image = LoadImagesDVO (&Nimage)) == NULL) return (FALSE); 117 BuildChipMatch (image, Nimage);117 // BuildChipMatch (image, Nimage); 118 118 119 119 for (i = 0; i < Nimage; i++) { 120 if (!FindMosaicForImage (image, Nimage, i)) continue;121 120 status = RD_to_XY (&X, &Y, Ra, Dec, &image[i].coords); 122 121 if (!status || (X < 0) || (X > image[i].NX) || (Y < 0) || (Y > image[i].NY)) continue; … … 134 133 for (i = 0; i < Nsub; i++) { 135 134 I = index[i]; 136 if (!FindMosaicForImage (image, Nimage, I)) continue;137 135 Timage = image[I].tzero; 138 136 for (j = 0; j < Nmeasure; j++) { -
trunk/Ohana/src/opihi/include/astro.h
r31635 r37807 12 12 void FreeAstro (void); 13 13 14 typedef struct {15 int isIdentity; // identity transformation16 double phi; // saved in radians17 double Xo; // saved in radians18 double xo; // saved in degrees19 double sin_phi_cos_Xo; // pre-computed values20 double sin_phi_sin_Xo; // pre-computed values21 double cos_phi_cos_Xo; // pre-computed values22 double cos_phi_sin_Xo; // pre-computed values23 double cos_phi; // pre-computed values24 double sin_phi; // pre-computed values25 double cos_Xo; // pre-computed values26 double sin_Xo; // pre-computed values27 } CoordTransform;28 29 #ifndef MOVED_TO_LIBDVO30 typedef enum {COORD_NONE, COORD_CELESTIAL, COORD_GALACTIC, COORD_ECLIPTIC} CoordTransformSystem;31 #endif32 33 CoordTransform *InitTransform (CoordTransformSystem input, CoordTransformSystem output);34 int ApplyTransform (double *x, double *y, double X, double Y, CoordTransform *transform);35 36 14 # endif -
trunk/Ohana/src/opihi/include/data.h
r36679 r37807 224 224 void ListMedImages (); 225 225 226 // in tvchannel.c 227 int GetKapaChannelFromString (char *string); 228 226 229 # endif -
trunk/Ohana/src/opihi/include/dvomath.h
r37049 r37807 187 187 int ListBuffersToList PROTO((char *name)); 188 188 int CreateBuffer PROTO((Buffer *buf, int Nx, int Ny, int bitpix, float bzero, float bscale)); 189 int ResetBuffer PROTO((Buffer *buf, int Nx, int Ny, int bitpix, float bzero, float bscale)); 189 190 Buffer *SelectBuffer PROTO((char *name, int mode, int verbose)); 190 191 void dump_buffers PROTO((int n)); /* deprecated? */ -
trunk/Ohana/src/opihi/lib.shell/BufferOps.c
r33662 r37807 88 88 } 89 89 90 int ResetBuffer (Buffer *buf, int Nx, int Ny, int bitpix, float bzero, float bscale) { 91 92 gfits_free_matrix (&buf[0].matrix); 93 gfits_free_header (&buf[0].header); 94 CreateBuffer (buf, Nx, Ny, bitpix, bzero, bscale); 95 return TRUE; 96 } 97 90 98 int CreateBuffer (Buffer *buf, int Nx, int Ny, int bitpix, float bzero, float bscale) { 91 99 -
trunk/Ohana/src/opihi/pantasks/controller_status.c
r23530 r37807 3 3 int controller_status (int argc, char **argv) { 4 4 5 int status;6 char command[1024] ;5 int i, status; 6 char command[1024], tmpline[1024]; 7 7 IOBuffer buffer; 8 8 9 if (argc != 1) { 10 gprint (GP_ERR, "USAGE: controller status\n"); 9 if ((argc > 1) && (!strcasecmp(argv[1], "help"))) { 10 gprint (GP_ERR, "USAGE: controller status [options]\n"); 11 gprint (GP_ERR, " OPTIONS:\n"); 12 gprint (GP_ERR, " -cmd command\n"); 13 gprint (GP_ERR, " -host hostname\n"); 14 gprint (GP_ERR, " -state state\n"); 15 gprint (GP_ERR, " -age seconds\n"); 16 gprint (GP_ERR, " +jobs [-nohost]\n"); 17 gprint (GP_ERR, " +host [-nojobs]\n"); 11 18 return (FALSE); 12 19 } … … 19 26 } 20 27 28 snprintf (command, 1024, "status"); 29 for (i = 1; i < argc; i++) { 30 snprintf (tmpline, 1024, "%s %s", command, argv[i]); 31 strcpy (command, tmpline); 32 } 21 33 22 sprintf (command, "status");23 34 InitIOBuffer (&buffer, 0x100); 24 35 -
trunk/Ohana/src/opihi/pcontrol/Makefile
r34088 r37807 11 11 12 12 # programs may add their own internal requirements here 13 LIBS1 = -l kapa -lFITS -lohana13 LIBS1 = -ldvo -lkapa -lFITS -lohana 14 14 LIBS2 = -lbasiccmd -lshell -ldata 15 15 FULL_CFLAGS = $(BASE_CFLAGS) -
trunk/Ohana/src/opihi/pcontrol/status.c
r36623 r37807 85 85 86 86 usage: 87 gprint (GP_ ERR, "USAGE: status [-cmd command] [-host hostname] [-state state] [-age seconds] [+jobs,-nohost] [+host,-nojobs]\n");87 gprint (GP_LOG, "USAGE: status [-cmd command] [-host hostname] [-state state] [-age seconds] [+jobs,-nohost] [+host,-nojobs]\n"); 88 88 return FALSE; 89 89 }
Note:
See TracChangeset
for help on using the changeset viewer.
