- Timestamp:
- Nov 2, 2014, 3:35:12 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/ImageOps.c
r37455 r37545 809 809 810 810 // XXX subtract off dR,dD GAL here 811 if (USE_GAL _MODEL) {811 if (USE_GALAXY_MODEL) { 812 812 ref[i].R += measure[0].RoffGAL; 813 813 ref[i].D += measure[0].DoffGAL; … … 848 848 *Nstars = N_onImage[im]; 849 849 return (ref); 850 } 851 852 // return StarData values for detections in the specified image, converting coordinates from the 853 // chip positions: X,Y -> L,M -> P,Q -> R,D. This function is used by the image fitting steps, for 854 // which the detections have already been filtered when they were loaded (bcatalog) 855 int setImageRaw (Catalog *catalog, int Ncatalog, off_t im, StarData *raw, off_t Nraw, CoordMode mode) { 856 857 off_t i, m, c; 858 859 Coords *moscoords; 860 861 moscoords = NULL; 862 if (mode == MODE_MOSAIC) { 863 moscoords = image[im].coords.mosaic; 864 myAssert (moscoords, "coords.mosaic not defined for image %s (%d)", image[im].name, (int) im); 865 } 866 867 myAssert (Nraw == N_onImage[im], "impossible!"); 868 869 for (i = 0; i < N_onImage[im]; i++) { 870 m = ImageToMeasure[im][i]; 871 c = ImageToCatalog[im][i]; 872 873 // XXX should I use the raw coords or just measure.X,Y -> R,D? 874 875 switch (mode) { 876 case MODE_SIMPLE: 877 /* note that for a Simple image, L,M = P,Q */ 878 XY_to_LM (&raw[i].L, &raw[i].M, raw[i].X, raw[i].Y, &image[im].coords); 879 raw[i].P = raw[i].L; 880 raw[i].Q = raw[i].M; 881 LM_to_RD (&raw[i].R, &raw[i].D, raw[i].P, raw[i].Q, &image[im].coords); 882 break; 883 case MODE_MOSAIC: 884 XY_to_LM (&raw[i].L, &raw[i].M, raw[i].X, raw[i].Y, &image[im].coords); 885 XY_to_LM (&raw[i].P, &raw[i].Q, raw[i].L, raw[i].M, moscoords); 886 LM_to_RD (&raw[i].R, &raw[i].D, raw[i].P, raw[i].Q, moscoords); 887 break; 888 default: 889 fprintf (stderr, "error: invalid mode in getImageRaw"); 890 abort (); 891 } 892 893 MeasureTiny *measure = &catalog[c].measureT[m]; 894 measure->R = raw[i].R; 895 measure->D = raw[i].D; 896 if (catalog[c].measure) { 897 catalog[c].measure[m].R = raw[i].R; 898 catalog[c].measure[m].D = raw[i].D; 899 } 900 } 901 return TRUE; 850 902 } 851 903
Note:
See TracChangeset
for help on using the changeset viewer.
