IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 22, 2007, 4:05:39 PM (19 years ago)
Author:
eugene
Message:

adding fields needed by DVO for PS1 support; pre-calculating Xccd, Yccd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dvo-mods-2007-02/Ohana/src/addstar/src/find_matches_closest.c

    r10939 r12008  
    160160    /** add measurements for this star **/
    161161    /** dR,dD now represent arcsec **/
    162     catalog[0].measure[Nmeas].dR_PS       = 3600.0*(catalog[0].average[n].R - stars[N].R);
    163     if (catalog[0].measure[Nmeas].dR_PS > +180.0*3600.0) {
     162    catalog[0].measure[Nmeas].dR       = 3600.0*(catalog[0].average[n].R - stars[N].R);
     163    if (catalog[0].measure[Nmeas].dR > +180.0*3600.0) {
    164164      // average on high end of boundary, move star up
    165165      stars[N].R += 360.0;
    166       catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R - stars[N].R);
    167     }
    168     if (catalog[0].measure[Nmeas].dR_PS < -180.0*3600.0) {
     166      catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].R);
     167    }
     168    if (catalog[0].measure[Nmeas].dR < -180.0*3600.0) {
    169169      // average on low end of boundary, move star down
    170170      stars[N].R -= 360.0;
    171       catalog[0].measure[Nmeas].dR_PS = 3600.0*(catalog[0].average[n].R - stars[N].R);
    172     }
    173     if (fabs(catalog[0].measure[Nmeas].dR_PS) > 10*RADIUS) {
     171      catalog[0].measure[Nmeas].dR = 3600.0*(catalog[0].average[n].R - stars[N].R);
     172    }
     173    if (fabs(catalog[0].measure[Nmeas].dR) > 10*RADIUS) {
    174174      fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n",
    175175               catalog[0].average[n].R, catalog[0].average[n].D,
     
    178178               Y1[i], Y2[Jmin]);
    179179    }
    180     catalog[0].measure[Nmeas].dD_PS       = 3600.0*(catalog[0].average[n].D - stars[N].D);
    181     catalog[0].measure[Nmeas].M_PS        = stars[N].M;
    182     catalog[0].measure[Nmeas].dM_PS       = stars[N].dM;  /* error in input files stored in thousandths of mag */
    183     catalog[0].measure[Nmeas].Mcal_PS     = stars[N].Mcal;
    184     catalog[0].measure[Nmeas].t           = stars[N].t;
    185     catalog[0].measure[Nmeas].averef      = n;
    186     catalog[0].measure[Nmeas].source      = stars[N].code;  /* photcode */
    187     catalog[0].measure[Nmeas].dophot      = stars[N].dophot; 
    188     catalog[0].measure[Nmeas].flags       = 0;
    189     catalog[0].measure[Nmeas].dt_PS       = stars[N].dt;
    190     catalog[0].measure[Nmeas].airmass_PS  = stars[N].airmass;
    191 
    192     catalog[0].measure[Nmeas].Mgal_PS     = stars[N].Mgal;
    193     catalog[0].measure[Nmeas].FWx         = MIN (100*stars[N].fx, NO_MAG);
    194     catalog[0].measure[Nmeas].FWy         = MIN (100*stars[N].fy, NO_MAG);
    195     catalog[0].measure[Nmeas].theta       = MIN ((255/360)*stars[N].df, NO_ERR);
     180    catalog[0].measure[Nmeas].dD       = 3600.0*(catalog[0].average[n].D - stars[N].D);
     181
     182    /* XXX need to add dX, dY : need to load into stars[N].dX,dY */
     183    /* XXX need to add stargal, Sky, dSky, qPSF, detID, imageID */
     184    catalog[0].measure[Nmeas].Xccd     = stars[N].X;
     185    catalog[0].measure[Nmeas].Yccd     = stars[N].Y;
     186
     187    catalog[0].measure[Nmeas].M        = stars[N].M;
     188    catalog[0].measure[Nmeas].dM       = stars[N].dM;  /* error in input files stored in thousandths of mag */
     189    catalog[0].measure[Nmeas].Mcal     = stars[N].Mcal;
     190    catalog[0].measure[Nmeas].t        = stars[N].t;
     191    catalog[0].measure[Nmeas].averef   = n;
     192    catalog[0].measure[Nmeas].photcode = stars[N].code;  /* photcode */
     193    catalog[0].measure[Nmeas].dophot   = stars[N].dophot; 
     194    catalog[0].measure[Nmeas].flags    = 0;
     195    catalog[0].measure[Nmeas].dt       = stars[N].dt;
     196    catalog[0].measure[Nmeas].airmass  = stars[N].airmass;
     197
     198    catalog[0].measure[Nmeas].Mgal     = stars[N].Mgal;
     199    catalog[0].measure[Nmeas].FWx      = MIN (100*stars[N].fx, NO_MAG);
     200    catalog[0].measure[Nmeas].FWy      = MIN (100*stars[N].fy, NO_MAG);
     201    catalog[0].measure[Nmeas].theta    = MIN ((0xffff/360.0)*stars[N].df, NO_MAG);
    196202       
    197203    /* it is not valid to pass PRI/SEC/REF photcodes to this routine */
    198204    /* check for entries in the secfilt lists */
    199205    Mcat = PhotCat (&catalog[0].measure[Nmeas]);
    200     Mval = (Nsec == -1) ? &catalog[0].average[n].M : &catalog[0].secfilt[n*Nsecfilt+Nsec].M_PS;
     206    Mval = (Nsec == -1) ? &catalog[0].average[n].M : &catalog[0].secfilt[n*Nsecfilt+Nsec].M;
    201207    if (*Mval == NO_MAG) *Mval = Mcat;
    202208    /* in UPDATE mode, this value is not saved; use relphot to recalculate */
     
    261267
    262268    for (j = 0; j < Nsecfilt; j++) {
    263       catalog[0].secfilt[Nave*Nsecfilt+j].M_PS  = NO_MAG;
    264       catalog[0].secfilt[Nave*Nsecfilt+j].dM_PS = NO_MAG;
     269      catalog[0].secfilt[Nave*Nsecfilt+j].M  = NO_MAG;
     270      catalog[0].secfilt[Nave*Nsecfilt+j].dM = NO_MAG;
    265271      catalog[0].secfilt[Nave*Nsecfilt+j].Xm    = NO_MAG;
    266272    }
    267273
    268     catalog[0].measure[Nmeas].dR_PS       = 0.0;
    269     catalog[0].measure[Nmeas].dD_PS       = 0.0;
    270     catalog[0].measure[Nmeas].M_PS        = stars[N].M;
    271     catalog[0].measure[Nmeas].dM_PS       = stars[N].dM;
    272     catalog[0].measure[Nmeas].Mcal_PS     = stars[N].Mcal;
    273     catalog[0].measure[Nmeas].t           = stars[N].t;
    274     catalog[0].measure[Nmeas].averef      = Nave;
    275     catalog[0].measure[Nmeas].source      = stars[N].code;  /* photcode */
    276     catalog[0].measure[Nmeas].dophot      = stars[N].dophot; 
    277     catalog[0].measure[Nmeas].flags       = 0;
    278     catalog[0].measure[Nmeas].dt_PS       = stars[N].dt;
    279     catalog[0].measure[Nmeas].airmass_PS  = stars[N].airmass;
    280 
    281     catalog[0].measure[Nmeas].Mgal_PS     = stars[N].Mgal;
    282     catalog[0].measure[Nmeas].FWx         = MIN (100*stars[N].fx, NO_MAG);
    283     catalog[0].measure[Nmeas].FWy         = MIN (100*stars[N].fy, NO_MAG);
    284     catalog[0].measure[Nmeas].theta       = MIN ((255/360)*stars[N].df, NO_ERR);
     274    /* XXX need to add dX, dY : need to load into stars[N].dX,dY */
     275    /* XXX need to add stargal, Sky, dSky, qPSF, detID, imageID */
     276    catalog[0].measure[Nmeas].Xccd     = stars[N].X;
     277    catalog[0].measure[Nmeas].Yccd     = stars[N].Y;
     278
     279    catalog[0].measure[Nmeas].dR       = 0.0;
     280    catalog[0].measure[Nmeas].dD       = 0.0;
     281    catalog[0].measure[Nmeas].M        = stars[N].M;
     282    catalog[0].measure[Nmeas].dM       = stars[N].dM;
     283    catalog[0].measure[Nmeas].Mcal     = stars[N].Mcal;
     284    catalog[0].measure[Nmeas].t        = stars[N].t;
     285    catalog[0].measure[Nmeas].averef   = Nave;
     286    catalog[0].measure[Nmeas].photcode = stars[N].code;  /* photcode */
     287    catalog[0].measure[Nmeas].dophot   = stars[N].dophot; 
     288    catalog[0].measure[Nmeas].flags    = 0;
     289    catalog[0].measure[Nmeas].dt       = stars[N].dt;
     290    catalog[0].measure[Nmeas].airmass  = stars[N].airmass;
     291
     292    catalog[0].measure[Nmeas].Mgal     = stars[N].Mgal;
     293    catalog[0].measure[Nmeas].FWx      = MIN (100*stars[N].fx, NO_MAG);
     294    catalog[0].measure[Nmeas].FWy      = MIN (100*stars[N].fy, NO_MAG);
     295    catalog[0].measure[Nmeas].theta    = MIN ((0xffff/360.0)*stars[N].df, NO_ERR);
    285296
    286297    Mcat = PhotCat (&catalog[0].measure[Nmeas]);
    287     Mval = (Nsec == -1) ? &catalog[0].average[Nave].M : &catalog[0].secfilt[Nave*Nsecfilt+Nsec].M_PS;
     298    Mval = (Nsec == -1) ? &catalog[0].average[Nave].M : &catalog[0].secfilt[Nave*Nsecfilt+Nsec].M;
    288299    if (*Mval == NO_MAG) *Mval = Mcat;
    289300
Note: See TracChangeset for help on using the changeset viewer.