IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15543


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

fixed magnitude limit selections; allow non-average photcodes

Location:
trunk/Ohana/src/getstar/src
Files:
6 edited

Legend:

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

    r12462 r15543  
    3838    exit (1);
    3939  }
     40  SetZeroPoint (25.0);
    4041
    4142  free (config);
  • trunk/Ohana/src/getstar/src/args.c

    r15540 r15543  
    7272      exit (1);
    7373    }
    74     // XXX check that photcode is SEC type
    7574    remove_argument (N, &argc, argv);
    7675  }
  • trunk/Ohana/src/getstar/src/select_by_region.c

    r15540 r15543  
    44int select_by_region (Catalog *output, Catalog *catalog, SkyRegion *region, int start, int end) {
    55
    6   int i, j, n, Nm, offset, Nsecfilt;
     6  int i, j, n, Nm, offset, m, Nsecfilt, code, Nsec;
    77  int Nave, NAVE, Nmeas, NMEAS;
    88  double R, D;
     9  float mag;
    910
    1011  Nsecfilt = output[0].Nsecfilt;
     
    2324    gfits_modify (&output[0].header, "DEC1", "%lf", 1, region[0].Dmax);
    2425  }
     26
     27  code = photcode[0].code;
     28  Nsec = GetPhotcodeNsec (code);
    2529
    2630  /* select the average objects in this region */
     
    4549    if (D > region[0].Dmax) continue;
    4650
    47     /* XXX add photcode as argument to MagLimitUse */
    48     if (MagLimitUse && (catalog[0].secfilt[Nsecfilt*i].M > MagLimitValue)) continue;
     51    if (MagLimitUse) {
     52      mag = NAN;
     53      if (Nsec != -1) {
     54        mag = catalog[0].secfilt[i*Nsecfilt + Nsec].M;
     55      } else {
     56        offset = catalog[0].average[i].offset;
     57        for (m = 0; m < catalog[0].average[i].Nm; m++) {
     58          if (catalog[0].measure[offset + m].photcode == code) {
     59            mag = PhotRel (&catalog[0].measure[offset + m], &catalog[0].average[i], &catalog[0].secfilt[i*Nsecfilt]);
     60            break;
     61          }
     62        }
     63      }
     64      if (isnan(mag) || (mag > MagLimitValue)) continue;
     65    }
    4966
    5067    output[0].average[Nave] = catalog[0].average[i];
  • trunk/Ohana/src/getstar/src/write_getstar_ps1_dev_0.c

    r15539 r15543  
    4040  secfilt = catalog[0].secfilt;
    4141
    42   if (Nsec_c0 == -1) {
    43     fprintf (stderr, "invalid photcode %s\n", photcode[0].name);
    44     exit (2);
    45   }
    46 
    4742  // do we skip any of catalog entries? (probably not)
    4843  for (i = 0; i < catalog[0].Naverage; i++) {
     
    5045    output[i].R        = average[i].R;
    5146    output[i].D        = average[i].D;
    52     output[i].mag      = secfilt[i*Nsecfilt + Nsec_c0].M;
    5347
    5448    output[i].code     = average[i].code;
    5549    output[i].photcode = code_c0;
    5650
    57     // It is not necessary for the output color terms to be average values.  If they are,
    58     // we grab them quickly & easily from the secfilt table.  If not, then we need to scan
    59     // the list of measures to find the value of interest
     51    // It is not necessary for the output magnitude or color terms to be average values.
     52    // If they are, we grab them quickly & easily from the secfilt table.  If not, then we
     53    // need to scan the list of measures to find the value of interest
     54
     55    // find primary magnitude
     56    if (Nsec_c0 != -1) {
     57      output[i].mag = secfilt[i*Nsecfilt + Nsec_c0].M;
     58    } else {
     59      output[i].mag = NAN;
     60      offset = average[i].offset;
     61      for (m = 0; m < average[i].Nm; m++) {
     62        if (measure[offset + m].photcode == code_c0) {
     63          output[i].mag = PhotRel (&measure[offset + m], &average[i], &secfilt[i*Nsecfilt]);
     64          break;
     65        }
     66      }
     67    }
    6068
    6169    // find color term 1
  • trunk/Ohana/src/getstar/src/write_getstar_ps1_dev_1.c

    r15539 r15543  
    4040  secfilt = catalog[0].secfilt;
    4141
    42   if (Nsec_c0 == -1) {
    43     fprintf (stderr, "invalid photcode %s\n", photcode[0].name);
    44     exit (2);
    45   }
    46 
    4742  // do we skip any of catalog entries? (probably not)
    4843  for (i = 0; i < catalog[0].Naverage; i++) {
     
    5752    output[i].photcode = code_c0;
    5853
    59     output[i].mag      = secfilt[i*Nsecfilt + Nsec_c0].M;
    60 
    6154    // It is not necessary for the output color terms to be average values.  If they are,
    6255    // we grab them quickly & easily from the secfilt table.  If not, then we need to scan
    6356    // the list of measures to find the value of interest
     57
     58    // find primary magnitude
     59    if (Nsec_c0 != -1) {
     60      output[i].mag = secfilt[i*Nsecfilt + Nsec_c0].M;
     61    } else {
     62      output[i].mag = NAN;
     63      offset = average[i].offset;
     64      for (m = 0; m < average[i].Nm; m++) {
     65        if (measure[offset + m].photcode == code_c0) {
     66          output[i].mag = PhotRel (&measure[offset + m], &average[i], &secfilt[i*Nsecfilt]);
     67          break;
     68        }
     69      }
     70    }
    6471
    6572    // find color term 1
  • 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.