Changeset 37386
- Timestamp:
- Sep 11, 2014, 3:39:54 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src
- Files:
-
- 77 edited
-
addstar/src/LoadDataPMM.c (modified) (2 diffs)
-
addstar/src/ReadStarsSDSS.c (modified) (1 diff)
-
addstar/src/fakeimage.c (modified) (4 diffs)
-
addstar/src/find_matches.c (modified) (2 diffs)
-
addstar/src/find_matches_closest.c (modified) (2 diffs)
-
addstar/src/find_matches_closest_refstars.c (modified) (2 diffs)
-
addstar/src/find_matches_refstars.c (modified) (1 diff)
-
addstar/src/loadsupercos_plates.c (modified) (2 diffs)
-
addstar/src/mkcmf.c (modified) (2 diffs)
-
addstar/src/sky_tessalation.c (modified) (8 diffs)
-
checkastro/src/bcatalog.c (modified) (1 diff)
-
dvomerge/src/merge_catalogs_old.c (modified) (2 diffs)
-
fixcat/src/gcatstats.c (modified) (1 diff)
-
gastro/src/gfitpoly.c (modified) (2 diffs)
-
gastro/src/gstars.c (modified) (1 diff)
-
gastro2/src/gproject2.c (modified) (1 diff)
-
gastro2/src/gstars2.c (modified) (1 diff)
-
getstar/src/MatchImages.c (modified) (1 diff)
-
kapa2/src/Graphs.c (modified) (1 diff)
-
kapa2/src/Image.c (modified) (1 diff)
-
libautocode/Makefile.Targets (modified) (2 diffs)
-
libautocode/def/common.h (modified) (1 diff)
-
libdvo/Makefile (modified) (1 diff)
-
libdvo/include/dvo.h (modified) (4 diffs)
-
libdvo/include/libdvo_astro.h (modified) (2 diffs)
-
libdvo/src/ImageMetadataSelection.c (modified) (1 diff)
-
libdvo/src/ImageSelection.c (modified) (1 diff)
-
libdvo/src/coord_systems.c (modified) (1 diff)
-
libdvo/src/coordops.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_PS1_DEV_1.c (modified) (1 diff)
-
libdvo/src/dvo_convert_PS1_DEV_2.c (modified) (1 diff)
-
libdvo/src/dvo_convert_PS1_DEV_3.c (modified) (1 diff)
-
libdvo/src/dvo_convert_PS1_REF.c (modified) (1 diff)
-
libdvo/src/dvo_convert_PS1_V1.c (modified) (1 diff)
-
libdvo/src/dvo_convert_PS1_V2.c (modified) (1 diff)
-
libdvo/src/dvo_convert_PS1_V3.c (modified) (1 diff)
-
libdvo/src/dvo_convert_PS1_V4.c (modified) (1 diff)
-
libdvo/src/dvo_convert_PS1_V5.c (modified) (1 diff)
-
libdvo/src/dvo_convert_elixir.c (modified) (1 diff)
-
libdvo/src/dvo_convert_loneos.c (modified) (1 diff)
-
libdvo/src/dvo_convert_panstarrs_DEV_0.c (modified) (1 diff)
-
libdvo/src/dvo_convert_panstarrs_DEV_1.c (modified) (1 diff)
-
libkapa/src/KapaWindow.c (modified) (1 diff)
-
libohana/Makefile (modified) (1 diff)
-
libohana/include/ohana.h (modified) (2 diffs)
-
markrock/src/gcatstats.c (modified) (1 diff)
-
markstar/src/gcatstats.c (modified) (1 diff)
-
mosastro/src/chips.c (modified) (1 diff)
-
mosastro/src/fakefield.c (modified) (2 diffs)
-
mosastro/src/field.c (modified) (6 diffs)
-
mosastro/src/fitpoly.c (modified) (2 diffs)
-
mosastro/src/mkobs.c (modified) (2 diffs)
-
mosastro/src/mkstandards.c (modified) (1 diff)
-
opihi/cmd.astro/cdensify.c (modified) (1 diff)
-
opihi/cmd.astro/fitplx.c (modified) (1 diff)
-
opihi/cmd.astro/fitpm.c (modified) (1 diff)
-
opihi/cmd.astro/region.c (modified) (3 diffs)
-
opihi/dvo/find_matches.c (modified) (2 diffs)
-
opihi/dvo/gimages.c (modified) (1 diff)
-
opihi/dvo/objectcoverage.c (modified) (1 diff)
-
opihi/dvo/showtile.c (modified) (1 diff)
-
opihi/dvo/simage.c (modified) (1 diff)
-
opihi/dvo/skycoverage.c (modified) (1 diff)
-
opihi/include/astro.h (modified) (1 diff)
-
photdbc/src/find_images.c (modified) (1 diff)
-
photdbc/src/join_stars.c (modified) (1 diff)
-
photdbc/src/select_images.c (modified) (1 diff)
-
relastro/src/UpdateObjects.c (modified) (1 diff)
-
relastro/src/bcatalog.c (modified) (2 diffs)
-
relastro/src/high_speed_objects.c (modified) (2 diffs)
-
relastro/src/hpm_objects.c (modified) (2 diffs)
-
relastro/src/select_images.c (modified) (2 diffs)
-
relastro/src/testparallax.c (modified) (1 diff)
-
relphot/src/MosaicOps.c (modified) (2 diffs)
-
relphot/src/select_images.c (modified) (2 diffs)
-
uniphot/src/find_image_sgroups.c (modified) (1 diff)
-
uniphot/src/update_dvo_uniphot.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/LoadDataPMM.c
r36485 r37386 193 193 194 194 // XXX for now, we define a totally fake coordinate system centered on the plate center 195 strcpy (image[0].coords.ctype, "DEC--TAN");195 InitCoords (&image[0].coords, "DEC--TAN"); 196 196 197 197 image[0].coords.crval1 = pmm_get_ra (RA); … … 203 203 image[0].coords.crpix2 = 0.5*PLATE_NY; 204 204 image[0].coords.cdelt1 = image[0].coords.cdelt2 = 0.9 / 3600.0; 205 206 image[0].coords.pc1_1 = 0.0;207 image[0].coords.pc1_2 = 1.0;208 image[0].coords.pc2_1 = 1.0;209 image[0].coords.pc2_2 = 0.0;210 211 image[0].coords.Npolyterms = 0;212 memset (image[0].coords.polyterms, 0, 2*7*sizeof(float));213 205 214 206 image[0].NX = PLATE_NX; -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/ReadStarsSDSS.c
r36485 r37386 201 201 202 202 // XXX for now, we define a totally fake coordinate system centered on the first listed star 203 strcpy (images[N].coords.ctype, "DEC--TAN"); 204 203 InitCoords (&images[N].coords, "DEC--TAN"); 205 204 images[N].coords.crval1 = stars[0].average.R; 206 205 images[N].coords.crval2 = stars[0].average.D; 207 208 206 images[N].coords.crpix1 = stars[0].measure.Xccd; 209 207 images[N].coords.crpix2 = stars[0].measure.Yccd; 210 208 images[N].coords.cdelt1 = images[N].coords.cdelt2 = 0.4 / 3600.0; 211 212 images[N].coords.pc1_1 = 0.0;213 images[N].coords.pc1_2 = 1.0;214 images[N].coords.pc2_1 = 1.0;215 images[N].coords.pc2_2 = 0.0;216 217 images[N].coords.Npolyterms = 0;218 memset (images[N].coords.polyterms, 0, 2*7*sizeof(float));219 209 220 210 images[N].NX = 2048; -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/fakeimage.c
r37378 r37386 3 3 Image *fakeimage (char *rootname, off_t *Nimage, int photcode) { 4 4 5 int i, j,Nx, Ny, Nchips;5 int i, Nx, Ny, Nchips; 6 6 double pltscale, pixscale; 7 7 double Rmin, Rmax, Dmin, Dmax; … … 33 33 34 34 /* create a mosaic distortion structure */ 35 strcpy (MOSAIC.ctype, "DEC--DIS");35 InitCoords (&MOSAIC, "DEC--DIS"); 36 36 MOSAIC.crval1 = FAKE_RA; 37 37 MOSAIC.crval2 = FAKE_DEC; 38 39 MOSAIC.crpix1 = MOSAIC.crpix2 = 0.0;40 38 41 39 /* mosaic 'pixels' are millimeters */ … … 49 47 50 48 MOSAIC.Npolyterms = 3; 51 for (i = 0; i < 7; i++) {52 MOSAIC.polyterms[i][0] = 0;53 MOSAIC.polyterms[i][1] = 0;54 }55 49 ScanConfig (config, "DPLATE_X", "%lf", 0, &pltscale); 56 50 MOSAIC.polyterms[3][0] = pltscale; // L : X^3 Y^0 … … 83 77 strcpy (image[i+1].name, name); 84 78 85 strcpy (image[i+1].coords.ctype, "DEC--WRP");79 InitCoords (&image[i+1].coords, "DEC--WRP"); 86 80 87 81 image[i+1].coords.crval1 = dX*pixscale; 88 82 image[i+1].coords.crval2 = dY*pixscale; 89 90 image[i+1].coords.crpix1 = image[i+1].coords.crpix2 = 0.0; 83 91 84 image[i+1].coords.cdelt1 = image[i+1].coords.cdelt2 = pixscale; 92 85 93 image[i+1].coords.pc1_1 = 1.0;94 image[i+1].coords.pc1_2 = 0.0;95 image[i+1].coords.pc2_1 = 0.0;96 image[i+1].coords.pc2_2 = 1.0;97 98 image[i+1].coords.Npolyterms = 0;99 for (j = 0; j < 7; j++) {100 image[i+1].coords.polyterms[j][0] = 0;101 image[i+1].coords.polyterms[j][1] = 0;102 }103 86 image[i+1].coords.mosaic = &MOSAIC; 104 87 -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/find_matches.c
r37036 r37386 53 53 * coordops.update.c). We use the center of the region (catalog) for crval1,2. 54 54 */ 55 InitCoords (&tcoords, "DEC--ARC"); 55 56 tcoords.crval1 = 0.5*(region[0].Rmin + region[0].Rmax); 56 57 if (region[0].Dmax < 90) { … … 59 60 tcoords.crval2 = 90.0; 60 61 } 61 tcoords.crpix1 = 0;62 tcoords.crpix2 = 0;63 62 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 64 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;65 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;66 tcoords.Npolyterms = 1;67 strcpy (tcoords.ctype, "DEC--ARC");68 63 69 64 /* build spatial index (RA sort) referencing input array sequence */ -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/find_matches_closest.c
r37036 r37386 53 53 * far from the projection pole. We use the center of the region (catalog) for crval1,2. 54 54 */ 55 InitCoords (&tcoords, "DEC--ARC"); 55 56 tcoords.crval1 = 0.5*(region[0].Rmin + region[0].Rmax); 56 57 if (region[0].Dmax < 90) { … … 59 60 tcoords.crval2 = 90.0; 60 61 } 61 tcoords.crpix1 = 0;62 tcoords.crpix2 = 0;63 62 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 64 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;65 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;66 tcoords.Npolyterms = 1;67 strcpy (tcoords.ctype, "DEC--ARC");68 63 69 64 /* build spatial index (RA sort) referencing input array sequence */ -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/find_matches_closest_refstars.c
r37036 r37386 47 47 * far from the projection pole. We use the center of the region (catalog) for crval1,2. 48 48 */ 49 InitCoords (&tcoords, "DEC--ARC"); 49 50 tcoords.crval1 = 0.5*(region[0].Rmin + region[0].Rmax); 50 51 if (region[0].Dmax < 90) { … … 53 54 tcoords.crval2 = 90.0; 54 55 } 55 tcoords.crpix1 = 0.0;56 tcoords.crpix2 = 0.0;57 56 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 58 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;59 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;60 tcoords.Npolyterms = 0;61 strcpy (tcoords.ctype, "DEC--ARC");62 57 63 58 /* build spatial index (RA sort) referencing input array sequence */ -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/find_matches_refstars.c
r37036 r37386 51 51 /* project onto rectilinear grid with 1 arcsec pixels, sort by X */ 52 52 /* reference for coords is catalog center */ 53 InitCoords (&tcoords, "DEC--ZEA"); 53 54 tcoords.crval1 = 0.5*(region[0].Rmin + region[0].Rmax); 54 55 tcoords.crval2 = 0.5*(region[0].Dmin + region[0].Dmax); 55 tcoords.crpix1 = tcoords.crpix2 = 0.0;56 56 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 57 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;58 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;59 strcpy (tcoords.ctype, "DEC--ZEA");60 tcoords.Npolyterms = 0;61 57 62 58 for (i = 0; i < Nstars; i++) { -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadsupercos_plates.c
r36485 r37386 118 118 119 119 // for now, we define a fake coordinate system based on the boresite center 120 strcpy (image[Nimage].coords.ctype, "DEC--TAN");120 InitCoords (&image[Nimage].coords, "DEC--TAN"); 121 121 122 122 image[Nimage].coords.crval1 = RAo; … … 126 126 image[Nimage].coords.crpix2 = 0.5*image[Nimage].NY; 127 127 image[Nimage].coords.cdelt1 = image[Nimage].coords.cdelt2 = scale; 128 129 image[Nimage].coords.pc1_1 = 0.0;130 image[Nimage].coords.pc1_2 = 1.0;131 image[Nimage].coords.pc2_1 = 1.0;132 image[Nimage].coords.pc2_2 = 0.0;133 134 image[Nimage].coords.Npolyterms = 0;135 memset (image[Nimage].coords.polyterms, 0, 2*7*sizeof(float));136 128 137 129 Nimage ++; -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/mkcmf.c
r37246 r37386 200 200 201 201 /* bore site center guess */ 202 strcpy (coords.ctype, "DEC--TAN");202 InitCoords (&coords, "DEC--TAN"); 203 203 coords.crval1 = RA; 204 204 coords.crval2 = DEC; … … 208 208 coords.cdelt1 = 0.25/3600.0; 209 209 coords.cdelt2 = 0.25/3600.0; 210 211 coords.pc1_1 = 1;212 coords.pc2_2 = 1;213 coords.pc1_2 = 0;214 coords.pc2_1 = 0;215 coords.Npolyterms = 1;216 210 217 211 // load stars and generate complete output fields -
branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/sky_tessalation.c
r36485 r37386 581 581 582 582 memset (rectangle, 0, sizeof(SkyRectangle)); 583 584 InitCoords (&rectangle[0].coords, "DEC--TAN"); 585 583 586 rectangle[0].coords.crval1 = CENTER_RA; 584 587 rectangle[0].coords.crval2 = CENTER_DEC; … … 609 612 rectangle[0].coords.cdelt2 = SCALE / 3600.0; 610 613 611 strcpy (rectangle[0].coords.ctype, "DEC--TAN");612 613 614 rectangle[0].NX = NX; 614 615 rectangle[0].NY = NY; … … 699 700 for (i = 0; i < nRA; i++) { 700 701 memset (&ring[i], 0, sizeof(SkyRectangle)); 701 memset (&ring[i].coords, 0, sizeof(Coords)); 702 703 InitCoords (&ring[i].coords, "DEC--TAN"); 702 704 ring[i].coords.crval1 = i*dRA; 703 705 ring[i].coords.crval2 = dec; 704 706 705 707 ring[i].coords.pc1_1 = +1.0 * X_PARITY; 706 ring[i].coords.pc1_2 = +0.0;707 ring[i].coords.pc2_1 = -0.0;708 ring[i].coords.pc2_2 = +1.0;709 708 710 709 // range values are in projected degrees … … 718 717 ring[i].coords.cdelt1 = SCALE / 3600.0; 719 718 ring[i].coords.cdelt2 = SCALE / 3600.0; 720 721 strcpy (ring[i].coords.ctype, "DEC--TAN");722 719 723 720 ring[i].NX = NX*(1.0 + PADDING); … … 771 768 772 769 memset (&ring[N], 0, sizeof(SkyRectangle)); 773 memset (&ring[N].coords, 0, sizeof(Coords));770 InitCoords (&ring[N].coords, "DEC--TAN"); 774 771 775 772 ring[N].coords.crval1 = ra / d2r; … … 779 776 780 777 ring[N].coords.pc1_1 = +1.0 * X_PARITY; 781 ring[N].coords.pc1_2 = +0.0;782 ring[N].coords.pc2_1 = -0.0;783 ring[N].coords.pc2_2 = +1.0;784 778 785 779 // range values are in projected degrees … … 793 787 ring[N].coords.cdelt1 = SCALE / 3600.0; 794 788 ring[N].coords.cdelt2 = SCALE / 3600.0; 795 796 strcpy (ring[N].coords.ctype, "DEC--TAN");797 789 798 790 ring[N].NX = NX*(1.0 + PADDING); … … 1099 1091 1100 1092 ALLOCATE (refcoords, Coords, 1); 1101 refcoords[0].crval1 = refcoords[0].crval2 = 0.0; 1102 refcoords[0].crpix1 = refcoords[0].crpix2 = 0.0; 1093 InitCoords (refcoords, "DEC--TAN"); 1103 1094 refcoords[0].cdelt1 = refcoords[0].cdelt2 = scale / 3600; 1104 refcoords[0].pc1_1 = refcoords[0].pc2_2 = 1.0;1105 refcoords[0].pc1_2 = refcoords[0].pc2_1 = 0.0;1106 refcoords[0].Npolyterms = 0;1107 memset (refcoords[0].polyterms, 0, 14*sizeof(float));1108 strcpy (refcoords[0].ctype, "DEC--TAN");1109 1095 return (TRUE); 1110 1096 } -
branches/eam_branches/ipp-20140904/Ohana/src/checkastro/src/bcatalog.c
r36833 r37386 191 191 /* project coordinates to a plane centered on the object with units of arcsec */ 192 192 Coords coords; 193 InitCoords (&coords, "DEC--SIN"); 193 194 coords.crval1 = Rc; 194 195 coords.crval2 = Dc; 195 coords.crpix1 = 0;196 coords.crpix2 = 0;197 196 coords.cdelt1 = coords.cdelt2 = 1.0 / 3600.0; 198 coords.pc1_1 = coords.pc2_2 = 1.0;199 coords.pc1_2 = coords.pc2_1 = 0.0;200 coords.Npolyterms = 1;201 strcpy (coords.ctype, "DEC--SIN");202 197 203 198 // convert all average R,D values to X,Y: -
branches/eam_branches/ipp-20140904/Ohana/src/dvomerge/src/merge_catalogs_old.c
r37116 r37386 64 64 * coordops.update.c). We use the center of the region (catalog) for crval1,2. 65 65 */ 66 67 InitCoords (&tcoords, "DEC--ARC"); 66 68 tcoords.crval1 = 0.5*(region[0].Rmin + region[0].Rmax); 67 69 if (region[0].Dmax < 90) { … … 70 72 tcoords.crval2 = 90.0; 71 73 } 72 tcoords.crpix1 = 0;73 tcoords.crpix2 = 0;74 74 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 75 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;76 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;77 tcoords.Npolyterms = 1;78 strcpy (tcoords.ctype, "DEC--ARC");79 75 80 76 if (VERBOSE) fprintf (stderr, "merging %s into %s\n", input[0].filename, output[0].filename); -
branches/eam_branches/ipp-20140904/Ohana/src/fixcat/src/gcatstats.c
r36481 r37386 46 46 /* project onto rectilinear grid with 1 arcsec pixels, sort by X */ 47 47 /* reference for coords is center of field */ 48 InitCoords (&catstats[0].coords, "DEC--TAN"); 48 49 catstats[0].coords.crval1 = RaCenter; 49 50 catstats[0].coords.crval2 = DecCenter; 50 catstats[0].coords.crpix1 = catstats[0].coords.crpix2 = 0.0;51 51 catstats[0].coords.cdelt1 = catstats[0].coords.cdelt2 = 1.0 / 3600.0; 52 catstats[0].coords.pc1_1 = catstats[0].coords.pc2_2 = 1.0;53 catstats[0].coords.pc1_2 = catstats[0].coords.pc2_1 = 0.0;54 strcpy (catstats[0].coords.ctype, "DEC--TAN");55 52 56 53 X1 = catstats[0].X; -
branches/eam_branches/ipp-20140904/Ohana/src/gastro/src/gfitpoly.c
r27435 r37386 261 261 det = 1.0 / (a1*b2 - a2*b1); 262 262 263 InitCoords (coords, "DEC--PLY"); 264 263 265 coords[0].pc1_1 = p11*a1 + p12*b1*(S2/S1); 264 266 coords[0].pc2_1 = p21*a1 + p22*b1*(S2/S1); … … 273 275 274 276 coords[0].Npolyterms = NORDER; 275 strcpy (coords[0].ctype, "DEC--PLY");276 277 277 278 /* generate higher order terms from vector */ -
branches/eam_branches/ipp-20140904/Ohana/src/gastro/src/gstars.c
r36481 r37386 79 79 if (!strcasecmp (ROUGH_ASTROMETRY, "config")) { 80 80 /* default values for coords */ 81 strcpy (coords[0].ctype, "DEC--TAN");81 InitCoords (coords, "DEC--TAN"); 82 82 coords[0].pc1_1 = CCD_PC1_1; coords[0].pc1_2 = CCD_PC1_2; 83 83 coords[0].pc2_1 = CCD_PC2_1; coords[0].pc2_2 = CCD_PC2_2; 84 84 coords[0].cdelt1 = coords[0].cdelt2 = ASEC_PIX / 3600.0; 85 coords[0].Npolyterms = 0;86 85 coords[0].crpix1 = 0.5*(*NX); 87 86 coords[0].crpix2 = 0.5*(*NY); -
branches/eam_branches/ipp-20140904/Ohana/src/gastro2/src/gproject2.c
r12332 r37386 19 19 20 20 /* create Tangent Plane to Sky transformation from input coords */ 21 strcpy (TPtoSky.ctype, coords[0].ctype);21 InitCoords (&TPtoSky, coords[0].ctype); 22 22 TPtoSky.crval1 = coords[0].crval1; 23 23 TPtoSky.crval2 = coords[0].crval2; 24 24 25 TPtoSky.cdelt1 = TPtoSky.cdelt2 = 1;26 TPtoSky.crpix1 = TPtoSky.crpix2 = 0;27 TPtoSky.pc1_1 = TPtoSky.pc2_2 = 1;28 TPtoSky.pc1_2 = TPtoSky.pc2_1 = 0;29 TPtoSky.Npolyterms = 0;30 for (i = 0; i < 7; i++) {31 TPtoSky.polyterms[i][0] = 0;32 TPtoSky.polyterms[i][1] = 0;33 }34 35 25 /* create Focal Plane to Tangent Plane transformation from input coords */ 36 strcpy (FPtoTP.ctype, "FP---PLY"); 37 FPtoTP.crval1 = FPtoTP.crval2 = 0; 38 26 InitCoords (&FPtoTP, "FP---PLY"); 39 27 FPtoTP.cdelt1 = coords[0].cdelt1; 40 28 FPtoTP.cdelt2 = coords[0].cdelt2; -
branches/eam_branches/ipp-20140904/Ohana/src/gastro2/src/gstars2.c
r37054 r37386 28 28 29 29 /* default values for coords */ 30 strcpy (Target[0].coords.ctype, "DEC--TAN");30 InitCoords (&Target[0].coords, "DEC--TAN"); 31 31 Target[0].coords.pc1_1 = CCD_PC1_1; Target[0].coords.pc1_2 = CCD_PC1_2; 32 32 Target[0].coords.pc2_1 = CCD_PC2_1; Target[0].coords.pc2_2 = CCD_PC2_2; 33 33 Target[0].coords.cdelt1 = Target[0].coords.cdelt2 = ASEC_PIX / 3600.0; 34 Target[0].coords.Npolyterms = 0;35 34 Target[0].coords.crpix1 = 0.5*NX; 36 35 Target[0].coords.crpix2 = 0.5*NY; -
branches/eam_branches/ipp-20140904/Ohana/src/getstar/src/MatchImages.c
r37378 r37386 23 23 /* we keep the original crpix1,2 and crref1,2 */ 24 24 /* for mosaic astrometry, the grid should be w.r.t. the tangent-plane, not chip coords */ 25 InitCoords (&tcoords, "DEC--TAN"); 25 26 if (!strcmp (&image[0].coords.ctype[4], "-WRP")) { 26 27 myAssert (image[0].coords.mosaic, "should already have tested this"); 27 28 tcoords = image[0].coords.mosaic[0]; 28 29 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 29 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;30 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;31 tcoords.Npolyterms = 1;32 strcpy (tcoords.ctype, "DEC--TAN");33 30 /* register so image->sky conversions below have correct mosaic */ 34 31 } else { 35 32 tcoords = image[0].coords; 36 33 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 37 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;38 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;39 tcoords.Npolyterms = 1;40 strcpy (tcoords.ctype, "DEC--TAN");41 34 } 42 35 -
branches/eam_branches/ipp-20140904/Ohana/src/kapa2/src/Graphs.c
r36487 r37386 57 57 graph[0].data.flipnorth = FALSE; // +North = +Y by default 58 58 59 graph[0].data.coords.pc1_1 = graph[0].data.coords.pc2_2 = 1.0; 60 graph[0].data.coords.pc1_2 = graph[0].data.coords.pc2_1 = 0.0; 61 graph[0].data.coords.crval1 = 0.0; 62 graph[0].data.coords.crval2 = 0.0; 63 graph[0].data.coords.crpix1 = 0.0; 64 graph[0].data.coords.crpix2 = 0.0; 65 graph[0].data.coords.cdelt1 = graph[0].data.coords.cdelt2 = 1.0; 66 strcpy (graph[0].data.coords.ctype, "DEC--LIN"); 59 InitCoords (&graph[0].data.coords, "DEC--LIN"); 67 60 strcpy (graph[0].data.axis, "2222"); 68 61 strcpy (graph[0].data.ticks, "2222"); -
branches/eam_branches/ipp-20140904/Ohana/src/kapa2/src/Image.c
r36487 r37386 11 11 channel->slope = 1; 12 12 13 channel->coords.pc1_1 = channel->coords.pc2_2 = 1.0; 14 channel->coords.pc1_2 = channel->coords.pc2_1 = 0.0; 15 channel->coords.crval1 = 0.0; 16 channel->coords.crval2 = 0.0; 17 channel->coords.crpix1 = 0.0; 18 channel->coords.crpix2 = 0.0; 19 channel->coords.cdelt1 = channel->coords.cdelt2 = 1.0; 20 strcpy (channel->coords.ctype, "DEC--LIN"); 21 channel->coords.Npolyterms = 0; 13 InitCoords (&channel->coords, "DEC--LIN"); 22 14 23 15 channel->matrix.datasize = 0; /* a flag to show there is no data in the matrix */ -
branches/eam_branches/ipp-20140904/Ohana/src/libautocode/Makefile.Targets
r37376 r37386 1 1 AOBJS = \ 2 2 $(ASRC)/coords-disk.$(ARCH).o \ 3 $(ASRC)/AstromOffsetMap_Disk.$(ARCH).o \ 3 4 $(ASRC)/average.$(ARCH).o \ 4 5 $(ASRC)/average-loneos.$(ARCH).o \ … … 98 99 AINCS = \ 99 100 $(AINC)/coords-disk.h \ 101 $(AINC)/AstromOffsetMap_Disk.h \ 100 102 $(AINC)/average.h \ 101 103 $(AINC)/average-loneos.h \ -
branches/eam_branches/ipp-20140904/Ohana/src/libautocode/def/common.h
r37376 r37386 34 34 # define DVO_IMAGE_NAME_LEN 117 35 35 36 typedef struct {37 int Nx;38 int Ny;39 float *value;40 float dX;41 float dY;42 float Xo;43 float Yo;44 } ImageMap;45 46 /* Internal version of Coords (see CoordsDisk in libautocode/def/coords-disk.d) */47 typedef struct Coords {48 double crval1; // coordinate at reference pixel49 double crval2; // coordinate at reference pixel50 float crpix1; // coordinate of reference pixel51 float crpix2; // coordinate of reference pixel52 float cdelt1; // degrees per pixel53 float cdelt2; // degrees per pixel54 float pc1_1; // rotation matrix55 float pc1_2; // rotation matrix56 float pc2_1; // rotation matrix57 float pc2_2; // rotation matrix58 float polyterms[7][2]; // higher order warping terms59 char ctype[15]; // coordinate type60 char Npolyterms; // order of polynomial61 struct Coords *mosaic; // pointer to parent mosaic62 ImageMap *imageMap; // pointer to image map transformation63 } Coords;64 65 typedef struct Image {66 Coords coords; // astrometric data67 e_time tzero; // readout time (row 0)68 unsigned int nstar; // number of stars on image69 float secz; // airmass (mag)70 unsigned short NX; // image width71 unsigned short NY; // image height72 float apmifit; // aperture correction (mag)73 float dapmifit; // apmifit error (mag)74 float Mcal; // calibration mag (mag)75 float dMcal; // error on Mcal (mag)76 short Xm; // image chisq (10*log(value))77 short photcode; // identifier for CCD,78 float exptime; // exposure time (seconds)79 float sidtime; // sidereal time of exposure80 float latitude; // observatory latitude (degrees)81 float RAo; // image center (degrees)82 float DECo; // image center (degrees)83 float Radius; // image radius (degrees)84 float refColorBlue; // median astrometry ref color85 float refColorRed; // median astrometry ref color86 char name[117]; // name of original image87 unsigned char detection_limit; // detection limit (10*mag)88 unsigned char saturation_limit; // saturation limit (10*mag)89 unsigned char cerror; // astrometric error (50*arcsec)90 unsigned char fwhm_x; // PSF x width (25*arcsec)91 unsigned char fwhm_y; // PSF y width (25*arcsec)92 unsigned char trate; // scan rate (100 usec/pixel)93 unsigned char ccdnum; // CCD ID number94 unsigned int flags; // image quality flags95 unsigned int imageID; // internal image ID96 unsigned int parentID; // associated ref image97 unsigned int externID; // external image ID98 unsigned short sourceID; // analysis source ID99 short nLinkAstrom; // mean number of matched measurements for astrometry100 short nLinkPhotom; // mean number of matched measurements for astrometry101 short ubercalDist; // distance to nearest ubercal image102 float dXpixSys; // systematic astrometry error in X103 float dYpixSys; // systematic astrometry error in Y104 float dMagSys; // systematic photometry error105 unsigned short nFitAstrom; // number of stars used for astrometry cal106 unsigned short nFitPhotom; // number of stars used for photometry cal107 unsigned int photom_map_id; // reference to 2D zero point map108 unsigned int astrom_map_id; // reference to 2D astrometry map109 struct Image *parent; // pointer to parent mosaic (not save to disk)110 } Image;111 112 36 /*** rawshort is used to handle the broken pre-autocode photreg tables 113 37 fix the tables and remove this -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/Makefile
r37035 r37386 86 86 $(SRC)/skyregion_gsc.$(ARCH).o \ 87 87 $(SRC)/skyregion_ops.$(ARCH).o \ 88 $(SRC)/AstromOffsetMapIO.$(ARCH).o \ 89 $(SRC)/AstromOffsetMapOps.$(ARCH).o \ 88 90 $(SRC)/dvo_set_skyregion.$(ARCH).o \ 89 91 $(SRC)/dvo_set_catdir.$(ARCH).o \ -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/include/dvo.h
r37377 r37386 36 36 37 37 typedef enum {DVO_CAT_OPEN_FAIL, DVO_CAT_OPEN_OK, DVO_CAT_OPEN_EMPTY} DVOCatalogOpenModes; 38 39 typedef enum {40 PROJ_NONE, // undefined41 PROJ_ZEA, // zenithal42 PROJ_ZPL, // zenithal43 PROJ_ARC, // zenithal44 PROJ_STG, // zenithal45 PROJ_SIN, // zenithal46 PROJ_TAN, // zenithal47 PROJ_TNX, // zenithal48 PROJ_DIS, // zenithal (TAN + polyterms)49 PROJ_LIN, // cartesian50 PROJ_PLY, // cartesian51 PROJ_WRP, // cartesian52 PROJ_AIT, // pseudocyl53 PROJ_GLS, // pseudocyl54 PROJ_PAR, // pseudocyl55 } OhanaProjection;56 57 typedef enum {58 PROJ_MODE_NONE,59 PROJ_MODE_CARTESIAN,60 PROJ_MODE_ZENITHAL,61 PROJ_MODE_PSEUDOCYL,62 } OhanaProjectionMode;63 38 64 39 // these are used as NAN for types of int values … … 202 177 } DVOSecfiltFlags; 203 178 179 /* definitions for parallel dvo host information 180 XXX : need better names (safer namespace) 181 */ 182 183 typedef enum { 184 DATA_ON_TGT = 0x01, 185 DATA_ON_BCK = 0x02, 186 DATA_USE_BCK = 0x04, 187 188 DATA_COPY_FAILURE = 0x80, 189 } SkyTableDataFlags; 190 191 typedef enum { 192 HOST_STDIN = 0, 193 HOST_STDOUT = 1, 194 HOST_STDERR = 2, 195 } HostInfoIOfd; 196 204 197 /*** general dvo structures (internal use only / not IO) ***/ 205 198 … … 252 245 e_time *tstop; 253 246 } FlatCorrectionTable; 254 255 /* definitions for parallel dvo host information256 XXX : need better names (safer namespace)257 */258 259 typedef enum {260 DATA_ON_TGT = 0x01,261 DATA_ON_BCK = 0x02,262 DATA_USE_BCK = 0x04,263 264 DATA_COPY_FAILURE = 0x80,265 } SkyTableDataFlags;266 267 typedef enum {268 HOST_STDIN = 0,269 HOST_STDOUT = 1,270 HOST_STDERR = 2,271 } HostInfoIOfd;272 247 273 248 typedef struct { … … 738 713 int gfits_db_free PROTO((FITS_DB *db)); 739 714 740 /* in coords.c, using libautocode/def/coords.d */741 int XY_to_LM (double *L, double *M, double x, double y, Coords *coords);742 int LM_to_XY (double *x, double *y, double L, double M, Coords *coords);743 int RD_to_LM (double *L, double *M, double ra, double dec, Coords *coords);744 int LM_to_RD (double *ra, double *dec, double L, double M, Coords *coords);745 int XY_to_RD (double *ra, double *dec, double x, double y, Coords *coords);746 int RD_to_XY (double *x, double *y, double ra, double dec, Coords *coords);747 int fXY_to_RD (float *ra, float *dec, double x, double y, Coords *coords);748 int fRD_to_XY (float *x, float *y, double ra, double dec, Coords *coords);749 int GetCoords (Coords *coords, Header *header);750 int PutCoords (Coords *coords, Header *header);751 void RegisterMosaic (Coords *coords);752 void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch);753 OhanaProjection GetProjection (char *ctype);754 int SetProjection (char *ctype, OhanaProjection proj);755 OhanaProjectionMode GetProjectionMode (OhanaProjection proj);756 757 715 char *libdvo_version (void); 758 716 -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/include/libdvo_astro.h
r31635 r37386 1 #ifdef notdef 2 # include "external.h" 3 # include "shell.h" 4 # include "dvomath.h" 5 # include "convert.h" 6 # include "display.h" 7 # include "data.h" 8 #endif 1 # ifndef LIBDVO_ASTRO_H 2 # define LIBDVO_ASTRO_H 9 3 10 # ifndef ASTRO_H 11 # define ASTRO_H 4 typedef enum { 5 COORD_NONE, 6 COORD_CELESTIAL, 7 COORD_GALACTIC, 8 COORD_ECLIPTIC 9 } CoordTransformSystem; 12 10 13 void InitAstro (void); 14 void FreeAstro (void); 11 typedef enum { 12 PROJ_NONE, // undefined 13 PROJ_ZEA, // zenithal 14 PROJ_ZPL, // zenithal 15 PROJ_ARC, // zenithal 16 PROJ_STG, // zenithal 17 PROJ_SIN, // zenithal 18 PROJ_TAN, // zenithal 19 PROJ_TNX, // zenithal 20 PROJ_DIS, // zenithal (TAN + polyterms) 21 PROJ_LIN, // cartesian 22 PROJ_PLY, // cartesian (allow polyterms) 23 PROJ_WRP, // cartesian (allow polyterms, require mosaic) 24 PROJ_AIT, // pseudocyl 25 PROJ_GLS, // pseudocyl 26 PROJ_PAR, // pseudocyl 27 } OhanaProjection; 28 29 typedef enum { 30 PROJ_MODE_NONE, 31 PROJ_MODE_CARTESIAN, 32 PROJ_MODE_ZENITHAL, 33 PROJ_MODE_PSEUDOCYL, 34 } OhanaProjectionMode; 15 35 16 36 typedef struct { … … 29 49 } CoordTransform; 30 50 31 typedef enum {COORD_NONE, COORD_CELESTIAL, COORD_GALACTIC, COORD_ECLIPTIC} CoordTransformSystem; 51 typedef struct { 52 int Nx; 53 int Ny; 54 float dX; 55 float dY; 56 float **dXv; 57 float **dYv; 58 unsigned int ID; 59 unsigned int imageID; 60 } AstromOffsetMap; 61 62 typedef struct { 63 int Nmap; 64 AstromOffsetMap *map; 65 int *IDtoSeq; 66 int MaxID; 67 } AstromOffsetTable; 68 69 /* Internal version of Coords (see CoordsDisk in libautocode/def/coords-disk.d) */ 70 typedef struct Coords { 71 double crval1; // coordinate at reference pixel 72 double crval2; // coordinate at reference pixel 73 float crpix1; // coordinate of reference pixel 74 float crpix2; // coordinate of reference pixel 75 float cdelt1; // degrees per pixel 76 float cdelt2; // degrees per pixel 77 float pc1_1; // rotation matrix 78 float pc1_2; // rotation matrix 79 float pc2_1; // rotation matrix 80 float pc2_2; // rotation matrix 81 float polyterms[7][2]; // higher order warping terms 82 char ctype[15]; // coordinate type 83 char Npolyterms; // order of polynomial 84 struct Coords *mosaic; // pointer to parent mosaic 85 AstromOffsetMap *offsetMap; // pointer to offset map transformation 86 } Coords; 87 88 typedef struct Image { 89 Coords coords; // astrometric data 90 e_time tzero; // readout time (row 0) 91 unsigned int nstar; // number of stars on image 92 float secz; // airmass (mag) 93 unsigned short NX; // image width 94 unsigned short NY; // image height 95 float apmifit; // aperture correction (mag) 96 float dapmifit; // apmifit error (mag) 97 float Mcal; // calibration mag (mag) 98 float dMcal; // error on Mcal (mag) 99 short Xm; // image chisq (10*log(value)) 100 short photcode; // identifier for CCD, 101 float exptime; // exposure time (seconds) 102 float sidtime; // sidereal time of exposure 103 float latitude; // observatory latitude (degrees) 104 float RAo; // image center (degrees) 105 float DECo; // image center (degrees) 106 float Radius; // image radius (degrees) 107 float refColorBlue; // median astrometry ref color 108 float refColorRed; // median astrometry ref color 109 char name[117]; // name of original image 110 unsigned char detection_limit; // detection limit (10*mag) 111 unsigned char saturation_limit; // saturation limit (10*mag) 112 unsigned char cerror; // astrometric error (50*arcsec) 113 unsigned char fwhm_x; // PSF x width (25*arcsec) 114 unsigned char fwhm_y; // PSF y width (25*arcsec) 115 unsigned char trate; // scan rate (100 usec/pixel) 116 unsigned char ccdnum; // CCD ID number 117 unsigned int flags; // image quality flags 118 unsigned int imageID; // internal image ID 119 unsigned int parentID; // associated ref image 120 unsigned int externID; // external image ID 121 unsigned short sourceID; // analysis source ID 122 short nLinkAstrom; // mean number of matched measurements for astrometry 123 short nLinkPhotom; // mean number of matched measurements for astrometry 124 short ubercalDist; // distance to nearest ubercal image 125 float dXpixSys; // systematic astrometry error in X 126 float dYpixSys; // systematic astrometry error in Y 127 float dMagSys; // systematic photometry error 128 unsigned short nFitAstrom; // number of stars used for astrometry cal 129 unsigned short nFitPhotom; // number of stars used for photometry cal 130 unsigned int photom_map_id; // reference to 2D zero point map 131 unsigned int astrom_map_id; // reference to 2D astrometry map 132 struct Image *parent; // pointer to parent mosaic (not save to disk) 133 } Image; 32 134 33 135 CoordTransform *InitTransform (CoordTransformSystem input, CoordTransformSystem output); 34 136 int ApplyTransform (double *x, double *y, double X, double Y, CoordTransform *transform); 35 137 138 /* in coords.c */ 139 void InitCoords (Coords *coords, char *projection); 140 int XY_to_LM (double *L, double *M, double x, double y, Coords *coords); 141 int LM_to_XY (double *x, double *y, double L, double M, Coords *coords); 142 int RD_to_LM (double *L, double *M, double ra, double dec, Coords *coords); 143 int LM_to_RD (double *ra, double *dec, double L, double M, Coords *coords); 144 int XY_to_RD (double *ra, double *dec, double x, double y, Coords *coords); 145 int RD_to_XY (double *x, double *y, double ra, double dec, Coords *coords); 146 int fXY_to_RD (float *ra, float *dec, double x, double y, Coords *coords); 147 int fRD_to_XY (float *x, float *y, double ra, double dec, Coords *coords); 148 int GetCoords (Coords *coords, Header *header); 149 int PutCoords (Coords *coords, Header *header); 150 void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch); 151 OhanaProjection GetProjection (char *ctype); 152 int SetProjection (char *ctype, OhanaProjection proj); 153 OhanaProjectionMode GetProjectionMode (OhanaProjection proj); 154 155 /* in AstromOffsetMapIO.c */ 156 AstromOffsetTable *AstromOffsetMapLoad (char *filename, int VERBOSE); 157 int AstromOffsetMapSave (AstromOffsetTable *table, char *filename); 158 AstromOffsetTable *AstromOffsetMapToTable(AstromOffsetMap_Disk_6x6 *map_disk, off_t Nmap); 159 AstromOffsetMap_Disk_6x6 *AstromOffsetTableToMap(AstromOffsetTable *table, off_t *Nmap); 160 161 /* in AstromOffsetMapOps.c */ 162 float AstromOffsetMapValue (AstromOffsetMap *map, float x, float y, int xdir); 163 int AstromOffsetMapFit (AstromOffsetMap *map, float *x, float *y, float *f, int Npts, int xdir); 164 36 165 # endif -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/ImageMetadataSelection.c
r36490 r37386 13 13 14 14 /* field defines a frame with 0,0 at the field center, and 1 arcsec / pixel */ 15 field.crpix1 = field.crpix2 = 0.0;15 InitCoords (&field, "DEC--SIN"); 16 16 field.cdelt1 = field.cdelt2 = 1.0 / 3600; 17 field.pc1_1 = field.pc2_2 = 1.0;18 field.pc1_2 = field.pc2_1 = 0.0;19 field.Npolyterms = 0;20 strcpy (field.ctype, "DEC--SIN");21 17 22 18 /* mosaic defines a frame with 0,0 at the mosaic center, and 1 arcsec / pixel */ 23 mosaic.crpix1 = mosaic.crpix2 = 0.0;19 InitCoords (&mosaic, "DEC--SIN"); 24 20 mosaic.cdelt1 = mosaic.cdelt2 = 1.0 / 3600; 25 mosaic.pc1_1 = mosaic.pc2_2 = 1.0;26 mosaic.pc1_2 = mosaic.pc2_1 = 0.0;27 mosaic.Npolyterms = 0;28 strcpy (mosaic.ctype, "DEC--SIN");29 21 30 22 if ((image = ImageMetadataLoad (filename, &Nimage)) == NULL) return (FALSE); -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/ImageSelection.c
r37377 r37386 22 22 23 23 if (mosaicMode) { 24 /* mosaic defines a frame with 0,0 at the mosaic center, and 1 arcsec / pixel */ 25 mosaic.crpix1 = mosaic.crpix2 = 0.0; 26 mosaic.cdelt1 = mosaic.cdelt2 = 1.0 / 3600; 27 mosaic.pc1_1 = mosaic.pc2_2 = 1.0; 28 mosaic.pc1_2 = mosaic.pc2_1 = 0.0; 29 mosaic.Npolyterms = 0; 30 strcpy (mosaic.ctype, "DEC--SIN"); 24 /* mosaic defines a frame with 0,0 at the mosaic center, and 1 arcsec / pixel */ 25 InitCoords (&mosaic, "DEC--SIN"); 26 mosaic.cdelt1 = mosaic.cdelt2 = 1.0 / 3600; 31 27 } 32 28 -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/coord_systems.c
r31635 r37386 1 1 # include "dvo.h" 2 # include "libdvo_astro.h"3 2 4 3 CoordTransform *InitTransform (CoordTransformSystem input, CoordTransformSystem output) { -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/coordops.c
r37377 r37386 3 3 /* note that Coords.ctype carries the DEC (ctype2) value */ 4 4 5 // this was previously coded not-thread-safe: I've added the mosaic link directly to the Coords structure 6 # if (0) 7 static Coords mosaic; 8 static int gotMosaic = FALSE; 9 10 void RegisterMosaic (Coords *coords) { 11 mosaic = *coords; 12 gotMosaic = TRUE; 13 } 14 15 int isRegisteredMosaic () { 16 return (gotMosaic); 17 } 18 19 int GetMosaicCoords (Coords *coords) { 20 *coords = mosaic; 21 return (TRUE); 22 } 23 # endif 5 // default coordinates have unit scale and no rotation 6 void InitCoords (Coords *coords, char *projection) { 7 coords->crval1 = 0.0; 8 coords->crval2 = 0.0; 9 coords->crpix1 = 0.0; 10 coords->crpix2 = 0.0; 11 12 coords->cdelt1 = 1.0; 13 coords->cdelt2 = 1.0; 14 15 coords->pc1_1 = 1.0; // EW is flipped relative to sky parity (dRA/dX > 0) 16 coords->pc2_2 = 1.0; 17 coords->pc2_1 = 0.0; 18 coords->pc1_2 = 0.0; 19 20 coords->Npolyterms = 1; 21 coords->mosaic = NULL; 22 coords->offsetMap = NULL; 23 24 memset (coords->polyterms, 0, 7*2*sizeof(float)); 25 26 if (projection) { 27 strcpy (coords->ctype, projection); 28 } else { 29 strcpy (coords->ctype, "NONE"); 30 } 31 } 24 32 25 33 int XY_to_LM (double *L, double *M, double x, double y, Coords *coords) { … … 31 39 proj = GetProjection (coords[0].ctype); 32 40 mode = GetProjectionMode (proj); 41 42 // if we have an image map, it should be applied to the pixel coordinates 43 // before anything else is done. It is easier to invert the map if it is 44 // of the form (dX,dY) = f(X,Y), then if (dL,dM) = f(X,Y). 45 if (coords[0].Npolyterms == -1) { 46 myAssert (coords[0].offsetMap, "offsetMap is requested by not defined"); 47 float dX = AstromOffsetMapValue (coords->offsetMap, x, y, TRUE); 48 float dY = AstromOffsetMapValue (coords->offsetMap, x, y, FALSE); 49 x += dX; 50 y += dY; 51 } 33 52 34 53 /** convert pixel coordinates to cartesian system **/ … … 390 409 *y = Yo / coords[0].cdelt2 + coords[0].crpix2; 391 410 411 // if we have an image map, it should be applied to the pixel coordinates 412 // after anything else is done. It is easier to invert the map if it is 413 // of the form (dX,dY) = f(X,Y), then if (dL,dM) = f(X,Y). 414 if (coords[0].Npolyterms == -1) { 415 myAssert (coords[0].offsetMap, "offsetMap is requested by not defined"); 416 417 double xraw = *x; 418 double yraw = *y; 419 420 double dXo = 0.0; 421 double dYo = 0.0; 422 423 int i; 424 for (i = 0; i < 4; i++) { 425 double dX = AstromOffsetMapValue (coords->offsetMap, xraw, yraw, TRUE); 426 double dY = AstromOffsetMapValue (coords->offsetMap, xraw, yraw, FALSE); 427 428 dX -= dXo; 429 dY -= dYo; 430 431 xraw -= dX; 432 yraw -= dY; 433 434 dXo += dX; 435 dYo += dY; 436 } 437 438 *x = xraw; 439 *y = yraw; 440 441 // I need to iterate since the position at which I have first made the correction is 442 // not the true position. but if dX,dY is small and the gradient of dX,dY is also 443 // small, then even a single pass gets us close. 444 445 // XXX test this and use a while (hypot(dX,dY) > XXX) condition 446 } 392 447 return (TRUE); 393 448 } … … 458 513 459 514 rotate = 0.0; 460 coords[0].crval1 = coords[0].crpix1 = coords[0].cdelt1 = 0.0; 461 coords[0].crval2 = coords[0].crpix2 = coords[0].cdelt2 = 0.0; 462 coords[0].pc1_1 = coords[0].pc2_2 = 1.0; 463 coords[0].pc2_1 = coords[0].pc1_2 = 0.0; 464 coords[0].Npolyterms = 1; 465 strcpy (coords[0].ctype, "NONE"); 515 516 InitCoords (coords, NULL); 466 517 467 518 mode = COORD_TYPE_NONE; -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c
r37377 r37386 222 222 memcpy (&out[i].coords, &in[i].coords, sizeof(CoordsDisk)); 223 223 out[i].coords.mosaic = NULL; 224 out[i].coords. imageMap = NULL;224 out[i].coords.offsetMap = NULL; 225 225 226 226 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c
r37377 r37386 217 217 memcpy (&out[i].coords, &in[i].coords, sizeof(CoordsDisk)); 218 218 out[i].coords.mosaic = NULL; 219 out[i].coords. imageMap = NULL;219 out[i].coords.offsetMap = NULL; 220 220 221 221 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_3.c
r37377 r37386 21 21 memcpy (&out[i].coords, &in[i].coords, sizeof(CoordsDisk)); 22 22 out[i].coords.mosaic = NULL; 23 out[i].coords. imageMap = NULL;23 out[i].coords.offsetMap = NULL; 24 24 25 25 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_convert_PS1_REF.c
r37377 r37386 148 148 memcpy (&out[i].coords, &in[i].coords, sizeof(CoordsDisk)); 149 149 out[i].coords.mosaic = NULL; 150 out[i].coords. imageMap = NULL;150 out[i].coords.offsetMap = NULL; 151 151 152 152 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_convert_PS1_V1.c
r37377 r37386 241 241 memcpy (&out[i].coords, &in[i].coords, sizeof(CoordsDisk)); 242 242 out[i].coords.mosaic = NULL; 243 out[i].coords. imageMap = NULL;243 out[i].coords.offsetMap = NULL; 244 244 245 245 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_convert_PS1_V2.c
r37377 r37386 252 252 memcpy (&out[i].coords, &in[i].coords, sizeof(CoordsDisk)); 253 253 out[i].coords.mosaic = NULL; 254 out[i].coords. imageMap = NULL;254 out[i].coords.offsetMap = NULL; 255 255 256 256 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_convert_PS1_V3.c
r37377 r37386 262 262 memcpy (&out[i].coords, &in[i].coords, sizeof(CoordsDisk)); 263 263 out[i].coords.mosaic = NULL; 264 out[i].coords. imageMap = NULL;264 out[i].coords.offsetMap = NULL; 265 265 266 266 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c
r37377 r37386 301 301 // this is only save because the initial 120 bytes in Coords match CoordsDisk 302 302 memcpy (&out[i].coords, &in[i].coords, sizeof(CoordsDisk)); 303 out[i].coords.mosaic = NULL;304 out[i].coords. imageMap = NULL;303 out[i].coords.mosaic = NULL; 304 out[i].coords.offsetMap = NULL; 305 305 306 306 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c
r37377 r37386 679 679 memcpy (&out[i].coords, &in[i].coords, sizeof(CoordsDisk)); 680 680 out[i].coords.mosaic = NULL; 681 out[i].coords. imageMap = NULL;681 out[i].coords.offsetMap = NULL; 682 682 683 683 // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_convert_elixir.c
r37377 r37386 213 213 memcpy (&out[i].coords, &in[i].coords, sizeof(CoordsDisk)); 214 214 out[i].coords.mosaic = NULL; 215 out[i].coords. imageMap = NULL;215 out[i].coords.offsetMap = NULL; 216 216 217 217 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_convert_loneos.c
r37377 r37386 191 191 memcpy (&out[i].coords, &in[i].coords, sizeof(CoordsDisk)); 192 192 out[i].coords.mosaic = NULL; 193 out[i].coords. imageMap = NULL;193 out[i].coords.offsetMap = NULL; 194 194 195 195 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c
r37377 r37386 230 230 memcpy (&out[i].coords, &in[i].coords, sizeof(CoordsDisk)); 231 231 out[i].coords.mosaic = NULL; 232 out[i].coords. imageMap = NULL;232 out[i].coords.offsetMap = NULL; 233 233 234 234 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c
r37377 r37386 230 230 memcpy (&out[i].coords, &in[i].coords, sizeof(CoordsDisk)); 231 231 out[i].coords.mosaic = NULL; 232 out[i].coords. imageMap = NULL;232 out[i].coords.offsetMap = NULL; 233 233 234 234 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN -
branches/eam_branches/ipp-20140904/Ohana/src/libkapa/src/KapaWindow.c
r36488 r37386 98 98 graphdata[0].lweight = graphdata[0].size = 1.0; 99 99 100 graphdata[0].coords.pc1_1 = graphdata[0].coords.pc2_2 = 1.0; 101 graphdata[0].coords.pc1_2 = graphdata[0].coords.pc2_1 = 0.0; 102 strcpy (graphdata[0].coords.ctype, "DEC--LIN"); 103 graphdata[0].coords.crval1 = 0.0; 104 graphdata[0].coords.crval2 = 0.0; 105 graphdata[0].coords.crpix1 = 0.0; 106 graphdata[0].coords.crpix2 = 0.0; 107 graphdata[0].coords.cdelt1 = graphdata[0].coords.cdelt2 = 1.0; 108 graphdata[0].flipeast = TRUE; 100 InitCoords (&graphdata[0].coords, "DEC--LIN"); 101 graphdata[0].flipeast = TRUE; // default coords has EW flipped relative to sky 109 102 graphdata[0].flipnorth = FALSE; 110 103 -
branches/eam_branches/ipp-20140904/Ohana/src/libohana/Makefile
r33646 r37386 35 35 $(SRC)/time.$(ARCH).o \ 36 36 $(SRC)/gaussj.$(ARCH).o \ 37 $(SRC)/vstats.$(ARCH).o \ 37 38 $(SRC)/config.$(ARCH).o \ 38 39 $(SRC)/Fread.$(ARCH).o \ -
branches/eam_branches/ipp-20140904/Ohana/src/libohana/include/ohana.h
r37356 r37386 242 242 // sorting is now defined as a macro call 243 243 # include <ohana_sort.h> 244 245 // vector statistics options 246 typedef enum { 247 VSTATS_NONE, 248 VSTATS_MEAN, 249 VSTATS_MEDIAN, 250 VSTATS_WT_MEAN, 251 VSTATS_INNER_MEAN, 252 VSTATS_INNER_WTMEAN, 253 VSTATS_CHI_INNER_MEAN, 254 VSTATS_CHI_INNER_WTMEAN 255 } VStatsMode; 256 257 typedef struct { 258 double median; 259 double mean; 260 double sigma; 261 double error; 262 double chisq; 263 double min; 264 double max; 265 double Upper80; 266 double Lower20; 267 double total; 268 int Nmeas; 269 VStatsMode statmode; 270 } VStatsType; 244 271 245 272 /* socket / pipe communication buffer */ … … 388 415 int rconnect (char *command, char *hostname, char *shell, int *stdio, int *errorInfo, int doHandshake); 389 416 417 int vstats_setmode (VStatsType *stats, char *mode); 418 int vstats_getstats (double *value, double *dvalue, double *weight, int N, VStatsType *stats); 419 int vstats_getstats_f (float *value, float *dvalue, float *weight, int N, VStatsType *stats); 420 390 421 /* 391 422 # define F_SETFL 4 -
branches/eam_branches/ipp-20140904/Ohana/src/markrock/src/gcatstats.c
r36481 r37386 34 34 /* project onto rectilinear grid with 1 arcsec pixels, sort by X */ 35 35 /* reference for coords is center of field */ 36 InitCoords (&catstats[0].coords, "DEC--TAN"); 36 37 catstats[0].coords.crval1 = RaCenter; 37 38 catstats[0].coords.crval2 = DecCenter; 38 catstats[0].coords.crpix1 = catstats[0].coords.crpix2 = 0.0;39 39 catstats[0].coords.cdelt1 = catstats[0].coords.cdelt2 = 1.0 / 3600.0; 40 catstats[0].coords.pc1_1 = catstats[0].coords.pc2_2 = 1.0; 41 catstats[0].coords.pc1_2 = catstats[0].coords.pc2_1 = 0.0; 42 strcpy (catstats[0].coords.ctype, "DEC--TAN"); 43 40 44 41 X1 = catstats[0].X; 45 42 Y1 = catstats[0].Y; -
branches/eam_branches/ipp-20140904/Ohana/src/markstar/src/gcatstats.c
r36483 r37386 44 44 /* project onto rectilinear grid with 1 arcsec pixels, sort by X */ 45 45 /* reference for coords is center of field */ 46 InitCoords (&catstats[0].coords, "DEC--TAN"); 46 47 catstats[0].coords.crval1 = RaCenter; 47 48 catstats[0].coords.crval2 = DecCenter; 48 catstats[0].coords.crpix1 = catstats[0].coords.crpix2 = 0.0;49 49 catstats[0].coords.cdelt1 = catstats[0].coords.cdelt2 = 1.0 / 3600.0; 50 catstats[0].coords.pc1_1 = catstats[0].coords.pc2_2 = 1.0;51 catstats[0].coords.pc1_2 = catstats[0].coords.pc2_1 = 0.0;52 strcpy (catstats[0].coords.ctype, "DEC--TAN");53 50 54 51 X1 = catstats[0].X; -
branches/eam_branches/ipp-20140904/Ohana/src/mosastro/src/chips.c
r7401 r37386 21 21 22 22 /* bore site center guess */ 23 strcpy (chip[i].map.ctype, "DEC--PLY"); 24 chip[i].map.crpix1 = 0.0; 25 chip[i].map.crpix2 = 0.0; 26 chip[i].map.cdelt1 = 1.0; 27 chip[i].map.cdelt2 = 1.0; 23 InitCoords (&chip[i].map, "DEC--PLY"); 28 24 29 25 /* find (L,M) coords of reference pixel (0,0) */ -
branches/eam_branches/ipp-20140904/Ohana/src/mosastro/src/fakefield.c
r3401 r37386 22 22 23 23 /* bore site center guess */ 24 strcpy (field.project.ctype, "DEC--TAN"); 25 field.project.crpix1 = 0; 26 field.project.crpix2 = 0; 24 InitCoords (&field.project, "DEC--TAN"); 27 25 28 26 /* set TP plate scale */ … … 30 28 field.project.cdelt2 = 1.0/3600.0; 31 29 32 /** allow guess at field rotation?? **/33 field.project.pc1_1 = 1;34 field.project.pc2_2 = 1;35 field.project.pc1_2 = 0;36 field.project.pc2_1 = 0;37 field.project.Npolyterms = 1;38 39 30 /** distort only has power in polyterms **/ 40 strcpy (field.distort.ctype, "DEC--PLY"); 41 field.distort.crval1 = 0.0; 42 field.distort.crval2 = 0.0; 43 field.distort.crpix1 = 0.0; 44 field.distort.crpix2 = 0.0; 45 field.distort.cdelt1 = 1.0; 46 field.distort.cdelt2 = 1.0; 47 48 field.distort.pc1_1 = 1; 49 field.distort.pc2_2 = 1; 50 field.distort.pc1_2 = 0; 51 field.distort.pc2_1 = 0; 52 53 /* how do we handle renormalization? (fixed at 1000 pixels??) */ 54 field.distort.Npolyterms = 3; 55 for (i = 0; i < 7; i++) { 56 field.distort.polyterms[i][0] = 0; 57 field.distort.polyterms[i][1] = 0; 58 } 31 InitCoords (&field.distort, "DEC--PLY"); 59 32 60 33 return (1); -
branches/eam_branches/ipp-20140904/Ohana/src/mosastro/src/field.c
r7401 r37386 12 12 13 13 /* bore site center guess */ 14 strcpy (field.project.ctype, "DEC--TAN");14 InitCoords (&field.project, "DEC--TAN"); 15 15 16 16 # if (PSASTRO_MODE) … … 23 23 # endif 24 24 25 field.project.crpix1 = 0;26 field.project.crpix2 = 0;27 28 25 /* measure average plate scale - would be better using parabolic min... */ 29 26 field.project.cdelt1 = 0; … … 47 44 3600*field.project.cdelt1, 3600*field.project.cdelt2); 48 45 49 /** allow guess at field rotation?? **/50 field.project.pc1_1 = 1;51 field.project.pc2_2 = 1;52 field.project.pc1_2 = 0;53 field.project.pc2_1 = 0;54 field.project.Npolyterms = 1;55 56 46 /* bore site center guess */ 57 strcpy (field.distort.ctype, "DEC--PLY"); 58 field.distort.crval1 = 0.0; 59 field.distort.crval2 = 0.0; 60 field.distort.crpix1 = 0.0; 61 field.distort.crpix2 = 0.0; 62 field.distort.cdelt1 = 1.0; 63 field.distort.cdelt2 = 1.0; 64 65 /** allow guess at field rotation?? **/ 66 field.distort.pc1_1 = 1; 67 field.distort.pc2_2 = 1; 68 field.distort.pc1_2 = 0; 69 field.distort.pc2_1 = 0; 70 71 /* allow 2nd and 3rd order? */ 72 /* how do we handle renormalization? (fixed at 1000 pixels??) */ 73 field.distort.Npolyterms = 1; 74 for (i = 0; i < 7; i++) { 75 field.distort.polyterms[i][0] = 0; 76 field.distort.polyterms[i][1] = 0; 77 } 47 InitCoords (&field.distort, "DEC--PLY"); 78 48 return (TRUE); 79 49 } … … 138 108 int load_field (char *filename) { 139 109 140 int i;141 110 Coords coords; 142 111 Header header; … … 156 125 157 126 /* bore site center guess */ 158 strcpy (field.project.ctype, "DEC--TAN");127 InitCoords (&field.project, "DEC--TAN"); 159 128 field.project.crval1 = 0.5*(field.Rmin + field.Rmax); 160 129 field.project.crval2 = 0.5*(field.Dmin + field.Dmax); 161 field.project.crpix1 = 0;162 field.project.crpix2 = 0;163 130 164 131 /* measure average plate scale - would be better using parabolic min... */ … … 174 141 175 142 /* bore site center guess */ 176 strcpy (field.distort.ctype, "DEC--PLY"); 177 field.distort.crval1 = 0.0; 178 field.distort.crval2 = 0.0; 179 field.distort.crpix1 = 0.0; 180 field.distort.crpix2 = 0.0; 181 field.distort.cdelt1 = 1.0; 182 field.distort.cdelt2 = 1.0; 183 184 /** allow guess at field rotation?? **/ 185 field.distort.pc1_1 = 1; 186 field.distort.pc2_2 = 1; 187 field.distort.pc1_2 = 0; 188 field.distort.pc2_1 = 0; 143 InitCoords (&field.distort, "DEC--PLY"); 189 144 190 /* allow 2nd and 3rd order? */191 /* how do we handle renormalization? (fixed at 1000 pixels??) */192 field.distort.Npolyterms = coords.Npolyterms;193 for (i = 0; i < 7; i++) {194 field.distort.polyterms[i][0] = coords.polyterms[i][0];195 field.distort.polyterms[i][1] = coords.polyterms[i][1];196 }197 145 return (TRUE); 198 146 } -
branches/eam_branches/ipp-20140904/Ohana/src/mosastro/src/fitpoly.c
r16058 r37386 130 130 double R; 131 131 132 InitCoords (coords, "DEC--PLY"); 133 132 134 /* update the higher order terms */ 133 135 if (NORDER > 1) { … … 166 168 167 169 coords[0].Npolyterms = NORDER; 168 strcpy (coords[0].ctype, "DEC--PLY");169 170 } 170 171 -
branches/eam_branches/ipp-20140904/Ohana/src/mosastro/src/mkobs.c
r7080 r37386 104 104 105 105 /* Chip-Sky terms */ 106 strcpy (coords.ctype, "DEC--WRP");106 InitCoords (&coords, "DEC--WRP"); 107 107 coords.crval1 = Ro; 108 108 coords.crval2 = Do; … … 124 124 } 125 125 126 coords.pc1_1 = 1;127 coords.pc2_2 = 1;128 coords.pc1_2 = 0;129 coords.pc2_1 = 0;130 coords.Npolyterms = 1;131 132 126 header = mkheader (2*dX, 2*dY, Nstars, &coords); 133 127 -
branches/eam_branches/ipp-20140904/Ohana/src/mosastro/src/mkstandards.c
r7080 r37386 32 32 33 33 /* bore site center guess */ 34 strcpy (coords.ctype, "DEC--TAN");34 InitCoords (&coords, "DEC--TAN"); 35 35 coords.crval1 = atof(argv[1]); 36 36 coords.crval2 = atof(argv[2]); 37 37 coords.crpix1 = dX; 38 38 coords.crpix2 = dX; 39 40 39 coords.cdelt1 = 1/3600.0; 41 40 coords.cdelt2 = 1/3600.0; 42 43 coords.pc1_1 = 1;44 coords.pc2_2 = 1;45 coords.pc1_2 = 0;46 coords.pc2_1 = 0;47 coords.Npolyterms = 1;48 41 49 42 if (Random) { -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.astro/cdensify.c
r36489 r37386 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; -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.astro/fitplx.c
r36489 r37386 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; -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.astro/fitpm.c
r36489 r37386 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; -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.astro/region.c
r36489 r37386 80 80 if (!ohana_str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE); 81 81 Radius = atof (argv[3]); 82 strcpy (graphmode.coords.ctype, "DEC--TAN"); 82 InitCoords (&graphmode.coords, "DEC--TAN"); 83 83 84 if (argc == 5) { 84 85 if (!strcasecmp (argv[4], "TAN")) … … 99 100 strcpy (graphmode.coords.ctype, "DEC--PAR"); 100 101 } 102 103 graphmode.coords.crval1 = Ra; 104 graphmode.coords.crval2 = Dec; 101 105 102 106 graphmode.coords.pc1_1 = (graphmode.flipeast) ? -1 : 1; 107 graphmode.coords.pc2_2 = (graphmode.flipnorth) ? -1 : 1; 108 103 109 /* ask kapa for coordinate limits, to get the right aspect ratio */ 104 110 KapaGetLimits (kapa, &dx, &dy); … … 132 138 set_int_variable ("NORTH_UP", !graphmode.flipnorth); 133 139 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 140 if (!NoClear) KapaClearSections (kapa); 145 141 KapaSetLimits (kapa, &graphmode); -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/find_matches.c
r36489 r37386 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 -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/gimages.c
r37378 r37386 128 128 if (fabs(Ro - Ra) > 120.0) continue; 129 129 130 InitCoords (&local, "DEC--TAN"); 130 131 local.crval1 = Ro; 131 132 local.crval2 = Do; 132 local.crpix1 = local.crpix2 = 0.0;133 133 local.cdelt1 = local.cdelt2 = 1.0/3600.0; 134 local.pc1_1 = local.pc2_2 = 1.0;135 local.pc2_1 = local.pc1_2 = 0.0;136 local.Npolyterms = 1;137 strcpy (local.ctype, "DEC--TAN");138 134 139 135 if (typehash == DistortImage) { -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/objectcoverage.c
r34088 r37386 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); -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/showtile.c
r36489 r37386 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 */ -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/simage.c
r36489 r37386 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 */ -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/skycoverage.c
r37378 r37386 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); -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/include/astro.h
r31635 r37386 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 -
branches/eam_branches/ipp-20140904/Ohana/src/photdbc/src/find_images.c
r36481 r37386 19 19 20 20 /* we make positional comparisons in the projection of catalog */ 21 InitCoords (&tcoords, "DEC--TAN"); 21 22 tcoords.crval1 = 0.5*(region[0].RA[0] + region[0].RA[1]); 22 23 tcoords.crval2 = 0.5*(region[0].DEC[0] + region[0].DEC[1]); 23 tcoords.crpix1 = tcoords.crpix2 = 0.0;24 24 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 25 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;26 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;27 strcpy (tcoords.ctype, "DEC--TAN");28 25 29 26 timage = gfits_table_get_Image (&db[0].ftable, &Ntimage, &db[0].swapped); -
branches/eam_branches/ipp-20140904/Ohana/src/photdbc/src/join_stars.c
r37045 r37386 50 50 51 51 /* coordinate system for projection */ 52 InitCoords (&tcoords, "DEC--TAN"); 52 53 tcoords.crval1 = Rmid; 53 54 tcoords.crval2 = Dmid; 54 tcoords.crpix1 = tcoords.crpix2 = 0.0;55 55 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 56 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;57 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;58 tcoords.Npolyterms = 0;59 strcpy (tcoords.ctype, "DEC--TAN");60 56 61 57 /* project & sort coordinates in local linear frame */ -
branches/eam_branches/ipp-20140904/Ohana/src/photdbc/src/select_images.c
r37378 r37386 34 34 35 35 // the comparison is made in the catalog local projection. below we set crval1,2 36 tcoords.crpix1 = tcoords.crpix2 = 0.0;36 InitCoords (&tcoords, "DEC--TAN"); 37 37 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 38 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;39 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;40 strcpy (tcoords.ctype, "DEC--TAN");41 38 42 39 ALLOCATE (skycoords, SkyRegionCoords, skylist[0].Nregions); -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateObjects.c
r37261 r37386 69 69 70 70 /* project coordinates to a plane centered on the object with units of arcsec */ 71 coords.crval1 = 0; 72 coords.crval2 = 0; 73 coords.crpix1 = 0; 74 coords.crpix2 = 0; 71 InitCoords (&coords, "DEC--SIN"); 75 72 coords.cdelt1 = coords.cdelt2 = 1.0 / 3600.0; 76 coords.pc1_1 = coords.pc2_2 = 1.0;77 coords.pc1_2 = coords.pc2_1 = 0.0;78 coords.Npolyterms = 1;79 strcpy (coords.ctype, "DEC--SIN");80 73 81 74 // use J2000 as a reference time -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/bcatalog.c
r36833 r37386 27 27 28 28 /* for outlier rejection, project coordinates to a plane centered on the object with units of arcsec */ 29 coords.crval1 = 0; 30 coords.crval2 = 0; 31 coords.crpix1 = 0; 32 coords.crpix2 = 0; 29 InitCoords (&coords, "DEC--SIN"); 33 30 coords.cdelt1 = coords.cdelt2 = 1.0 / 3600.0; 34 coords.pc1_1 = coords.pc2_2 = 1.0;35 coords.pc1_2 = coords.pc2_1 = 0.0;36 coords.Npolyterms = 1;37 strcpy (coords.ctype, "DEC--SIN");38 31 39 32 // XXX in the future, use catalog[0].Nsecfilt only? allow catalogs to have variable Nsecfilt? … … 269 262 /* project coordinates to a plane centered on the object with units of arcsec */ 270 263 Coords coords; 264 InitCoords (&coords, "DEC--SIN"); 271 265 coords.crval1 = Rc; 272 266 coords.crval2 = Dc; 273 coords.crpix1 = 0;274 coords.crpix2 = 0;275 267 coords.cdelt1 = coords.cdelt2 = 1.0 / 3600.0; 276 coords.pc1_1 = coords.pc2_2 = 1.0;277 coords.pc1_2 = coords.pc2_1 = 0.0;278 coords.Npolyterms = 1;279 strcpy (coords.ctype, "DEC--SIN");280 268 281 269 // convert all average R,D values to X,Y: -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/high_speed_objects.c
r37038 r37386 149 149 150 150 // define a local projection 151 InitCoords (&tcoords, "DEC--ARC"); 151 152 tcoords.crval1 = 0.5*(region[0].Rmin + region[0].Rmax); 152 153 if (region[0].Dmax < 90) { … … 155 156 tcoords.crval2 = 90.0; 156 157 } 157 tcoords.crpix1 = 0;158 tcoords.crpix2 = 0;159 158 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 160 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;161 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;162 tcoords.Npolyterms = 1;163 strcpy (tcoords.ctype, "DEC--ARC");164 159 165 160 /* build spatial index (RA sort) referencing input array sequence */ -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/hpm_objects.c
r37038 r37386 126 126 127 127 // define a local projection 128 InitCoords (&tcoords, "DEC--ARC"); 128 129 tcoords.crval1 = 0.5*(region[0].Rmin + region[0].Rmax); 129 130 if (region[0].Dmax < 90) { … … 132 133 tcoords.crval2 = 90.0; 133 134 } 134 tcoords.crpix1 = 0;135 tcoords.crpix2 = 0;136 135 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 137 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;138 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;139 tcoords.Npolyterms = 1;140 136 strcpy (tcoords.ctype, "DEC--ARC"); 141 137 -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/select_images.c
r37378 r37386 23 23 int InRange, found; 24 24 double Ri[5], Di[5], Xi[5], Yi[5], dx, dy; 25 Coords tcoords;26 25 SkyRegionCoords *skycoords; 27 26 … … 46 45 47 46 // the comparison is made in the catalog local projection. below we set crval1,2 48 tcoords.crpix1 = tcoords.crpix2 = 0.0; 47 Coords tcoords; 48 InitCoords (&tcoords, "DEC--TAN"); 49 49 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 50 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;51 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;52 strcpy (tcoords.ctype, "DEC--TAN");53 50 54 51 ALLOCATE (skycoords, SkyRegionCoords, skylist[0].Nregions); -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/testparallax.c
r36482 r37386 49 49 50 50 /* project coordinates to a plane centered on the object with units of arcsec */ 51 coords.crval1 = 0; 52 coords.crval2 = 0; 53 coords.crpix1 = 0; 54 coords.crpix2 = 0; 51 InitCoords (&coords, "DEC--SIN"); 55 52 coords.cdelt1 = coords.cdelt2 = 1.0 / 3600.0; 56 coords.pc1_1 = coords.pc2_2 = 1.0;57 coords.pc1_2 = coords.pc2_1 = 0.0;58 coords.Npolyterms = 1;59 strcpy (coords.ctype, "DEC--SIN");60 53 61 54 // use one point as a local reference -
branches/eam_branches/ipp-20140904/Ohana/src/relphot/src/MosaicOps.c
r37378 r37386 582 582 } 583 583 584 strcpy (mosaic[i].coords.ctype, "DEC--TAN");584 InitCoords (&mosaic[i].coords, "DEC--TAN"); 585 585 mosaic[i].coords.crval1 = Rmid; 586 586 mosaic[i].coords.crval2 = Dmid; 587 mosaic[i].coords.crpix1 = 0.0;588 mosaic[i].coords.crpix2 = 0.0;589 587 mosaic[i].coords.cdelt1 = 1.0 / 3600.0; 590 588 mosaic[i].coords.cdelt2 = 1.0 / 3600.0; 591 mosaic[i].coords.pc1_1 = 1.0;592 mosaic[i].coords.pc2_2 = 1.0;593 mosaic[i].coords.pc1_2 = 0.0;594 mosaic[i].coords.pc2_1 = 0.0;595 589 596 590 mosaic[i].Mcal = 0.0; … … 663 657 } 664 658 dS /= MosaicN_Image[i]; 665 strcpy (mosaic[i].coords.ctype, "DEC--TAN"); 659 660 InitCoords (&mosaic[i].coords, "DEC--TAN"); 666 661 mosaic[i].coords.crval1 = Rmin; 667 662 mosaic[i].coords.crval2 = Dmin; 668 mosaic[i].coords.crpix1 = 0.0;669 mosaic[i].coords.crpix2 = 0.0;670 663 mosaic[i].coords.cdelt1 = dS; 671 664 mosaic[i].coords.cdelt2 = dS; 672 mosaic[i].coords.pc1_1 = 1.0; 673 mosaic[i].coords.pc2_2 = 1.0; 674 mosaic[i].coords.pc1_2 = 0.0; 675 mosaic[i].coords.pc2_1 = 0.0; 665 676 666 RD_to_XY (&dX, &dY, Rmax, Dmax, &mosaic[i].coords); 677 667 -
branches/eam_branches/ipp-20140904/Ohana/src/relphot/src/select_images.c
r37378 r37386 36 36 37 37 // the comparison is made in the catalog local projection. below we set crval1,2 38 tcoords.crpix1 = tcoords.crpix2 = 0.0;38 InitCoords (&tcoords, "DEC--TAN"); 39 39 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 40 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;41 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;42 strcpy (tcoords.ctype, "DEC--TAN");43 40 44 41 double RminSkyRegion = region[0].Rmin; … … 397 394 398 395 // the comparison is made in the catalog local projection. below we set crval1,2 399 tcoords.crpix1 = tcoords.crpix2 = 0.0;396 InitCoords (&tcoords, "DEC--TAN"); 400 397 tcoords.cdelt1 = tcoords.cdelt2 = 1.0 / 3600.0; 401 tcoords.pc1_1 = tcoords.pc2_2 = 1.0;402 tcoords.pc1_2 = tcoords.pc2_1 = 0.0;403 404 tcoords.Npolyterms = 0;405 memset (tcoords.polyterms, 0, 14*sizeof(float));406 strcpy (tcoords.ctype, "DEC--TAN");407 398 408 399 /* compare with each region file */ -
branches/eam_branches/ipp-20140904/Ohana/src/uniphot/src/find_image_sgroups.c
r37378 r37386 18 18 } 19 19 20 coords.crpix1 = coords.crpix2 = 0.0; 21 coords.cdelt1 = coords.cdelt2 = 1.0; /* scale is degrees, radius in degrees */ 22 coords.pc1_1 = coords.pc2_2 = 1.0; 23 coords.pc1_2 = coords.pc2_1 = 0.0; 24 strcpy (coords.ctype, "DEC--TAN"); 20 InitCoords (&coords, "DEC--TAN"); 25 21 26 22 Ngroup = 0; -
branches/eam_branches/ipp-20140904/Ohana/src/uniphot/src/update_dvo_uniphot.c
r36481 r37386 57 57 glob (line, 0, NULL, &pglob); 58 58 59 coords.crpix1 = coords.crpix2 = 0.0; 60 coords.cdelt1 = coords.cdelt2 = 1.0; /* scale is degrees, radius in degrees */ 61 coords.pc1_1 = coords.pc2_2 = 1.0; 62 coords.pc1_2 = coords.pc2_1 = 0.0; 63 strcpy (coords.ctype, "DEC--TAN"); 59 InitCoords (&coords, "DEC--TAN"); 64 60 65 61 for (i = 0; i < pglob.gl_pathc; i++) {
Note:
See TracChangeset
for help on using the changeset viewer.
