Changeset 33807 for branches/eam_branches/ipp-20120405/Ohana
- Timestamp:
- Apr 19, 2012, 6:22:30 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120405/Ohana/src/relphot
- Files:
-
- 6 edited
-
include/relphot.h (modified) (1 diff)
-
src/StarOps.c (modified) (3 diffs)
-
src/bcatalog.c (modified) (2 diffs)
-
src/load_catalogs.c (modified) (1 diff)
-
src/select_images.c (modified) (2 diffs)
-
src/setMrelFinal.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120405/Ohana/src/relphot/include/relphot.h
r33799 r33807 198 198 int args PROTO((int argc, char **argv)); 199 199 int args_client PROTO((int argc, char **argv)); 200 int bcatalog PROTO((Catalog *subcatalog, Catalog *catalog ));200 int bcatalog PROTO((Catalog *subcatalog, Catalog *catalog, int Ncat)); 201 201 void clean_images PROTO((void)); 202 202 void clean_measures PROTO((Catalog *catalog, int Ncatalog, int final, FlatCorrectionTable *flatcorr)); -
branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/StarOps.c
r33797 r33807 178 178 179 179 if (getImageEntry (m, Nc) < 0) { 180 Mcal = Mmos = Mgrid = 0; 180 // measurements without an image are either external reference photometry or 181 // data for which the associated image has not been loaded (probably because of 182 // overlaps). Msys + measure.Mcal is our best guess of the true magnitude 183 Mmos = Mgrid = 0; 184 Mcal = catalog[Nc].measureT[m].Mcal; // check that this is zero for loaded REF value 181 185 } else { 182 186 Mcal = getMcal (m, Nc, flatcorr, catalog); … … 429 433 430 434 if (getImageEntry (m, i) < 0) { 435 XXXX : likely problem -- compare with setMrel_catalog; 431 436 // these detetions have no image (eg, ref values such as 2MASS) 432 437 Mcal = Mmos = Mgrid = 0; … … 795 800 if (isnan(Mgrid)) continue; 796 801 802 // note that measurements for which the image is not selected will not up modified 803 // (that is a good thing! -- we keep a prior calibration) 804 797 805 // set the output calibration 798 806 catalog[i].measure[m].Mcal = Mcal + Mmos + Mgrid; -
branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/bcatalog.c
r33736 r33807 3 3 int LimitDensityCatalog_ByNmeasure (Catalog *subcatalog, Catalog *oldcatalog); 4 4 5 int bcatalog (Catalog *subcatalog, Catalog *catalog ) {5 int bcatalog (Catalog *subcatalog, Catalog *catalog, int Ncat) { 6 6 7 7 off_t i, j, offset; … … 159 159 subcatalog[0].measureT[Nmeasure].averef = Naverage; 160 160 if (RESET) { 161 if (!KEEP_UBERCAL) { 162 subcatalog[0].measureT[Nmeasure].Mcal = 0; 163 subcatalog[0].measureT[Nmeasure].dbFlags &= ~ID_MEAS_PHOTOM_UBERCAL; 161 // only reset Mcal for measures with a matching image 162 // do not reset Mcal for ubercal images unless explicitly requested 163 if (subcatalog[0].measureT[Nmeasure].dbFlags & ID_MEAS_PHOTOM_UBERCAL) { 164 if (!KEEP_UBERCAL) { 165 subcatalog[0].measureT[Nmeasure].Mcal = 0.0; 166 subcatalog[0].measureT[Nmeasure].dbFlags &= ~ID_MEAS_PHOTOM_UBERCAL; 167 } 168 } else { 169 if (getImageEntry (Nmeasure, Ncat) >= 0) { 170 subcatalog[0].measureT[Nmeasure].Mcal = 0.0; 171 } 164 172 } 165 173 subcatalog[0].measureT[Nmeasure].dbFlags &= ~PHOTOM_FLAGS; -
branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/load_catalogs.c
r33651 r33807 68 68 69 69 // select only the brighter stars 70 bcatalog (&catalog[i], &tcatalog );70 bcatalog (&catalog[i], &tcatalog, i); 71 71 dvo_catalog_unlock (&tcatalog); 72 72 dvo_catalog_free (&tcatalog); -
branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/select_images.c
r33798 r33807 122 122 RmaxSkyRegion = RmaxSkyRegionAlt; 123 123 } 124 125 124 double RmidSkyRegion = 0.5*(RminSkyRegion + RmaxSkyRegion); 126 125 MARKTIME("create sky region coords: %f sec\n", dtime); 127 126 128 // if we overlap 0,360, RminSkyRegion will be 180 (or so)129 130 127 dsortindex (RmaxSky, index, skylist[0].Nregions); 131 128 MARKTIME("sort sky coords: %f sec\n", dtime); 129 130 // generate a set of Rmin/Rmax values using this RmidSkyRegion for DEC bands of width 131 // dDecBand (0.1 deg). DecIndex = (Dec + 90) / dDecBand 132 double *RminBand, *RmaxBand; 133 float dDecBand = 0.1; 134 int NDecBands = 180 / dDecBand + 1; 135 ALLOCATE (RminBand, double, NDecBands); 136 ALLOCATE (RmaxBand, double, NDecBands); 137 for (i = 0; i < NDecBands; i++) { 138 RminBand[i] = +360.0; 139 RmaxBand[i] = -360.0; 140 } 141 142 /* compare with each region file */ 143 for (i = 0; i < skylist[0].Nregions; i++) { 144 int iDecBandMin = (skylist[0].regions[i][0].Dmin + 90.0) / dDecBand; 145 int iDecBandMax = (skylist[0].regions[i][0].Dmax + 90.0) / dDecBand; 146 147 double RminAlt = ohana_normalize_angle_to_midpoint (skylist[0].regions[i][0].Rmin, RmidSkyRegion); 148 double RmaxAlt = ohana_normalize_angle_to_midpoint (skylist[0].regions[i][0].Rmax, RmidSkyRegion); 149 150 for (j = iDecBandMin; j <= iDecBandMax; j++) { 151 RminBand[j] = MIN(RminBand[j], RminAlt); 152 RmaxBand[j] = MAX(RmaxBand[j], RmaxAlt); 153 } 154 } 155 156 # if (0) 157 // XXX quick test 158 FILE *fout = fopen ("dec.bands.dat", "w"); 159 for (i = 0; i < NDecBands; i++) { 160 fprintf (fout, "%d %f : %f - %f\n", (int) i, dDecBand * i - 90.0, RminBand[i], RmaxBand[i]); 161 } 162 fclose (fout); 163 # endif 132 164 133 165 if (VERBOSE) fprintf (stderr, "finding images\n"); … … 209 241 if (RminImage > RmaxSkyRegion) continue; 210 242 if (RmaxImage < RminSkyRegion) continue; 243 244 // the above checks are only valid for the outermost region. however, at a given 245 // declination, the range of RA is limited by the actual catalog boundaries 246 // check if this image is in range for the Dmax and Dmin locations 247 248 int iDecBandMin = (DminImage + 90.0) / dDecBand; 249 int iDecBandMax = (DmaxImage + 90.0) / dDecBand; 250 251 // the sky region RA is defined to be 0 - 360.0 252 if (RminImage > RmaxBand[iDecBandMin]) { 253 fprintf (stderr, "skip image %s (%f,%f) on boundary\n", timage[i].name, 0.5*(RminImage + RmaxImage), 0.5*(DminImage + DmaxImage)); 254 continue; 255 } 256 if (RminImage > RmaxBand[iDecBandMax]) { 257 fprintf (stderr, "skip image %s (%f,%f) on boundary\n", timage[i].name, 0.5*(RminImage + RmaxImage), 0.5*(DminImage + DmaxImage)); 258 continue; 259 } 260 if (RmaxImage < RminBand[iDecBandMin]) { 261 fprintf (stderr, "skip image %s (%f,%f) on boundary\n", timage[i].name, 0.5*(RminImage + RmaxImage), 0.5*(DminImage + DmaxImage)); 262 continue; 263 } 264 if (RmaxImage < RminBand[iDecBandMax]) { 265 fprintf (stderr, "skip image %s (%f,%f) on boundary\n", timage[i].name, 0.5*(RminImage + RmaxImage), 0.5*(DminImage + DmaxImage)); 266 continue; 267 } 211 268 212 269 // image overlaps region, keep it -
branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/setMrelFinal.c
r33736 r33807 66 66 } 67 67 68 if (!KEEP_UBERCAL) { 69 catalog[0].measure[m].Mcal = 0; 70 catalog[0].measure[m].dbFlags &= ~ID_MEAS_PHOTOM_UBERCAL; 68 // only reset Mcal for measures with a matching image 69 // do not reset Mcal for ubercal images unless explicitly requested 70 71 if (catalog[0].measure[m].dbFlags & ID_MEAS_PHOTOM_UBERCAL) { 72 if (!KEEP_UBERCAL) { 73 catalog[0].measure[m].Mcal = 0.0; 74 catalog[0].measure[m].dbFlags &= ~ID_MEAS_PHOTOM_UBERCAL; 75 } 76 } else { 77 if (getImageEntry (m, 0) >= 0) { 78 catalog[0].measure[m].Mcal = 0.0; 79 } 71 80 } 72 81 catalog[0].measure[m].dbFlags &= ~PHOTOM_FLAGS;
Note:
See TracChangeset
for help on using the changeset viewer.
