IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 9, 2007, 11:14:10 AM (19 years ago)
Author:
eugene
Message:

fixed magnitude limit selections; allow non-average photcodes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/getstar/src/write_getstar_ps1_dev_2.c

    r15539 r15543  
    3939  secfilt = catalog[0].secfilt;
    4040
    41   if (Nsec_c0 == -1) {
    42     fprintf (stderr, "invalid photcode %s\n", photcode[0].name);
    43     exit (2);
    44   }
    45 
    4641  // do we skip any of catalog entries? (probably not)
    4742  for (i = 0; i < catalog[0].Naverage; i++) {
     
    6358    output[i].photcode = code_c0;
    6459
    65     output[i].mag      = secfilt[i*Nsecfilt + Nsec_c0].M;
    66 
    6760    // It is not necessary for the output color terms to be average values.  If they are,
    6861    // we grab them quickly & easily from the secfilt table.  If not, then we need to scan
    6962    // the list of measures to find the value of interest
     63
     64    // find primary magnitude
     65    if (Nsec_c0 != -1) {
     66      output[i].mag = secfilt[i*Nsecfilt + Nsec_c0].M;
     67    } else {
     68      output[i].mag = NAN;
     69      offset = average[i].offset;
     70      for (m = 0; m < average[i].Nm; m++) {
     71        if (measure[offset + m].photcode == code_c0) {
     72          output[i].mag = PhotRel (&measure[offset + m], &average[i], &secfilt[i*Nsecfilt]);
     73          break;
     74        }
     75      }
     76    }
    7077
    7178    // find color term 1
Note: See TracChangeset for help on using the changeset viewer.