IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38547


Ignore:
Timestamp:
Jun 25, 2015, 4:28:13 PM (11 years ago)
Author:
eugene
Message:

fix the flags (two possible output modes with OBJ lensing parameters at the end or the middle); GAL_FLUX_ERR is missing a sqrt() in the cmf

Location:
branches/eam_branches/ipp-20150616/Ohana/src/addstar/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150616/Ohana/src/addstar/src/ReadStarsFITS.c

    r38540 r38547  
    874874  Catalog *catalog = addstar_catalog_init (Nstars);
    875875  ALLOCATE (catalog->lensing, Lensing, Nstars);
     876  catalog->Nlensing = Nstars;
    876877
    877878  for (i = 0; i < Nstars; i++) {
     
    997998  Catalog *catalog = addstar_catalog_init (Nstars);
    998999  ALLOCATE (catalog->lensing, Lensing, Nstars);
     1000  catalog->Nlensing = Nstars;
    9991001
    10001002  for (i = 0; i < Nstars; i++) {
     
    11111113  CMF_PS1_V5_R2_Lensing *ps1data;
    11121114
    1113   ps1data = gfits_table_get_CMF_PS1_V5_R2_Lensing (table, &Nstars, NULL);
     1115  // this code expects the output cmf files to have a fixed column order
     1116  // unfortunatly, psphot is not consistent for the obj lensing values:
     1117  // if the first object in the list is not a valid object for the lensing measurement, then
     1118  // the lensingOBJ structure is not allocated for that source and the corresponding rows
     1119  // are not added to the output metadata until an object which does include the
     1120  // measurement.
     1121
     1122  char field[128];
     1123  gfits_scan (table->header, "TTYPE45", "%s", 1, field);
     1124
     1125  int mode = 0;
     1126  if (!strcmp (field, "LENS_X11_SM_OBJ")) { mode = 1; }
     1127  if (!strcmp (field, "LENS_X11_SM_PSF")) { mode = 2; }
     1128  myAssert (mode, "invalid table layout\n");
     1129
     1130  if (mode == 1) {
     1131    ps1data = gfits_table_get_CMF_PS1_V5_R2_Lensing (table, &Nstars, NULL);
     1132    fprintf (stderr, "PS1_V5_R2_Lensing mode 1\n");
     1133  }
     1134  if (mode == 2) {
     1135    ps1data = gfits_table_get_CMF_PS1_V5_R2x_Lensing (table, &Nstars, NULL);
     1136    fprintf (stderr, "PS1_V5_R2_Lensing mode 2\n");
     1137  }
     1138
    11141139  if (!ps1data) {
    11151140    fprintf (stderr, "skipping inconsistent entry\n");
     
    11201145  Catalog *catalog = addstar_catalog_init (Nstars);
    11211146  ALLOCATE (catalog->lensing, Lensing, Nstars);
     1147  catalog->Nlensing = Nstars;
    11221148
    11231149  for (i = 0; i < Nstars; i++) {
  • branches/eam_branches/ipp-20150616/Ohana/src/addstar/src/loadgalphot_readstars.c

    r38539 r38547  
    375375  // use bilinear interpolation to choose Flux @ (Xmin,Ymin)?
    376376  galphot->mag    = -2.5*log10(flux[iMin]); // correct for exptime?
    377   galphot->magErr = fluxErr[iMin] / flux[iMin];
     377  galphot->magErr = sqrt(fluxErr[iMin]) / flux[iMin];
    378378  galphot->chisq  = chisqMin;
    379379 
Note: See TracChangeset for help on using the changeset viewer.