IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 7, 2007, 6:28:03 PM (19 years ago)
Author:
eugene
Message:

converted internal NO_MAG and NO_ERR to NAN, NAN_S_SHORT, etc as appropriate

Location:
trunk/Ohana/src/addstar/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/FilterStars.c

    r15487 r15509  
    4949    }
    5050
    51     if (stars[N].M >= 0.001*NO_MAG) {
    52       stars[N].M       = 0.001*NO_MAG;
    53     } else {
    54       stars[N].M       = stars[N].M + MTIME;
     51    // stars->M is either NAN or a valid inst magnitude
     52    // stars->dM is either NAN or a valid error
     53
     54    dMs  = 0.0;
     55    dMx = 0.0;
     56    if (SUBPIX) {
     57      dMs = get_subpix (stars[N].X, stars[N].Y);
     58      dMx = scat_subpix (stars[N].X, stars[N].Y);
     59      if (!isnan(stars[N].dM)) {
     60        stars[N].dM = hypot (stars[N].dM, dMx);
     61      }
    5562    }
    5663
    57     if (stars[N].M > 32.77) {
    58       fprintf (stderr, "*");
     64    if (!isnan(stars[N].M)) {
     65      stars[N].M += MTIME - dMs;
    5966    }
    60 
    61     stars[N].dM      = MIN (stars[N].dM, NO_ERR);
    62 
    63     stars[N].Mgal    = MIN (stars[N].Mgal + MTIME, 0.001*NO_MAG);
     67    if (!isnan(stars[N].Mgal)) {
     68      stars[N].Mgal += MTIME - dMs;
     69    }
     70    if (!isnan(stars[N].Map)) {
     71      stars[N].Map += MTIME - dMs;
     72    }
    6473   
    65     if (SUBPIX) {
    66       dMs = get_subpix (stars[N].X, stars[N].Y);
    67       stars[N].M    -= dMs;
    68       stars[N].Mgal -= dMs;
    69       stars[N].Map  -= dMs;
    70       dMs = scat_subpix (stars[N].X, stars[N].Y);
    71       stars[N].dM = hypot (stars[N].dM, dMs);
    72     }
    7374    N ++;
    7475  }
  • trunk/Ohana/src/addstar/src/ReadImageHeader.c

    r15036 r15509  
    135135  image[0].trate = 10000 * tmp;
    136136
    137   tmp = 0;
    138   gfits_scan (header, AirmassKeyword, "%lf", 1, &tmp);
    139   image[0].secz = MIN (NO_MAG, tmp);
     137  image[0].secz = NAN;
     138  if (gfits_scan (header, AirmassKeyword, "%lf", 1, &tmp)) {
     139    image[0].secz = tmp;
     140  }
    140141
    141142  if (!gfits_scan (header, CCDNumKeyword, "%d", 1, &ccdnum)) {
  • trunk/Ohana/src/addstar/src/ReadStarsFITS.c

    r15487 r15509  
    5454
    5555  int i, Nstars, swapped;
     56  double ZeroPt;
    5657  Stars *stars = NULL;
    5758  SMPData *smpdata = NULL;
    … …  
    5960  swapped = FALSE;
    6061  smpdata = gfits_table_get_SMPData (table, &Nstars, &swapped);
     62  ZeroPt = GetZeroPoint();
     63
    6164  /* XXX we need to check at least the size of the loaded table */
    62 
    6365  // XXX use memset to zero-out the elements before setting
     66
    6467  ALLOCATE (stars, Stars, Nstars);
    6568  for (i = 0; i < Nstars; i++) {
    6669    stars[i].X      = smpdata[i].X;
    6770    stars[i].Y      = smpdata[i].Y;
    68     stars[i].M      = smpdata[i].M;
     71
     72    if ((smpdata[i].M >= ZeroPt) || isnan(smpdata[i].M)) {
     73      stars[i].M    = NAN;
     74      stars[i].Mgal = NAN;
     75      stars[i].Map  = NAN;
     76    } else {
     77      stars[i].M    = smpdata[i].M;
     78      stars[i].Mgal = smpdata[i].M;
     79      stars[i].Map  = smpdata[i].M;
     80    }
     81
    6982    stars[i].dM     = smpdata[i].dM*0.001;
    7083    stars[i].dophot = smpdata[i].dophot;
    7184
    72     stars[i].Mgal   = smpdata[i].M;
    73     stars[i].Map    = smpdata[i].dM;
    7485    stars[i].fx     = smpdata[i].fx;
    7586    stars[i].fy     = smpdata[i].fy;
    … …  
    8899
    89100  ps1data = gfits_table_get_PS1_DEV_0 (table, &Nstars, NULL);
     101  ZeroPt = GetZeroPoint();
     102
     103  ALLOCATE (stars, Stars, Nstars);
     104  for (i = 0; i < Nstars; i++) {
     105    stars[i].X       = ps1data[i].X;
     106    stars[i].Y       = ps1data[i].Y;
     107    stars[i].dX      = ps1data[i].dX;
     108    stars[i].dY      = ps1data[i].dY;
     109    if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) {
     110      stars[i].M     = NAN;
     111    } else {
     112      stars[i].M     = ps1data[i].M + ZeroPt;
     113    }
     114    stars[i].dM      = ps1data[i].dM;
     115    stars[i].Mpeak   = ps1data[i].Mpeak;
     116
     117    stars[i].sky     = ps1data[i].sky;
     118    stars[i].dsky    = ps1data[i].dSky;
     119
     120    stars[i].fx      = ps1data[i].fx;
     121    stars[i].fy      = ps1data[i].fy;
     122    stars[i].df      = ps1data[i].df;
     123
     124    stars[i].psfProb = ps1data[i].psfProb;
     125    stars[i].psfQual = ps1data[i].psfQual;
     126
     127    stars[i].detID   = ps1data[i].detID;
     128
     129    /* these are set elsewhere */
     130    stars[i].R       = 0.0;
     131    stars[i].D       = 0.0;
     132    stars[i].dR      = 0.0;
     133    stars[i].dD      = 0.0;
     134
     135    stars[i].uR      = 0.0;
     136    stars[i].uD      = 0.0;
     137    stars[i].duR     = 0.0;
     138    stars[i].duD     = 0.0;
     139
     140    stars[i].P       = 0.0;
     141    stars[i].dP      = 0.0;
     142
     143    stars[i].Mcal    = 0;
     144    stars[i].t       = 0;
     145    stars[i].dt      = 0;
     146    stars[i].airmass = 0;
     147    stars[i].code    = 0;
     148    stars[i].found   = 0;
     149
     150    /* these are not used */
     151    stars[i].Map     = NAN;
     152    stars[i].Mgal    = NAN;
     153    stars[i].dophot  = 0;
     154  }   
     155  *nstars = Nstars;
     156  return (stars);
     157}
     158
     159// XXX I need to make the IPP I/O functions and these functions
     160// consistent wrt ZERO_POINT....
     161Stars *Convert_PS1_DEV_1 (FTable *table, int *nstars) {
     162
     163  int i, Nstars;
     164  double ZeroPt;
     165  Stars *stars;
     166  PS1_DEV_1 *ps1data;
     167
     168  ps1data = gfits_table_get_PS1_DEV_1 (table, &Nstars, NULL);
    90169  ZeroPt = GetZeroPoint();
    91170
    … …  
    111190    stars[i].df      = ps1data[i].df;
    112191
    113     stars[i].psfProb = ps1data[i].psfProb;
    114     stars[i].psfQual = ps1data[i].psfQual;
    115 
    116     stars[i].detID   = ps1data[i].detID;
    117 
    118     /* these are set elsewhere */
    119     stars[i].R       = 0.0;
    120     stars[i].D       = 0.0;
    121     stars[i].dR      = 0.0;
    122     stars[i].dD      = 0.0;
    123 
    124     stars[i].uR      = 0.0;
    125     stars[i].uD      = 0.0;
    126     stars[i].duR     = 0.0;
    127     stars[i].duD     = 0.0;
    128 
    129     stars[i].P       = 0.0;
    130     stars[i].dP      = 0.0;
    131 
    132     stars[i].Mcal    = 0;
    133     stars[i].t       = 0;
    134     stars[i].dt      = 0;
    135     stars[i].airmass = 0;
    136     stars[i].code    = 0;
    137     stars[i].found   = 0;
    138 
    139     /* these are not used */
    140     stars[i].Map     = 0.001*NO_MAG;
    141     stars[i].Mgal    = 0.001*NO_MAG;
    142     stars[i].dophot  = 0;
    143   }   
    144   *nstars = Nstars;
    145   return (stars);
    146 }
    147 
    148 // XXX I need to make the IPP I/O functions and these functions
    149 // consistent wrt ZERO_POINT....
    150 Stars *Convert_PS1_DEV_1 (FTable *table, int *nstars) {
    151 
    152   int i, Nstars;
    153   double ZeroPt;
    154   Stars *stars;
    155   PS1_DEV_1 *ps1data;
    156 
    157   ps1data = gfits_table_get_PS1_DEV_1 (table, &Nstars, NULL);
    158   ZeroPt = GetZeroPoint();
    159 
    160   ALLOCATE (stars, Stars, Nstars);
    161   for (i = 0; i < Nstars; i++) {
    162     stars[i].X       = ps1data[i].X;
    163     stars[i].Y       = ps1data[i].Y;
    164     stars[i].dX      = ps1data[i].dX;
    165     stars[i].dY      = ps1data[i].dY;
    166     if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) {
    167         stars[i].M   = 0.001*NO_MAG;
    168     } else {
    169         stars[i].M   = ps1data[i].M + ZeroPt;
    170     }
    171     stars[i].dM      = ps1data[i].dM;
    172     stars[i].Mpeak   = ps1data[i].Mpeak;
    173 
    174     stars[i].sky     = ps1data[i].sky;
    175     stars[i].dsky    = ps1data[i].dSky;
    176 
    177     stars[i].fx      = ps1data[i].fx;
    178     stars[i].fy      = ps1data[i].fy;
    179     stars[i].df      = ps1data[i].df;
    180 
    181192    stars[i].psfProb   = ps1data[i].psfProb;
    182193    stars[i].psfQual   = ps1data[i].psfQual;
    … …  
    213224
    214225    /* these are not used */
    215     stars[i].Map     = 0.001*NO_MAG;
    216     stars[i].Mgal    = 0.001*NO_MAG;
     226    stars[i].Map     = NAN;
     227    stars[i].Mgal    = NAN;
    217228    stars[i].dophot  = 0;
    218229  }   
  • trunk/Ohana/src/addstar/src/ReadStarsTEXT.c

    r15036 r15509  
    1010  char *buffer, *c, *c2;
    1111  double tmp;
     12  double ZeroPt;
    1213  Stars *stars;
    1314 
     15  ZeroPt = GetZeroPoint();
     16
    1417  /* load in stars by blocks of 1000 */
    1518  N = 0;
    … …  
    6669      dparse (&stars[N].Y,  2, &buffer[j*BYTES_STAR]);
    6770      dparse (&stars[N].M,  3, &buffer[j*BYTES_STAR]);
     71      if ((stars[N].M > ZeroPt) || isnan(stars[N].M)) {
     72        stars[N].M = NAN;
     73      }
    6874
    6975      /* cmp files carry dM in millimags */
  • trunk/Ohana/src/addstar/src/SEDfit.c

    r15038 r15509  
    161161    outcat[0].average[Nave].Nm        = 0;
    162162    outcat[0].average[Nave].Nn        = 0;
    163     outcat[0].average[Nave].Xp        = NO_MAG;
     163    outcat[0].average[Nave].Xp        = NAN_S_SHORT;
    164164    outcat[0].average[Nave].offset    = Nmeas;
    165165    outcat[0].average[Nave].missing   = -1;
    … …  
    167167
    168168    for (j = 0; j < Nsec; j++) {
    169       outcat[0].secfilt[Nave*Nsec+j].M  = NO_MAG;
    170       outcat[0].secfilt[Nave*Nsec+j].dM = NO_MAG;
    171       outcat[0].secfilt[Nave*Nsec+j].Xm    = NO_MAG;
     169      outcat[0].secfilt[Nave*Nsec+j].M  = NAN;
     170      outcat[0].secfilt[Nave*Nsec+j].dM = NAN;
     171      outcat[0].secfilt[Nave*Nsec+j].Xm = NAN_S_SHORT;
    172172    }
    173173
    … …  
    183183      outcat[0].measure[Nmeas].dR       = 0.0;
    184184      outcat[0].measure[Nmeas].dD       = 0.0;
    185       outcat[0].measure[Nmeas].M        = MIN (table[0].row[minFit.row][0].mags[n] + minFit.Md,  NO_MAG);
     185      outcat[0].measure[Nmeas].M        = table[0].row[minFit.row][0].mags[n] + minFit.Md;
    186186      outcat[0].measure[Nmeas].dM       = 0.0;
    187187      outcat[0].measure[Nmeas].Mcal     = 0;
    … …  
    193193      outcat[0].measure[Nmeas].dt       = 0xffff;
    194194
    195       outcat[0].measure[Nmeas].Mgal     = NO_MAG;
     195      outcat[0].measure[Nmeas].Mgal     = NAN;
    196196      outcat[0].measure[Nmeas].airmass  = 0;
    197       outcat[0].measure[Nmeas].FWx         = NO_MAG;
    198       outcat[0].measure[Nmeas].FWy         = NO_ERR;
    199       outcat[0].measure[Nmeas].theta       = NO_ERR;
     197      outcat[0].measure[Nmeas].FWx      = NAN_S_SHORT;
     198      outcat[0].measure[Nmeas].FWy      = NAN_S_SHORT;
     199      outcat[0].measure[Nmeas].theta    = NAN_S_SHORT;
    200200
    201201      outcat[0].average[Nave].Nm++;
  • trunk/Ohana/src/addstar/src/calibrate.c

    r15036 r15509  
    5454
    5555  found0 = found1 = found2 = FALSE;
    56   CalM0 = CalM1 = CalM2 = dCalM = NO_MAG;
     56  CalM0 = CalM1 = CalM2 = dCalM = NAN;
    5757
    5858  // we have two options here:
  • trunk/Ohana/src/addstar/src/fakeimage.c

    r15036 r15509  
    128128
    129129    image[i+1].Mcal = 0.0;
    130     image[i+1].Xm   = NO_MAG;
     130    image[i+1].Xm   = NAN_S_SHORT;
    131131    image[i+1].code = 0;
    132132    memset (image[i+1].dummy, 0, sizeof(image[i+1].dummy));
    … …  
    187187  image[0].ccdnum = 0xff;
    188188  image[0].Mcal = 0.0;
    189   image[0].Xm   = NO_MAG;
     189  image[0].Xm   = NAN_S_SHORT;
    190190  image[0].code = 0;
    191191  memset (image[0].dummy, 0, sizeof(image[0].dummy));
  • trunk/Ohana/src/addstar/src/find_matches.c

    r15038 r15509  
    194194
    195195      catalog[0].measure[Nmeas].Mgal     = stars[N].Mgal;
    196       catalog[0].measure[Nmeas].FWx      = MIN (100*stars[N].fx, NO_MAG);
    197       catalog[0].measure[Nmeas].FWy      = MIN (100*stars[N].fy, NO_MAG);
    198       catalog[0].measure[Nmeas].theta    = MIN ((0xffff/360.0)*stars[N].df, NO_MAG);
     196      catalog[0].measure[Nmeas].FWx      = 100*stars[N].fx;
     197      catalog[0].measure[Nmeas].FWy      = 100*stars[N].fy;
     198      catalog[0].measure[Nmeas].theta    = (0xffff/360.0)*stars[N].df;
    199199       
    200200      /* adds the measurement to the calibration if appropriate color terms are found */
    … …  
    207207      /* in UPDATE mode, this value is not saved; use relphot to recalculate */
    208208      if (Nsec > -1) {
    209           if (catalog[0].secfilt[n*Nsecfilt+Nsec].M != NO_MAG) {
    210               catalog[0].secfilt[n*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas]);
    211           }
     209        if (isnan(catalog[0].secfilt[n*Nsecfilt+Nsec].M)) {
     210          catalog[0].secfilt[n*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas]);
     211        }
    212212      }
    213213
    … …  
    282282
    283283    for (j = 0; j < Nsecfilt; j++) {
    284       catalog[0].secfilt[Nave*Nsecfilt+j].M  = NO_MAG;
    285       catalog[0].secfilt[Nave*Nsecfilt+j].dM = NO_MAG;
    286       catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NO_MAG;
     284      catalog[0].secfilt[Nave*Nsecfilt+j].M  = NAN;
     285      catalog[0].secfilt[Nave*Nsecfilt+j].dM = NAN;
     286      catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NAN_S_SHORT;
    287287    }
    288288
    … …  
    320320
    321321    catalog[0].measure[Nmeas].Mgal      = stars[N].Mgal;
    322     catalog[0].measure[Nmeas].FWx       = MIN (100*stars[N].fx, NO_MAG);
    323     catalog[0].measure[Nmeas].FWy       = MIN (100*stars[N].fy, NO_MAG);
    324     catalog[0].measure[Nmeas].theta     = MIN ((0xffff/360.0)*stars[N].df, NO_MAG);
     322    catalog[0].measure[Nmeas].FWx       = 100*stars[N].fx;
     323    catalog[0].measure[Nmeas].FWy       = 100*stars[N].fy;
     324    catalog[0].measure[Nmeas].theta     = (0xffff/360.0)*stars[N].df;
    325325    /* XXX replace df here with theta, right? */
    326326
  • trunk/Ohana/src/addstar/src/find_matches_closest.c

    r15038 r15509  
    214214
    215215    catalog[0].measure[Nmeas].Mgal     = stars[N].Mgal;
    216     catalog[0].measure[Nmeas].FWx      = MIN (100*stars[N].fx, NO_MAG);
    217     catalog[0].measure[Nmeas].FWy      = MIN (100*stars[N].fy, NO_MAG);
    218     catalog[0].measure[Nmeas].theta    = MIN ((0xffff/360.0)*stars[N].df, NO_MAG);
     216
     217    // XXX saturate range for FWx, FWy, theta
     218    // XXX convert to unsigned int for these...
     219    catalog[0].measure[Nmeas].FWx      = 100*stars[N].fx;
     220    catalog[0].measure[Nmeas].FWy      = 100*stars[N].fy;
     221    catalog[0].measure[Nmeas].theta    = (0xffff/360.0)*stars[N].df;
    219222       
    220223    /* set the average magnitude if not already set and the photcode.equiv is not 0 */
    221224    /* in UPDATE mode, this value is not saved; use relphot to recalculate */
    222225    if (Nsec > -1) {
    223         if (catalog[0].secfilt[n*Nsecfilt+Nsec].M != NO_MAG) {
    224             catalog[0].secfilt[n*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas]);
    225         }
     226      if (isnan(catalog[0].secfilt[n*Nsecfilt+Nsec].M)) {
     227        catalog[0].secfilt[n*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas]);
     228      }
    226229    }
    227230
    … …  
    281284
    282285    for (j = 0; j < Nsecfilt; j++) {
    283       catalog[0].secfilt[Nave*Nsecfilt+j].M  = NO_MAG;
    284       catalog[0].secfilt[Nave*Nsecfilt+j].dM = NO_MAG;
    285       catalog[0].secfilt[Nave*Nsecfilt+j].Xm    = NO_MAG;
     286      catalog[0].secfilt[Nave*Nsecfilt+j].M  = NAN;
     287      catalog[0].secfilt[Nave*Nsecfilt+j].dM = NAN;
     288      catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NAN_S_SHORT;
    286289    }
    287290
    … …  
    319322
    320323    catalog[0].measure[Nmeas].Mgal     = stars[N].Mgal;
    321     catalog[0].measure[Nmeas].FWx      = MIN (100*stars[N].fx, NO_MAG);
    322     catalog[0].measure[Nmeas].FWy      = MIN (100*stars[N].fy, NO_MAG);
    323     catalog[0].measure[Nmeas].theta    = MIN ((0xffff/360.0)*stars[N].df, NO_ERR);
     324    catalog[0].measure[Nmeas].FWx      = 100*stars[N].fx;
     325    catalog[0].measure[Nmeas].FWy      = 100*stars[N].fy;
     326    catalog[0].measure[Nmeas].theta    = (0xffff/360.0)*stars[N].df;
    324327
    325328    /* set the average magnitude if not already set and the photcode.equiv is not 0 */
  • trunk/Ohana/src/addstar/src/find_matches_refstars.c

    r15038 r15509  
    133133      catalog[0].measure[Nmeas].dR       = 3600.0*(catalog[0].average[n].R - stars[N][0].R);
    134134      catalog[0].measure[Nmeas].dD       = 3600.0*(catalog[0].average[n].D - stars[N][0].D);
    135       catalog[0].measure[Nmeas].M        = MIN (stars[N][0].M,  NO_MAG);
    136       catalog[0].measure[Nmeas].dM       = MIN (stars[N][0].dM, NO_ERR);
     135      catalog[0].measure[Nmeas].M        = stars[N][0].M;
     136      catalog[0].measure[Nmeas].dM       = stars[N][0].dM;
    137137      catalog[0].measure[Nmeas].Mcal     = 0;
    138138      catalog[0].measure[Nmeas].t        = (TIMEREF == 0) ? stars[N][0].t : TIMEREF; /** careful : time_t vs e_time **/
    … …  
    143143      catalog[0].measure[Nmeas].dt       = 0xffff;
    144144
    145       catalog[0].measure[Nmeas].Mgal     = NO_MAG;
     145      catalog[0].measure[Nmeas].Mgal     = NAN;
    146146      catalog[0].measure[Nmeas].airmass  = 0;
    147       catalog[0].measure[Nmeas].FWx      = NO_MAG;
    148       catalog[0].measure[Nmeas].FWy      = NO_MAG;
    149       catalog[0].measure[Nmeas].theta    = NO_MAG;
     147      catalog[0].measure[Nmeas].FWx      = NAN_S_SHORT;
     148      catalog[0].measure[Nmeas].FWy      = NAN_S_SHORT;
     149      catalog[0].measure[Nmeas].theta    = NAN_S_SHORT;
    150150       
    151151      catalog[0].measure[Nmeas].photFlags = 0;
    … …  
    254254
    255255    for (j = 0; j < Nsecfilt; j++) {
    256       catalog[0].secfilt[Nave*Nsecfilt+j].M  = NO_MAG;
    257       catalog[0].secfilt[Nave*Nsecfilt+j].dM = NO_MAG;
    258       catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NO_MAG;
     256      catalog[0].secfilt[Nave*Nsecfilt+j].M  = NAN;
     257      catalog[0].secfilt[Nave*Nsecfilt+j].dM = NAN;
     258      catalog[0].secfilt[Nave*Nsecfilt+j].Xm = NAN_S_SHORT;
    259259    }
    260260
    261261    catalog[0].measure[Nmeas].dR       = 0.0;
    262262    catalog[0].measure[Nmeas].dD       = 0.0;
    263     catalog[0].measure[Nmeas].M        = MIN (stars[N][0].M,  NO_MAG);
    264     catalog[0].measure[Nmeas].dM       = MIN (stars[N][0].dM, NO_ERR);
     263    catalog[0].measure[Nmeas].M        = stars[N][0].M;
     264    catalog[0].measure[Nmeas].dM       = stars[N][0].dM;
    265265    catalog[0].measure[Nmeas].Mcal     = 0;
    266266    catalog[0].measure[Nmeas].t        = (stars[N][0].t == 0) ? TIMEREF : stars[N][0].t; /** careful : time_t vs e_time **/
    … …  
    291291
    292292    catalog[0].measure[Nmeas].airmass  = 0;
    293     catalog[0].measure[Nmeas].Mgal     = NO_MAG;
    294     catalog[0].measure[Nmeas].FWx      = NO_MAG;
    295     catalog[0].measure[Nmeas].FWy      = NO_MAG;
    296     catalog[0].measure[Nmeas].theta    = NO_MAG;
     293    catalog[0].measure[Nmeas].Mgal     = NAN;
     294    catalog[0].measure[Nmeas].FWx      = NAN_S_SHORT;
     295    catalog[0].measure[Nmeas].FWy      = NAN_S_SHORT;
     296    catalog[0].measure[Nmeas].theta    = NAN_S_SHORT;
    297297
    298298    catalog[0].measure[Nmeas].Xccd     = 0.0;
  • trunk/Ohana/src/addstar/src/load2mass_catalog.c

    r15038 r15509  
    3434    catalog[0].average[Nave].Nm        = 0;
    3535    catalog[0].average[Nave].Nn        = 0;
    36     catalog[0].average[Nave].Xp        = NO_MAG;
     36    catalog[0].average[Nave].Xp        = NAN_S_SHORT;
    3737    catalog[0].average[Nave].offset    = Nmeas;
    3838    catalog[0].average[Nave].missing   = -1;
    … …  
    4040
    4141    for (j = 0; j < Nsec; j++) {
    42       catalog[0].secfilt[Nave*Nsec+j].M  = NO_MAG;
    43       catalog[0].secfilt[Nave*Nsec+j].dM = NO_MAG;
    44       catalog[0].secfilt[Nave*Nsec+j].Xm    = NO_MAG;
     42      catalog[0].secfilt[Nave*Nsec+j].M  = NAN;
     43      catalog[0].secfilt[Nave*Nsec+j].dM = NAN;
     44      catalog[0].secfilt[Nave*Nsec+j].Xm = NAN_S_SHORT;
    4545    }
    4646
    … …  
    4949      catalog[0].measure[Nmeas].dR       = 0.0;
    5050      catalog[0].measure[Nmeas].dD       = 0.0;
    51       catalog[0].measure[Nmeas].M        = MIN (stars[i+j].M,  NO_MAG);
    52       catalog[0].measure[Nmeas].dM       = MIN (stars[i+j].dM,  NO_ERR);
     51      catalog[0].measure[Nmeas].M        = stars[i+j].M;
     52      catalog[0].measure[Nmeas].dM       = stars[i+j].dM;
    5353      catalog[0].measure[Nmeas].Mcal     = 0;
    5454      catalog[0].measure[Nmeas].t        = stars[i+j].t;
    … …  
    5959      catalog[0].measure[Nmeas].dt       = 0xffff;
    6060
    61       catalog[0].measure[Nmeas].Mgal     = NO_MAG;
     61      catalog[0].measure[Nmeas].Mgal     = NAN;
    6262      catalog[0].measure[Nmeas].airmass  = 0;
    63       catalog[0].measure[Nmeas].FWx         = NO_MAG;
    64       catalog[0].measure[Nmeas].FWy         = NO_ERR;
    65       catalog[0].measure[Nmeas].theta       = NO_ERR;
     63      catalog[0].measure[Nmeas].FWx      = NAN_S_SHORT;
     64      catalog[0].measure[Nmeas].FWy      = NAN_S_SHORT;
     65      catalog[0].measure[Nmeas].theta    = NAN_S_SHORT;
    6666
    6767      catalog[0].average[Nave].Nm++;
  • trunk/Ohana/src/addstar/src/replace_match.c

    r12332 r15509  
    88  for (i = 0; i < average[0].Nm; i++) {
    99    if (measure[i].photcode != star[0].code) continue;
    10     measure[i].dR       = 3600.0*(average[0].R - star[0].R);
    11     measure[i].dD       = 3600.0*(average[0].D - star[0].D);
    12     measure[i].M        = MIN (star[0].M,  NO_MAG);
    13     measure[i].dM       = MIN (star[0].dM, NO_ERR);
    14     star[0].found          = average[0].offset + i;
     10    measure[i].dR = 3600.0*(average[0].R - star[0].R);
     11    measure[i].dD = 3600.0*(average[0].D - star[0].D);
     12    measure[i].M  = star[0].M;
     13    measure[i].dM = star[0].dM;
     14    star[0].found = average[0].offset + i;
    1515    return (TRUE);
    1616  }
Note: See TracChangeset for help on using the changeset viewer.