IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42477


Ignore:
Timestamp:
Jul 21, 2023, 10:45:50 AM (3 years ago)
Author:
eugene
Message:

add functions to load fullforce photometry generated with partial lensing info

Location:
trunk/Ohana/src
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/ReadStarsFITS.c

    r39457 r42477  
    1313Catalog *Convert_PS1_V4            PROTO((FTable *table));
    1414Catalog *Convert_PS1_V5            PROTO((FTable *table));
     15Catalog *Convert_PS1_V5_R0         PROTO((FTable *table));
    1516Catalog *Convert_PS1_V5_R0_Lensing PROTO((FTable *table));
    1617Catalog *Convert_PS1_V5_R1_Lensing PROTO((FTable *table));
     
    99100      case 232:
    100101        catalog = Convert_PS1_V5 (&table);
     102        break;
     103      case 288:
     104        catalog = Convert_PS1_V5_R0 (&table);
    101105        break;
    102106      case 312:
     
    859863}
    860864
     865// alternate version of PS1_V5 (UNIONS TEST?)
     866Catalog *Convert_PS1_V5_R0 (FTable *table) {
     867
     868  off_t Nstars;
     869  unsigned int i;
     870  double ZeroPt;
     871  CMF_PS1_V5_R0 *ps1data;
     872
     873  ps1data = gfits_table_get_CMF_PS1_V5_R0 (table, &Nstars, NULL);
     874  if (!ps1data) {
     875    fprintf (stderr, "skipping inconsistent entry\n");
     876    return (NULL);
     877  }
     878  ZeroPt = GetZeroPoint();
     879
     880  Catalog *catalog = addstar_catalog_init (Nstars);
     881
     882  for (i = 0; i < Nstars; i++) {
     883    catalog->measure[i].Xccd       = ps1data[i].X;
     884    catalog->measure[i].Yccd       = ps1data[i].Y;
     885    catalog->measure[i].dXccd      = ToShortPixels(ps1data[i].dX);
     886    catalog->measure[i].dYccd      = ToShortPixels(ps1data[i].dY);
     887
     888    catalog->measure[i].posangle   = ToShortDegrees(ps1data[i].posangle);
     889    catalog->measure[i].pltscale   = ps1data[i].pltscale;
     890
     891    if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) {
     892      catalog->measure[i].M      = NAN;
     893    } else {
     894      catalog->measure[i].M      = ps1data[i].M + ZeroPt;
     895    }
     896    catalog->measure[i].dM         = ps1data[i].dM;
     897    catalog->measure[i].dMcal      = ps1data[i].dMcal;
     898    catalog->measure[i].Map        = ps1data[i].Map + ZeroPt;
     899    catalog->measure[i].dMap       = (ps1data[i].apFlux > 0.0) ? fabs(ps1data[i].apFluxErr / ps1data[i].apFlux) : NAN;
     900                       
     901    catalog->measure[i].Mkron      = (ps1data[i].kronFlux > 0.0) ? -2.5*log10(ps1data[i].kronFlux) + ZeroPt : NAN;
     902    catalog->measure[i].dMkron     = (ps1data[i].kronFlux > 0.0) ? ps1data[i].kronFluxErr / ps1data[i].kronFlux : NAN;
     903                       
     904    // these fluxes are converted from counts to counts/sec in FilterStars.c
     905    catalog->measure[i].FluxPSF    = GetFluxFromFluxOrMag (ps1data[i].Flux, ps1data[i].M);
     906    catalog->measure[i].dFluxPSF   = GetFluxErrFromFluxOrMag (ps1data[i].dFlux, catalog->measure[i].FluxPSF, ps1data[i].dM);
     907    catalog->measure[i].FluxKron   = ps1data[i].kronFlux;
     908    catalog->measure[i].dFluxKron  = ps1data[i].kronFluxErr;
     909    catalog->measure[i].FluxAp     = GetFluxFromFluxOrMag (ps1data[i].apFlux, ps1data[i].Map);
     910    catalog->measure[i].dFluxAp    = GetFluxErrFromFluxOrMag (ps1data[i].apFluxErr, catalog->measure[i].FluxAp, catalog->measure[i].dMap);
     911
     912    catalog->measure[i].Sky        = ps1data[i].sky;
     913    catalog->measure[i].dSky       = ps1data[i].dSky;
     914                       
     915    catalog->measure[i].psfChisq   = ps1data[i].psfChisq;
     916    catalog->measure[i].psfQF      = ps1data[i].psfQF;
     917    catalog->measure[i].psfQFperf  = ps1data[i].psfQFperf;
     918
     919    catalog->measure[i].psfNdof    = ps1data[i].psfNdof;
     920    catalog->measure[i].psfNpix    = ps1data[i].psfNpix;
     921    catalog->measure[i].extNsigma  = ps1data[i].extNsigma;
     922
     923    catalog->measure[i].FWx        = ToShortPixels(ps1data[i].fx);
     924    catalog->measure[i].FWy        = ToShortPixels(ps1data[i].fy);
     925    catalog->measure[i].theta      = ToShortDegrees(ps1data[i].df);
     926
     927    catalog->measure[i].Mxx        = ToShortPixels(ps1data[i].Mxx);
     928    catalog->measure[i].Mxy        = ToShortPixels(ps1data[i].Mxy);
     929    catalog->measure[i].Myy        = ToShortPixels(ps1data[i].Myy);
     930                       
     931    catalog->measure[i].photFlags  = ps1data[i].flags;
     932    catalog->measure[i].photFlags2 = ps1data[i].flags2;
     933
     934    // this is may optionally be replaced by the internal sequence (see FilterStars.c)
     935    catalog->measure[i].detID      = ps1data[i].detID;
     936
     937    // the Average fields and the following Measure fields are set in FilterStars after
     938    // the image metadata is in hand:  dR, dD, Mcal, dt, airmass, az, t, imageID, extID.
     939
     940    // averef is set in find_matches
     941
     942    // dbFlags is zero on ingest.
     943
     944    // the following fields are currently not being set anywhere: t_msec
     945  }   
     946  return catalog;
     947}
     948
    861949Catalog *Convert_PS1_V5_R0_Lensing (FTable *table) {
    862950
  • trunk/Ohana/src/libdvo/Makefile

    r41491 r42477  
    5656$(DESTINC)/cmf-ps1-dv3.h \
    5757$(DESTINC)/cmf-ps1-v5.h \
     58$(DESTINC)/cmf-ps1-v5-r0.h \
    5859$(DESTINC)/cmf-ps1-sv3.h \
    5960$(DESTINC)/cmf-ps1-sv4.h \
     
    120121$(SRC)/cmf-ps1-sv4.$(ARCH).o \
    121122$(SRC)/cmf-ps1-v5.$(ARCH).o \
     123$(SRC)/cmf-ps1-v5-r0.$(ARCH).o \
    122124$(SRC)/cmf-ps1-v5-r0-lensing.$(ARCH).o \
    123125$(SRC)/cmf-ps1-v5-r1-lensing.$(ARCH).o \
  • trunk/Ohana/src/libdvo/include/dvo.h

    r42102 r42477  
    403403# include "cmf-ps1-sv4.h"
    404404# include "cmf-ps1-v5.h"
     405# include "cmf-ps1-v5-r0.h"
    405406# include "cmf-ps1-v5-r0-lensing.h"
    406407# include "cmf-ps1-v5-r1-lensing.h"
Note: See TracChangeset for help on using the changeset viewer.