Changeset 33643 for trunk/psastro/src/psastroLoadRefstars.c
- Timestamp:
- Mar 30, 2012, 3:01:51 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroLoadRefstars.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroLoadRefstars.c
r33028 r33643 180 180 } 181 181 182 // apply a color correction 183 { 184 // from Tonry 185 // (w-r)_obs = 0.042 + 0.166 (r-i)_obs - 0.398 (r-i)_obs^2, (r-i)_obs < 0.5 186 // (w-r)_obs = 0.268 - 0.435 (r-i)_obs - 0.078 (r-i)_obs^2, (r-i)_obs > 0.5 187 // thus, for (r-i < 0.5): 188 // (r - i < 0.5) : w = r + 0.042 + 0.166*(r-i) - 0.398(r-i)^2 189 // (r - i > 0.5) : w = r + 0.268 - 0.435 (r-i) - 0.078(r-i)^2 190 191 // apply a color correction 192 // XXX this is very GPC1 specific and hard-wired -- be very afraid! 193 // select the filter; default to fixed photcode and mag limit otherwise 194 pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, source); // we've already done this before 195 char *filter = psMetadataLookupStr (&status, input->fpa->concepts, "FPA.FILTERID"); 196 if (!strcmp(filter, "w")) { 197 for (int i = 0; i < refstars->n; i++) { 198 pmAstromObj *ref = refstars->data[i]; 199 float r = ref->Mag; 200 float ri = ref->Color; 201 // saturate at some valid range limits 202 ri = PS_MAX (PS_MIN(ri, 2.0), -0.2); 203 float w = NAN; 204 if (ri < 0.5) { 205 w = r + 0.042 + 0.166*(ri) - 0.398*PS_SQR(ri); 206 } else { 207 w = r + 0.268 - 0.435*(ri) - 0.078*PS_SQR(ri); 208 } 209 ref->Mag = w; 210 } 211 } 212 } 213 182 214 psLogMsg ("psastro", 3, "loaded %ld reference stars : %f sec\n", refstars->n, psTimerMark ("psastro")); 183 215
Note:
See TracChangeset
for help on using the changeset viewer.
