IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 30, 2012, 3:01:51 PM (14 years ago)
Author:
eugene
Message:

updates related to zero points from new reference catalogs & w-band mags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroLoadRefstars.c

    r33028 r33643  
    180180    }
    181181
     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
    182214    psLogMsg ("psastro", 3, "loaded %ld reference stars : %f sec\n", refstars->n, psTimerMark ("psastro"));
    183215
Note: See TracChangeset for help on using the changeset viewer.