IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38140


Ignore:
Timestamp:
Apr 17, 2015, 11:00:42 AM (11 years ago)
Author:
eugene
Message:

update rules for setting R5,R6,R7 calibrated fluxes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150405/Ohana/src/dvolens/src/update_objects_catalog.c

    r38136 r38140  
    5151      if (!isfinite(lensing->X11_sm_obj)) continue;
    5252
     53      // pointer from lensing entry to corresponding measure entry (keep updated?)
     54      int Mseq = lensing->measureSeq;
     55      myAssert (Mseq < average->Nmeasure, "oops");
     56
     57      Measure *measure = &catalog->measure[Moff + Mseq];
     58      myAssert (measure->imageID == lensing->imageID, "oops, deux");
     59
     60# if (0)     
    5361      Measure *measure = NULL;
    5462      int found = FALSE;
     
    6472        abort();
    6573      }
     74# endif
    6675     
    6776      // skip measurements that do not match the current photcode
     
    7786      if (measure->psfQFperf < 0.85) continue;
    7887     
     88      // I should probably only use lensing entries which correspond to warps
     89      // included in the mean warp flux (setMrelCatalog.c)
     90      if (measure->dbFlags & ID_MEAS_WARP_USED == 0) continue;
     91
    7992      Mxx_obj[Nsec] += measure->Mxx;
    8093      Mxy_obj[Nsec] += measure->Mxy;
     
    105118      lensobj[Nsec]. E2_sh_psf += lensing-> E2_sh_psf;
    106119
    107       lensobj[Nsec]. F_ApR5 += lensing-> F_ApR5;
    108       lensobj[Nsec].dF_ApR5 += SQ(lensing->dF_ApR5);
    109       lensobj[Nsec].sF_ApR5 += SQ(lensing->sF_ApR5);
    110       lensobj[Nsec].fF_ApR5 += lensing->fF_ApR5;
    111 
    112       lensobj[Nsec]. F_ApR6 += lensing-> F_ApR6;
    113       lensobj[Nsec].dF_ApR6 += SQ(lensing->dF_ApR6);
    114       lensobj[Nsec].sF_ApR6 += SQ(lensing->sF_ApR6);
    115       lensobj[Nsec].fF_ApR6 += lensing->fF_ApR6;
    116 
    117       lensobj[Nsec]. F_ApR7 += lensing-> F_ApR7;
    118       lensobj[Nsec].dF_ApR7 += SQ(lensing->dF_ApR7);
    119       lensobj[Nsec].sF_ApR7 += SQ(lensing->sF_ApR7);
    120       lensobj[Nsec].fF_ApR7 += lensing->fF_ApR7;
     120      myAbort ("NOTE: relphot needs to set measure->Mcal -- is this happening or not??");
     121
     122      int Np = photcodes[0].hashcode[measure[0].photcode];
     123      if (Np == -1) return (NAN);
     124      PhotCode *code = &photcodes[0].code[Np];
     125     
     126      float Mdef = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C;
     127      float Moff = Mdef + 8.9 - measure->Mcal;
     128      float Foff = 3630.8 * MagToFlux(Moff);
     129
     130      // lensing->F_ApR5, etc need to be in units of DN/sec
     131      // Foff * lensing->F_ApR5 is in Jy
     132      // XXX this is unweighted -- apply a weighting?
     133
     134      lensobj[Nsec]. F_ApR5 += Foff * lensing-> F_ApR5;
     135      lensobj[Nsec].dF_ApR5 += SQ(Foff * lensing->dF_ApR5);
     136      lensobj[Nsec].sF_ApR5 += SQ(Foff * lensing->sF_ApR5);
     137      lensobj[Nsec].fF_ApR5 += Foff * lensing->fF_ApR5;
     138
     139      lensobj[Nsec]. F_ApR6 += Foff * lensing-> F_ApR6;
     140      lensobj[Nsec].dF_ApR6 += SQ(Foff * lensing->dF_ApR6);
     141      lensobj[Nsec].sF_ApR6 += SQ(Foff * lensing->sF_ApR6);
     142      lensobj[Nsec].fF_ApR6 += Foff * lensing->fF_ApR6;
     143
     144      lensobj[Nsec]. F_ApR7 += Foff * lensing-> F_ApR7;
     145      lensobj[Nsec].dF_ApR7 += SQ(Foff * lensing->dF_ApR7);
     146      lensobj[Nsec].sF_ApR7 += SQ(Foff * lensing->sF_ApR7);
     147      lensobj[Nsec].fF_ApR7 += Foff * lensing->fF_ApR7;
    121148
    122149      lensobj[Nsec].Nmeas   ++;
Note: See TracChangeset for help on using the changeset viewer.