IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 8, 2025, 4:29:52 PM (14 months ago)
Author:
eugene
Message:

merge changes from eam_branches/ipp-20230313

Location:
trunk/Ohana
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/relphot

  • trunk/Ohana/src/relphot/include/relphot.h

    r42788 r42821  
    417417int IS_DIFF_DB;
    418418
     419double MAG_MIN;
    419420double MAG_LIM;
    420421double SIGMA_LIM;
     422
     423double STAR_MAX_PSF_KRON;
     424double PSF_QF_MIN;
     425
    421426double IMAGE_SCATTER;
    422427double IMAGE_OFFSET;
     
    471476int    RESET_FLATCORR;
    472477int    REPAIR_WARPS;
     478int    USE_REF_EQUIV;
    473479int    PRESERVE_PS1;
    474480int    REQUIRE_PSFFIT;
     
    486492double IMAGE_GOOD_FRACTION;
    487493int    CALIBRATE_STACKS_AND_WARPS;
     494int    CALIBRATE_WARPS_LIKE_CHIPS;
     495int    CALIBRATE_STACKS_LIKE_CHIPS;
    488496
    489497int    KEEP_UBERCAL;
  • trunk/Ohana/src/relphot/src/ConfigInit.c

    r41647 r42821  
    2323  if (VERBOSE) fprintf (stderr, "loaded config file: %s\n", file);
    2424
    25   GetConfig (config, "MAG_LIM",                "%lf", 0, &MAG_LIM);
    26   GetConfig (config, "SIGMA_LIM",              "%lf", 0, &SIGMA_LIM);
     25  // the following cuts are limit the objects used to calculate the image zero points.
     26  // These are used in bcatalog.c and apply to Mcat (nominal measurement magnitude)
     27  GetConfig (config, "SIGMA_LIM",              "%lf",    0, &SIGMA_LIM);
     28  GetConfig (config, "MAG_LIM",                "%lf",    0, &MAG_LIM);
     29
     30  DefConfig ("MAG_MIN",                        "%lf", 15.0, MAG_MIN);
     31  DefConfig ("STAR_MAX_PSF_KRON",              "%lf",  0.2, STAR_MAX_PSF_KRON);
     32  DefConfig ("PSF_QF_MIN",                     "%lf", 0.95, PSF_QF_MIN);
    2733
    2834  DefConfig ("STAR_SCATTER",                    "%lf",  0.1, STAR_SCATTER);
  • trunk/Ohana/src/relphot/src/ImageOps.c

    r41664 r42821  
    531531
    532532  // until the analysis has converged a bit, do not use the IRLS analysis
    533   // default is MaxIterations = 10
    534   if (UseStandardOLS(ZPT_IMAGES)) {
     533  // default is MaxIterations = 10.
     534
     535  // However, for stack and warp calibration, we are not iteratively solving for the
     536  // zero points.  In this case, use IRLS in a single pass
     537  if (!CALIBRATE_STACKS_AND_WARPS && UseStandardOLS(ZPT_IMAGES)) {
    535538    brightStars.MaxIterations = 0;
    536539    kronStars.MaxIterations = 0;
     
    672675
    673676      if ((image[i].imageID == TEST_IMAGE1) || (image[i].imageID == TEST_IMAGE2)) {
    674         fprintf (stderr, "%1d, %3d : %3d, %3d : %10.6f %10.6f : %6.3f  %6.3f  %6.3f  %6.3f  %6.3f : %6.3f\n", (int) i, (int) j, (int) c, (int) m, catalog[c].averageT[n].R, catalog[c].averageT[n].D, MsysKron, MrelKron, Mmos, Mgrid, Mflat, kronStars.alldata->yVector[Nkron]);
     677        fprintf (stderr, "%1d, %3d : %3d, %3d : %10.6f %10.6f : %6.3f %6.3f | %6.3f %6.3f | %6.3f %6.3f %6.3f %6.3f | %5.3f\n", (int) i, (int) j, (int) c, (int) m, catalog[c].averageT[n].R, catalog[c].averageT[n].D, MsysPSF, MrelPSF, MsysKron, MrelKron, Mmos, Mgrid, Mflat, Moff, psfStars.alldata->dyVector[Nref]);
    675678      }
    676679
     
    702705    if (mark) continue;
    703706
    704     // use liststats to find the 20-pct, median, 80-pct points
    705     StatType stats;
    706     liststats_setmode (&stats, "MEDIAN");
    707     liststats (psfStars.alldata->yVector, NULL, NULL, Nref, &stats);
    708     double altSigma = (stats.Upper80 - stats.Lower20) / 1.6;  // 20% to 80% encompasses 60% of the values, corresponds to the range (-0.85 sigma : +0.85 sigma)
    709 
    710     // soften the individual errors with 10% of the scatter above
    711     for (j = 0; j < Nref; j++) {
    712       double newSigma = hypot(psfStars.alldata->dyVector[j], 0.1*altSigma);
    713       psfStars.alldata->dyVector[j] = newSigma;
    714     }
    715 
    716     // soften the errors based on the scatter
     707    // soften the errors based on the core scatter
    717708    FitDataSetSoften (&psfStars, Nref);
    718709
  • trunk/Ohana/src/relphot/src/StarOps.c

    r41647 r42821  
    3434
    3535
    36 //
     36// Nsecfilt is a property of the photcode table.  we only need to retrieve it once.
     37static int Nsecfilt = -1;
     38
     39// return the average photometry for this measurement
    3740float getMrel (Catalog *catalog, off_t meas, int cat, dvoMagClassType class, dvoMagSourceType source) {
    3841
     
    4144
    4245  int ecode = GetPhotcodeEquivCodebyCode (photcode);
     46  if (USE_REF_EQUIV) {
     47    // tie this photometry to an alternative refernce
     48    // (e.g., tie UDR4.i to PV3.i)
     49    int refcode = GetPhotcodeEquivCodebyCode (ecode);
     50    if (refcode < 0) return NAN;
     51    ecode = refcode;
     52  }
     53
    4354  int Nsec = GetPhotcodeNsec(ecode);
    44   int Nsecfilt = GetPhotcodeNsecfilt ();
     55  if (Nsec < 0) return NAN;
     56
     57  if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); }
    4558
    4659  int entry = Nsecfilt*ave+Nsec;
     
    312325  }
    313326
    314   int Nsecfilt = GetPhotcodeNsecfilt ();
     327  if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); }
    315328
    316329  SetMrelInfo summary, results;
     
    334347  int i;
    335348
    336   int Nsecfilt = GetPhotcodeNsecfilt ();
     349  if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); }
    337350
    338351  SetMrelInfo summary, results;
     
    424437  ThreadInfo *threadinfo = data;
    425438
    426   int Nsecfilt = GetPhotcodeNsecfilt ();
     439  if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); }
    427440
    428441  SetMrelInfo results;
     
    451464  off_t k;
    452465
    453   int Nsecfilt = GetPhotcodeNsecfilt ();
     466  if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); }
    454467
    455468  off_t m = average[0].measureOffset;
     
    559572  off_t j;
    560573
    561   int Nsecfilt = GetPhotcodeNsecfilt ();
     574  if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); }
    562575
    563576  for (i = 0; i < Ncatalog; i++) {
     
    601614  ALLOCATE (slist, double, Ntot);
    602615
    603   int Nsecfilt = GetPhotcodeNsecfilt ();
     616  if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); }
    604617
    605618  // eliminate bad stars using the stats for a single secfilt at a time
     
    666679  // N1 = N2 = N3 = N4 = N0 = 0;
    667680
    668   int Nsecfilt = GetPhotcodeNsecfilt ();
     681  if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); }
    669682
    670683  Ntot = 0;
     
    719732  StatType stats;
    720733
    721   int Nsecfilt = GetPhotcodeNsecfilt ();
     734  if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); }
    722735
    723736  Ntot = 0;
     
    760773  StatType stats;
    761774
    762   int Nsecfilt = GetPhotcodeNsecfilt ();
     775  if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); }
    763776
    764777  Ntot = 0;
     
    805818  ALLOCATE (Mlist, double, NBIN);
    806819
    807   int Nsecfilt = GetPhotcodeNsecfilt ();
     820  if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); }
    808821
    809822  int Ns;
     
    840853  Graphdata graphdata;
    841854
    842   int Nsecfilt = GetPhotcodeNsecfilt ();
     855  if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); }
    843856
    844857  Ntotal = 0;
     
    911924  return;
    912925
    913   int Nsecfilt = GetPhotcodeNsecfilt ();
     926  if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); }
    914927
    915928  FILE *fout = NULL;
  • trunk/Ohana/src/relphot/src/args.c

    r42389 r42821  
    237237  }
    238238
     239  USE_REF_EQUIV = FALSE;
     240  if ((N = get_argument (argc, argv, "-use-ref-equiv"))) {
     241    remove_argument (N, &argc, argv);
     242    USE_REF_EQUIV = TRUE;
     243  }
    239244  PRESERVE_PS1 = FALSE;
    240245  if ((N = get_argument (argc, argv, "-preserve-ps1"))) {
     
    521526    remove_argument (N, &argc, argv);
    522527    USE_REFERENCE_WEIGHT = TRUE;
     528  }
     529
     530  /* Normally, stacks and warps are treated differently from chips.  In this case,
     531     WHAT IS DIFFERENT?
     532   */
     533
     534  CALIBRATE_WARPS_LIKE_CHIPS = FALSE;
     535  if ((N = get_argument (argc, argv, "-calibrate-warps-like-chips"))) {
     536    remove_argument (N, &argc, argv);
     537    CALIBRATE_WARPS_LIKE_CHIPS = TRUE;
     538  }
     539  CALIBRATE_STACKS_LIKE_CHIPS = FALSE;
     540  if ((N = get_argument (argc, argv, "-calibrate-stacks-like-chips"))) {
     541    remove_argument (N, &argc, argv);
     542    CALIBRATE_STACKS_LIKE_CHIPS = TRUE;
    523543  }
    524544
     
    836856  }
    837857
     858  USE_REF_EQUIV = FALSE;
     859  if ((N = get_argument (argc, argv, "-use-ref-equiv"))) {
     860    remove_argument (N, &argc, argv);
     861    USE_REF_EQUIV = TRUE;
     862  }
    838863  PRESERVE_PS1 = FALSE;
    839864  if ((N = get_argument (argc, argv, "-preserve-ps1"))) {
     
    9781003  }
    9791004
     1005  CALIBRATE_WARPS_LIKE_CHIPS = FALSE;
     1006  if ((N = get_argument (argc, argv, "-calibrate-warps-like-chips"))) {
     1007    remove_argument (N, &argc, argv);
     1008    CALIBRATE_WARPS_LIKE_CHIPS = TRUE;
     1009  }
     1010  CALIBRATE_STACKS_LIKE_CHIPS = FALSE;
     1011  if ((N = get_argument (argc, argv, "-calibrate-stacks-like-chips"))) {
     1012    remove_argument (N, &argc, argv);
     1013    CALIBRATE_STACKS_LIKE_CHIPS = TRUE;
     1014  }
     1015
    9801016  STAGES = STAGE_CHIP | STAGE_WARP | STAGE_STACK;
    9811017  if ((N = get_argument (argc, argv, "-skip-chip"))) {
  • trunk/Ohana/src/relphot/src/bcatalog.c

    r42389 r42821  
    11# include "relphot.h"
     2
     3# define BAD_COUNT(FIELD) \
     4  badCount.FIELD ++; \
     5  if (doTest1 && (catalog[0].measure[offset].imageID == TEST_IMAGE1)) { badTest1.FIELD ++; } \
     6  if (doTest2 && (catalog[0].measure[offset].imageID == TEST_IMAGE2)) { badTest2.FIELD ++; }
     7
     8typedef struct {
     9  int Ncode;
     10  int Ntime;
     11  int Ndophot;
     12  int Nmag;
     13  int Nsigma;
     14  int Nimag;
     15  int Nfew;
     16  int Ngalaxy;
     17  int Npsfqf;
     18  int Nnan;
     19  int Nbad;
     20  int Npoor;
     21} MyBadCountType;
    222
    323int LimitDensityCatalog_ByNmeasure (Catalog *subcatalog, Catalog *oldcatalog);
     
    929  off_t NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm;
    1030  float mag;
    11   int Ncode, Ntime, Ndophot, Nmag, Nsigma, Nimag, Nfew, Ngalaxy, Npsfqf, Nnan, Nbad, Npoor;
     31
     32  // int Ncode, Ntime, Ndophot, Nmag, Nsigma, Nimag, Nfew, Ngalaxy, Npsfqf, Nnan, Nbad, Npoor;
    1233
    1334  int Nsecfilt = GetPhotcodeNsecfilt ();
     
    2647  int NmMin = catalog[0].Nmeasure;
    2748
    28   Ncode = Ntime = Ndophot = Nmag = Nsigma = Nimag = Nfew = Npsfqf = Ngalaxy = Nnan = Nbad = Npoor = 0;
     49  MyBadCountType badCount = {0,0,0, 0,0,0, 0,0,0, 0,0,0};
     50  MyBadCountType badTest1 = {0,0,0, 0,0,0, 0,0,0, 0,0,0};
     51  MyBadCountType badTest2 = {0,0,0, 0,0,0, 0,0,0, 0,0,0};
     52
     53  int doTest1 = (TEST_IMAGE1 >= 0);
     54  int doTest2 = (TEST_IMAGE2 >= 0);
     55
     56  FILE *ftest1 = (doTest1) ? fopen ("test1.meas.dat", "a") : NULL;
     57  FILE *ftest2 = (doTest2) ? fopen ("test2.meas.dat", "a") : NULL;
     58
     59  // Ncode = Ntime = Ndophot = Nmag = Nsigma = Nimag = Nfew = Npsfqf = Ngalaxy = Nnan = Nbad = Npoor = 0;
    2960
    3061  // copy the following fields to the subcatalog:
     
    5788
    5889      offset = catalog[0].average[i].measureOffset + j;
     90
     91      if (doTest1) {
     92        Measure *m = &catalog[0].measure[offset];
     93        if (m->imageID == TEST_IMAGE1) {
     94          fprintf (ftest1, "%5d %5d %5d | %5d %12d %5.3f %5.3f %5.3f %5.3f %4.3f %4.3f 0x%08x\n", m->detID, m->objID, m->catID, m->photcode, m->t, m->M, m->Map, m->Mkron, m->dM, m->psfQF, m->psfQFperf, m->photFlags);
     95        }
     96      }
     97      if (doTest2) {
     98        Measure *m = &catalog[0].measure[offset];
     99        if (m->imageID == TEST_IMAGE2) {
     100          fprintf (ftest2, "%5d %5d %5d | %5d %12d %5.3f %5.3f %5.3f %5.3f %4.3f %4.3f 0x%08x\n", m->detID, m->objID, m->catID, m->photcode, m->t, m->M, m->Map, m->Mkron, m->dM, m->psfQF, m->psfQFperf, m->photFlags);
     101        }
     102      }
    59103
    60104      /* select measurements by photcode */
     
    69113      }
    70114      if (!found) {
    71         Ncode ++;
     115        BAD_COUNT(Ncode);
    72116        continue;
    73117      }
     
    75119      /* select measurements by time */
    76120      if (TimeSelect) {
    77         if (catalog[0].measure[offset].t < TSTART) { Ntime ++; continue; }
    78         if (catalog[0].measure[offset].t > TSTOP)  { Ntime ++; continue; }
     121        if (catalog[0].measure[offset].t < TSTART) { BAD_COUNT(Ntime); continue; }
     122        if (catalog[0].measure[offset].t > TSTOP)  { BAD_COUNT(Ntime); continue; }
    79123      }
    80124
    81125      /* select measurements by quality */
    82       if (DophotSelect && ((catalog[0].measure[offset].photFlags >> 16) != DophotValue)) { Ndophot ++; continue; }
     126      if (DophotSelect && ((catalog[0].measure[offset].photFlags >> 16) != DophotValue)) { BAD_COUNT(Ndophot); continue; }
    83127
    84128      float Maper = USE_APER_FOR_STARGAL ? catalog[0].measure[offset].Map : catalog[0].measure[offset].Mkron;
    85129
    86130      // skip garbage measurements
    87       if (isnan(catalog[0].measure[offset].psfQF)     || (catalog[0].measure[offset].psfQF < 0.95))     { Npsfqf ++; continue; }
    88       if (isnan(catalog[0].measure[offset].psfQFperf) || (catalog[0].measure[offset].psfQFperf < 0.95)) { Npsfqf ++; continue; }
    89       if (isnan(catalog[0].measure[offset].M)) { Nnan ++; continue; }
    90       if (isnan(Maper)) { Nnan ++; continue; }
     131      if (isnan(catalog[0].measure[offset].psfQF)     || (catalog[0].measure[offset].psfQF     < PSF_QF_MIN)) { BAD_COUNT(Npsfqf); continue; }
     132      if (isnan(catalog[0].measure[offset].psfQFperf) || (catalog[0].measure[offset].psfQFperf < PSF_QF_MIN)) { BAD_COUNT(Npsfqf); continue; }
     133      if (isnan(catalog[0].measure[offset].M)) { BAD_COUNT(Nnan); continue; }
     134      if (isnan(Maper)) { BAD_COUNT(Nnan); continue; }
    91135
    92136      // require 0x01 in photFlags (fitted with a PSF) -- add to the test data
    93       if (REQUIRE_PSFFIT && (catalog[0].measure[offset].photFlags & 0x01) == 0) { Nbad ++; continue; }
     137      if (REQUIRE_PSFFIT && (catalog[0].measure[offset].photFlags & 0x01) == 0) { BAD_COUNT(Nbad); continue; }
    94138
    95139      // very loose cut on PSF - APER mag (Map or Mkron) -- this lightly rejects galaxies & other oddities
    96140      float Mkp = catalog[0].measure[offset].M - Maper;
    97       if (fabs(Mkp) > 1.0) { Nbad ++; continue; }
     141      if (fabs(Mkp) > 1.0) { BAD_COUNT(Nbad); continue; }
    98142
    99143      if (catalog[0].measure[offset].photFlags & code->photomBadMask) {
    100         Nbad++;
     144        BAD_COUNT(Nbad);
    101145        continue;
    102146      }
    103       if (catalog[0].measure[offset].photFlags & code->photomPoorMask) { Npoor++; continue;}
     147      if (catalog[0].measure[offset].photFlags & code->photomPoorMask) { BAD_COUNT(Npoor); continue;}
    104148
    105149      // weak test for galaxies
    106       if (Mkp > 0.5) {
     150      if (Mkp > STAR_MAX_PSF_KRON) {
    107151        nEXT ++;
    108152      } else {
     
    112156      /* select measurements by mag limit */
    113157      mag = PhotCat (&catalog[0].measure[offset], MAG_CLASS_PSF);
    114       if (mag > MAG_LIM) { Nmag ++; continue; }
     158      if (mag > MAG_LIM) { BAD_COUNT(Nmag); continue; }
     159      if (mag < MAG_MIN) { BAD_COUNT(Nmag); continue; }
     160      // note that these two cuts are applied to all photcodes. these are also applied to
     161      // the nominal apparent mags : if the expected sensitivity is very different between
     162      // different filters, or if exposure times have a large range, these cuts may not be
     163      // effective (or may exclude too much).
    115164
    116165      /* select measurements by measurement error */
    117       if ((SIGMA_LIM > 0) && (catalog[0].measure[offset].dM > SIGMA_LIM)) { Nsigma ++; continue; }
     166      if ((SIGMA_LIM > 0) && (catalog[0].measure[offset].dM > SIGMA_LIM)) { BAD_COUNT(Nsigma); continue; }
    118167
    119168      /* select measurements by mag limit */
    120169      if (ImagSelect) {
    121170        mag = PhotInst (&catalog[0].measure[offset], MAG_CLASS_PSF);
    122         if (mag < ImagMin) { Nimag ++; continue; }
    123         if (mag > ImagMax) { Nimag ++; continue; }
    124       }
     171        if (mag < ImagMin) { BAD_COUNT(Nimag); continue; }
     172        if (mag > ImagMax) { BAD_COUNT(Nimag); continue; }
     173      }
     174      // note that instrumental mag cuts are reasonable for individual exposures using the same
     175      // detector, but are probably not appropriate for stacks with a large range of the number
     176      // of inputs. 
    125177
    126178      // count this measurement as valid for this secfilt entry
     
    147199    if (nEXT >= nPSF) {
    148200      Nmeasure -= Nm;
    149       Ngalaxy ++;
     201      badCount.Ngalaxy++;
    150202      continue;
    151203    }
     
    157209    if (Nm <= STAR_TOOFEW) { /* enough measurements total? */
    158210      Nmeasure -= Nm;
    159       Nfew ++;
     211      badCount.Nfew++;
    160212      continue;
    161213    }
     
    167219    if (!anySecfiltGood) {
    168220      Nmeasure -= Nm;
    169       Nfew ++;
     221      badCount.Nfew++;
    170222      continue;
    171223    }
     
    204256             subcatalog[0].Naverage,  subcatalog[0].Nmeasure,  catalog[0].Naverage, catalog[0].Nmeasure, catalog[0].filename, NmMin, NmMax);
    205257    fprintf (stderr, "rejections: %d stars have too few measures:\n   %d code, %d time, %d dophot, %d mag, %d sigma, %d imag, %d psfqf, %d Nnan, %d galaxies, %d bad, %d poor\n",
    206              Nfew, Ncode, Ntime, Ndophot, Nmag, Nsigma, Nimag, Npsfqf, Nnan, Ngalaxy, Nbad, Npoor);
     258             badCount.Nfew, badCount.Ncode, badCount.Ntime, badCount.Ndophot, badCount.Nmag, badCount.Nsigma, badCount.Nimag, badCount.Npsfqf, badCount.Nnan, badCount.Ngalaxy, badCount.Nbad, badCount.Npoor);
     259  }
     260
     261  if (doTest1) {
     262    fprintf (stderr, "TEST1 rejections: %d stars have too few measures: %d code, %d time, %d dophot, %d mag, %d sigma, %d imag, %d psfqf, %d Nnan, %d galaxies, %d bad, %d poor\n",
     263             badTest1.Nfew, badTest1.Ncode, badTest1.Ntime, badTest1.Ndophot, badTest1.Nmag, badTest1.Nsigma, badTest1.Nimag, badTest1.Npsfqf, badTest1.Nnan, badTest1.Ngalaxy, badTest1.Nbad, badTest1.Npoor);
     264  }
     265  if (doTest2) {
     266    fprintf (stderr, "TEST2 rejections: %d stars have too few measures: %d code, %d time, %d dophot, %d mag, %d sigma, %d imag, %d psfqf, %d Nnan, %d galaxies, %d bad, %d poor\n",
     267             badTest2.Nfew, badTest2.Ncode, badTest2.Ntime, badTest2.Ndophot, badTest2.Nmag, badTest2.Nsigma, badTest2.Nimag, badTest2.Npsfqf, badTest2.Nnan, badTest2.Ngalaxy, badTest2.Nbad, badTest2.Npoor);
    207268  }
    208269
     
    212273  }
    213274
    214   free (Nvalid)
     275  free (Nvalid);
     276
     277  if (ftest1) { fclose (ftest1); }
     278  if (ftest2) { fclose (ftest2); }
    215279
    216280  return (TRUE);
  • trunk/Ohana/src/relphot/src/extra.c

    r41647 r42821  
    7070}
    7171
    72 // for now (20140710) I need to identify gpc1 stacks explicitly.  generalize in the future
     72// for now (20140710) I need to identify gpc1 & gpc2 stacks explicitly.  generalize in the future
    7373int isGPC1stack (int photcode) {
    7474
    75   if ((photcode == 11000) || (photcode == 14100)) return TRUE; // g-band
    76   if ((photcode == 11100) || (photcode == 14200)) return TRUE; // r-band
    77   if ((photcode == 11200) || (photcode == 14300)) return TRUE; // i-band
    78   if ((photcode == 11300) || (photcode == 14400)) return TRUE; // z-band
    79   if ((photcode == 11400) || (photcode == 14500)) return TRUE; // y-band
    80   if ((photcode == 11500) || (photcode == 14600)) return TRUE; // w-band
     75  // 11000 : GPC1.g.SkyChip
     76  // 11001 : VARIOUS.g.SkyChip (output of xcamera stacks)
     77  // 14100 : SIMTEST.g.SkyChip
     78  // 31000 : GPC2.g.SkyChip
     79 
     80  if (CALIBRATE_STACKS_LIKE_CHIPS) return FALSE;
     81
     82  if ((photcode == 11000) || (photcode == 11001) || (photcode == 14100) || (photcode == 31000)) return TRUE; // g-band
     83  if ((photcode == 11100) || (photcode == 11101) || (photcode == 14200) || (photcode == 31100)) return TRUE; // r-band
     84  if ((photcode == 11200) || (photcode == 11201) || (photcode == 14300) || (photcode == 31200)) return TRUE; // i-band
     85  if ((photcode == 11300) || (photcode == 11301) || (photcode == 14400) || (photcode == 31300)) return TRUE; // z-band
     86  if ((photcode == 11400) || (photcode == 11401) || (photcode == 14500) || (photcode == 31400)) return TRUE; // y-band
     87  if ((photcode == 11500) || (photcode == 11501) || (photcode == 14600) || (photcode == 31500)) return TRUE; // w-band
    8188
    8289  return FALSE;
     
    8592// for now (20140710) I need to identify gpc1 stacks explicitly.  generalize in the future
    8693int isGPC1warp (int photcode) {
     94
     95  if (CALIBRATE_WARPS_LIKE_CHIPS) return FALSE;
     96
     97  // 11000 : GPC1.g.SkyChip
     98  // 14100 : SIMTEST.g.SkyChip
     99
     100  // 12000 : GPC1.g.ForcedWarp
     101  // 15100 : SIMTEST.g.ForcedWarp
     102  // 32000 : GPC2.g.ForcedWarp
    87103
    88104  // diff warps get stack-like photcodes (kind of lame)
     
    97113  }
    98114
    99   if ((photcode == 12000) || (photcode == 15100)) return TRUE; // g-band
    100   if ((photcode == 12100) || (photcode == 15200)) return TRUE; // r-band
    101   if ((photcode == 12200) || (photcode == 15300)) return TRUE; // i-band
    102   if ((photcode == 12300) || (photcode == 15400)) return TRUE; // z-band
    103   if ((photcode == 12400) || (photcode == 15500)) return TRUE; // y-band
    104   if ((photcode == 12500) || (photcode == 15600)) return TRUE; // w-band
     115  if ((photcode == 12000) || (photcode == 15100) || (photcode == 32000)) return TRUE; // g-band
     116  if ((photcode == 12100) || (photcode == 15200) || (photcode == 32100)) return TRUE; // r-band
     117  if ((photcode == 12200) || (photcode == 15300) || (photcode == 32200)) return TRUE; // i-band
     118  if ((photcode == 12300) || (photcode == 15400) || (photcode == 32300)) return TRUE; // z-band
     119  if ((photcode == 12400) || (photcode == 15500) || (photcode == 32400)) return TRUE; // y-band
     120  if ((photcode == 12500) || (photcode == 15600) || (photcode == 32500)) return TRUE; // w-band
    105121
    106122  return FALSE;
  • trunk/Ohana/src/relphot/src/fit1d_irls.c

    r41557 r42821  
    374374  StatType stats;
    375375  liststats_setmode (&stats, "MEDIAN");
    376   liststats (dataset->alldata->yVector, NULL, NULL, Nvalues, &stats);
     376  liststats (dataset->alldata->yVector, dataset->alldata->dyVector, NULL, Nvalues, &stats);
     377  // liststats sorts yVector and dyVector together
    377378
    378379  double altSigma = (stats.Upper80 - stats.Lower20) / 1.6;  // 20% to 80% encompasses 60% of the values, corresponds to the range (-0.85 sigma : +0.85 sigma)
     
    380381  // soften the individual errors with 10% of the scatter above
    381382  for (int j = 0; j < Nvalues; j++) {
    382     double newSigma = hypot(dataset->alldata->dyVector[j], 0.1*altSigma);
     383    double newSigma = hypot(dataset->alldata->dyVector[j], 0.5*altSigma);
    383384    dataset->alldata->dyVector[j] = newSigma;
    384385  }
  • trunk/Ohana/src/relphot/src/initialize.c

    r42134 r42821  
    5050      fprintf (stderr, "DophotSelect: FALSE\n");
    5151    }
    52     fprintf (stderr, "PSF_QF limit: 0.85 (hardwired)\n");
     52    fprintf (stderr, "PSF_QF limit: %f\n", PSF_QF_MIN);
    5353
    5454    // fprintf (stderr, "Photom Bad Mask: 0x%08x, Photom Poor Mask: 0x%08x\n");
    5555
    56     fprintf (stderr, "MAG_LIM: %f, SIGMA_LIM: %f\n", MAG_LIM, SIGMA_LIM);
     56    fprintf (stderr, "MAG_MIN: %f, MAG_LIM: %f, SIGMA_LIM: %f\n", MAG_MIN, MAG_LIM, SIGMA_LIM);
    5757    fprintf (stderr, "INST_MAG_MIN: %f, INST_MAG_MAX: %f\n", ImagMin, ImagMax);
    5858
     59    fprintf (stderr, "STAR_MAX_PSF_KRON: %f\n", STAR_MAX_PSF_KRON);
    5960    fprintf (stderr, "STAR_TOOFEW: %d\n", STAR_TOOFEW);
    6061
  • trunk/Ohana/src/relphot/src/load_catalogs.c

    r41647 r42821  
    151151    // TimeSelect -time
    152152    // DophotSelect
    153     // (note that psfQF is applied rigidly at 0.85, as is the galaxy test)
     153    // PSF_QF_MIN
     154    // STAR_MAX_PSF_KRON
     155    // MAG_MIN
    154156    // MAG_LIM
    155157    // SIGMA_LIM
     
    158160
    159161    char *command = NULL;
    160     strextend (&command, "relphot_client %s -load %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -D CAMERA %s -D MAG_LIM %f -D SIGMA_LIM %f",
    161               PhotcodeList, table->hosts[i].results, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, CAMERA, MAG_LIM, SIGMA_LIM);
     162    strextend (&command, "relphot_client %s -load %s -hostID %d -D CATDIR %s -hostdir %s", PhotcodeList, table->hosts[i].results, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname);
     163    strextend (&command, "-region %f %f %f %f -D CAMERA %s", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, CAMERA);
     164    strextend (&command, "-D MAG_MIN %f -D MAG_LIM %f -D SIGMA_LIM %f", MAG_MIN, MAG_LIM, SIGMA_LIM);
     165    strextend (&command, "-D STAR_MAX_PSF_KRON %f -D PSF_QF_MIN %f", STAR_MAX_PSF_KRON, PSF_QF_MIN);
    162166
    163167    if (VERBOSE)             { strextend (&command, "-v"); }
  • trunk/Ohana/src/relphot/src/reload_catalogs.c

    r42112 r42821  
    251251    if (!(STAGES & STAGE_WARP))  { strextend (&command, "-skip-warp"); }
    252252    if (!(STAGES & STAGE_STACK)) { strextend (&command, "-skip-stack"); }
     253    if (CALIBRATE_WARPS_LIKE_CHIPS) { strextend (&command, "-calibrate-warps-like-chips"); }
     254    if (CALIBRATE_STACKS_LIKE_CHIPS) { strextend (&command, "-calibrate-stacks-like-chips"); }
    253255
    254256    // deprecate
  • trunk/Ohana/src/relphot/src/relphot.c

    r42483 r42821  
    3333 
    3434  switch (mode) {
    35     case UPDATE_IMAGES:
     35    case UPDATE_IMAGES: // -images
    3636      // calculate zero points for images (may group by exposure [mosaic], night [tgroups]; may measure flat-correction)
    37       // IF CALLED WITH NLOOP == 0, DOES NOT LOAD bcatalog, just loads image table and generates ImageSubset.dat
     37      // IF CALLED WITH NLOOP == 0 (and NOT -only-stacks-and-warps), this step DOES NOT LOAD bcatalog.  Instead it just loads
     38      // the image table and applies the Mcal values to the measurements.  In parallel context, it generates ImageSubset.dat.
    3839      // If called with -update, calls reload_catalogs() just like apply_offsets, UNLESS -only-stacks-and-warps is selected
    3940      relphot_images (skylist);
Note: See TracChangeset for help on using the changeset viewer.