IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 13, 2017, 10:53:48 AM (9 years ago)
Author:
eugene
Message:

merge EAM development branch changes for DR2 into trunk (add PS1_V6 dvo format; change Mcal to McalPSF, McalAPER; change opihi int vectors to 64bit)

Location:
trunk/Ohana
Files:
36 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/libdvo/Makefile

    r40063 r40291  
    5050$(DESTINC)/ps1_v4_defs.h \
    5151$(DESTINC)/ps1_v5_defs.h \
     52$(DESTINC)/ps1_v6_defs.h \
    5253$(DESTINC)/ps1_v5_ld_defs.h \
    5354$(DESTINC)/ps1_ref_defs.h \
     
    100101$(SRC)/dvo_convert_PS1_V4.$(ARCH).o \
    101102$(SRC)/dvo_convert_PS1_V5.$(ARCH).o \
     103$(SRC)/dvo_convert_PS1_V6.$(ARCH).o \
    102104$(SRC)/dvo_convert_PS1_V5_LOAD.$(ARCH).o \
    103105$(SRC)/dvo_convert_PS1_REF.$(ARCH).o \
  • trunk/Ohana/src/libdvo/doc/notes.txt

    r34749 r40291  
    1616   uppercase, eg: AveragePanstarrs_DEV_0, AveragePanstarrs_PS1_2).
    1717
    18 4) create a DVOTableFormat entry for the new format
     184) create a DVOCatFormat entry for the new format
    1919   (libdvo/include/dvo.h).  the naming convention is DVO_FORMAT_FOO.
    2020
     
    3737   make is easy to identify the new changes needed.
    3838
    39 10) add the new format to the section at the end of dvo_image.c
     3910a) if the Image structure must be changed, this is done in libdvo/include/libdvo_astro.h, not autocode
     4010b) add the new format to the section at the end of dvo_image.c
     4110c) update gfits_table_mkheader_Image in dvo_image.c to match modifications to Image (if any)
    4042
    414311) add the new format to the dvo_image_raw.c
  • trunk/Ohana/src/libdvo/include/dvo.h

    r40063 r40291  
    3333  DVO_FORMAT_PS1_V4,
    3434  DVO_FORMAT_PS1_V5,
     35  DVO_FORMAT_PS1_V6,
    3536  DVO_FORMAT_PS1_V5_LOAD,
    3637} DVOCatFormat;
     
    220221/* Secfilt.flags values -- these values are 32 bit (as of PS1_V1) */
    221222typedef enum {
    222   ID_SECF_STAR_FEW      = 0x00000001, // used within relphot: skip star
    223   ID_SECF_STAR_POOR     = 0x00000002, // used within relphot: skip star
    224   ID_SECF_USE_SYNTH     = 0x00000004, // synthetic photometry used in average measurement
    225   ID_SECF_USE_UBERCAL   = 0x00000008, // ubercal photometry used in average measurement
    226   ID_SECF_HAS_PS1       = 0x00000010, // PS1 photometry used in average measurement
    227   ID_SECF_HAS_PS1_STACK = 0x00000020, // PS1 stack photometry exists
    228   ID_SECF_HAS_TYCHO     = 0x00000040, // Tycho photometry used for synth mags
    229   ID_SECF_FIX_SYNTH     = 0x00000080, // synth mags repaired with zpt map
    230   ID_SECF_RANK_0        = 0x00000100, // average magnitude uses rank 0 values
    231   ID_SECF_RANK_1        = 0x00000200, // average magnitude uses rank 1 values
    232   ID_SECF_RANK_2        = 0x00000400, // average magnitude uses rank 2 values
    233   ID_SECF_RANK_3        = 0x00000800, // average magnitude uses rank 3 values
    234   ID_SECF_RANK_4        = 0x00001000, // average magnitude uses rank 4 values
    235   ID_SECF_OBJ_EXT_PSPS  = 0x00002000, // In PSPS ID_SECF_OBJ_EXT is moved here so it fits within 16 bits
    236   ID_SECF_STACK_PRIMARY = 0x00004000, // PS1 stack photometry comes from primary skycell
    237   ID_SECF_STACK_BESTDET = 0x00008000, // PS1 stack best measurement is a detection (not forced)
    238   ID_SECF_STACK_PRIMDET = 0x00010000, // PS1 stack primary measurement is a detection (not forced)
    239 
    240   ID_SECF_HAS_SDSS      = 0x00100000, // this photcode has SDSS photometry
    241   ID_SECF_HAS_HSC       = 0x00200000, // this photcode has HSC  photometry
    242   ID_SECF_HAS_CFH       = 0x00400000, // this photcode has CFH  photometry (mostly Megacam)
    243   ID_SECF_HAS_DES       = 0x00800000, // this photcode has DES  photometry
    244 
    245   ID_SECF_OBJ_EXT       = 0x01000000, // extended in this band
    246 
    247   ID_SECF_CHIP_FLAGS    = 0x01003f1f, // all chip-related bits (used to reset the correct bits only)
    248   ID_SECF_STACK_FLAGS   = 0x00004020, // all stack-related bits (
     223  ID_SECF_STAR_FEW               = 0x00000001, // used within relphot: skip star
     224  ID_SECF_STAR_POOR              = 0x00000002, // used within relphot: skip star
     225  ID_SECF_USE_SYNTH              = 0x00000004, // synthetic photometry used in average measurement
     226  ID_SECF_USE_UBERCAL            = 0x00000008, // ubercal photometry used in average measurement
     227  ID_SECF_HAS_PS1                = 0x00000010, // PS1 photometry used in average measurement
     228  ID_SECF_HAS_PS1_STACK          = 0x00000020, // PS1 stack photometry exists
     229  ID_SECF_HAS_TYCHO              = 0x00000040, // Tycho photometry used for synth mags
     230  ID_SECF_FIX_SYNTH              = 0x00000080, // synth mags repaired with zpt map
     231  ID_SECF_RANK_0                 = 0x00000100, // average magnitude uses rank 0 values
     232  ID_SECF_RANK_1                 = 0x00000200, // average magnitude uses rank 1 values
     233  ID_SECF_RANK_2                 = 0x00000400, // average magnitude uses rank 2 values
     234  ID_SECF_RANK_3                 = 0x00000800, // average magnitude uses rank 3 values
     235  ID_SECF_RANK_4                 = 0x00001000, // average magnitude uses rank 4 values
     236  ID_SECF_OBJ_EXT_PSPS           = 0x00002000, // In PSPS ID_SECF_OBJ_EXT is moved here so it fits within 16 bits
     237  ID_SECF_STACK_PRIMARY          = 0x00004000, // PS1 stack photometry includes a primary skycell
     238  ID_SECF_STACK_BESTDET          = 0x00008000, // PS1 stack best measurement is a detection (not forced)
     239  ID_SECF_STACK_PRIMDET          = 0x00010000, // PS1 stack primary measurement is a detection (not forced)
     240  ID_SECF_STACK_PRIMARY_MULTIPLE = 0x00020000, // PS1 stack object has multiple primary measurements
     241
     242  ID_SECF_HAS_SDSS               = 0x00100000, // this photcode has SDSS photometry
     243  ID_SECF_HAS_HSC                = 0x00200000, // this photcode has HSC  photometry
     244  ID_SECF_HAS_CFH                = 0x00400000, // this photcode has CFH  photometry (mostly Megacam)
     245  ID_SECF_HAS_DES                = 0x00800000, // this photcode has DES  photometry
     246
     247  ID_SECF_OBJ_EXT                = 0x01000000, // extended in this band
     248
     249  ID_SECF_CHIP_FLAGS             = 0x01003f1f, // all chip-related bits (used to reset the correct bits only)
     250  ID_SECF_STACK_FLAGS            = 0x0003c020, // all stack-related bits (
    249251} DVOSecfiltFlags;
    250252
     
    501503  double         R;
    502504  double         D;
    503   float          M;
    504   float          Mcal;
     505  float          M; // change to Mpsf eventually to disambiguate
     506  float          Mkron;
     507  float          McalPSF;
     508  float          McalAPER;
    505509  float          Mflat;
    506510  float          dM;
     
    10731077# include "ps1_v4_defs.h"
    10741078# include "ps1_v5_defs.h"
     1079# include "ps1_v6_defs.h"
    10751080# include "ps1_v5_ld_defs.h"
    10761081# include "ps1_ref_defs.h"
  • trunk/Ohana/src/libdvo/include/dvodb.h

    r39633 r40291  
    33
    44# define MEASURE_HAS_XCCD 1
     5
     6// Some values used by code moved to libdvo from opihi.
     7enum {OPIHI_NOTYPE, OPIHI_FLT, OPIHI_INT};
     8# define opihi_flt double
     9// # define opihi_int int64_t
     10# define opihi_int long long int
     11# define OPIHI_INT_FMT "%lld"
    512
    613typedef enum {
     
    236243      MEAS_EXTERN_ID,
    237244      MEAS_EXPNAME_AS_INT,
    238       MEAS_MCAL_OFFSET, // make this a dvoMagOption?
     245      MEAS_MCAL_OFFSET_PSF, // make this a dvoMagOption?
     246      MEAS_MCAL_OFFSET_APER, // make this a dvoMagOption?
    239247      MEAS_FLAT,
    240248      MEAS_CENTER_OFFSET,
     
    369377      IMAGE_XM,
    370378      IMAGE_AIRMASS,
    371       IMAGE_MCAL,
     379      IMAGE_MCAL_PSF,
     380      IMAGE_MCAL_APER,
    372381      IMAGE_dMCAL,
    373382      IMAGE_PHOTCODE,
     
    471480  char    type;
    472481  int     field;
    473   // opihi_flt FltValue;
    474   // opihi_int IntValue;
    475   double FltValue;
    476   int IntValue;
     482  opihi_flt FltValue;
     483  opihi_int IntValue;
     484  // double FltValue;
     485  // int IntValue;
    477486} dbStack;
    478487
    479488typedef struct {
    480   // opihi_flt Flt;
    481   // opihi_int Int;
    482   double Flt;
    483   int Int;
     489  opihi_flt Flt;
     490  opihi_int Int;
     491  // double Flt;
     492  // int Int;
    484493} dbValue;
    485494
     
    562571int dbExtractImagesReset (void);
    563572
    564 // Some values used by code moved to libdvo from opihi.
    565 enum {OPIHI_NOTYPE, OPIHI_FLT, OPIHI_INT};
    566 #define opihi_flt double
    567 #define opihi_int int
    568 
    569573#include "get_graphdata.h"
    570574
  • trunk/Ohana/src/libdvo/include/libdvo_astro.h

    r39457 r40291  
    100100  float            apmifit;              // aperture correction (mag)
    101101  float            dapmifit;             // apmifit error (mag)
    102   float            Mcal;                 // calibration mag (mag)
     102  float            McalPSF;              // calibration mag (mag)
     103  float            McalAPER;             // calibration mag (mag)
    103104  float            dMcal;                // error on Mcal (mag)
    104   short            Xm;                   // image chisq (10*log(value))
     105  float            McalChiSq;            // image chisq (10*log(value))
    105106  short            photcode;             // identifier for CCD,
    106107  float            exptime;              // exposure time (seconds)
  • trunk/Ohana/src/libdvo/src/ImageMetadata.c

    r37807 r40291  
    6464  GET_COLUMN (crval2,   "CRVAL2",         double);
    6565  GET_COLUMN (theta,    "THETA",          float);
    66   GET_COLUMN (Mcal,     "MCAL",           float);
     66  GET_COLUMN (McalPSF,  "MCAL",           float);
    6767  GET_COLUMN (secz,     "SECZ",           float);
    6868  GET_COLUMN (Xcenter,  "X_CENTER",       float);
     
    7777    image[i].crval2   = crval2[i]  ;
    7878    image[i].theta    = theta[i]  ;
    79     image[i].Mcal     = Mcal[i]    ;
     79    image[i].Mcal     = McalPSF[i]    ;
    8080    image[i].secz     = secz[i]    ;
    8181    image[i].Xcenter  = Xcenter[i] ;
     
    9090  free (crval2);
    9191  free (theta);
    92   free (Mcal);
     92  free (McalPSF);
    9393  free (secz);
    9494  free (Xcenter);
     
    166166    theta[i]    = DEG_RAD*atan2(mosaic->pc1_2, mosaic->pc1_1);
    167167
    168     Mcal[i]     = image[i].Mcal;
     168    Mcal[i]     = image[i].McalPSF;
    169169    secz[i]     = image[i].secz;
    170170    Xcenter[i]  = 0.5*image[i].NX;
  • trunk/Ohana/src/libdvo/src/LoadPhotcodesFITS.c

    r40063 r40291  
    6464  CONVERT_FORMAT("DVO_PHOTCODE_PS1_V4",      PS1_V4);
    6565  CONVERT_FORMAT("DVO_PHOTCODE_PS1_V5",      PS1_V5);
     66  CONVERT_FORMAT("DVO_PHOTCODE_PS1_V6",      PS1_V6);
    6667  CONVERT_FORMAT("DVO_PHOTCODE_PS1_V5_LOAD", PS1_V5_LOAD);
    6768
  • trunk/Ohana/src/libdvo/src/SavePhotcodesFITS.c

    r38553 r40291  
    3030  // for the moment, we simply support the latest photcode format for output
    3131  // XXX update this as needed as new formats are defined
    32   PhotCode_PS1_V5 *photcode_output = PhotCode_Internal_To_PS1_V5 (table[0].code, table[0].Ncode);
     32  PhotCode_PS1_V6 *photcode_output = PhotCode_Internal_To_PS1_V6 (table[0].code, table[0].Ncode);
    3333
    3434  /* convert FITS format data to internal format (byteswaps & EXTNAME) */
    3535  if (!gfits_db_create (&db)) return (FALSE);
    36   if (!gfits_table_set_PhotCode_PS1_V5 (&db.ftable, photcode_output, table[0].Ncode, TRUE)) return (FALSE);
     36  if (!gfits_table_set_PhotCode_PS1_V6 (&db.ftable, photcode_output, table[0].Ncode, TRUE)) return (FALSE);
    3737  if (!gfits_db_save (&db)) return (FALSE);
    3838  if (!gfits_db_close (&db)) return (FALSE);
  • trunk/Ohana/src/libdvo/src/dbCheckStack.c

    r39578 r40291  
    4343       * an int unless proven otherwise **/
    4444      stack[i].FltValue = strtod (stack[i].name, &c1);
    45       stack[i].IntValue = strtol (stack[i].name, &c2, 0);
     45      stack[i].IntValue = strtoll (stack[i].name, &c2, 0);
    4646      if (c2 == stack[i].name + strlen (stack[i].name)) {
    4747        stack[i].type  |= DB_STACK_INT;
  • trunk/Ohana/src/libdvo/src/dbExtractImages.c

    r39457 r40291  
    219219      break;
    220220
    221     case IMAGE_MCAL:
    222       value.Flt = image[N].Mcal;
     221    case IMAGE_MCAL_PSF:
     222      value.Flt = image[N].McalPSF;
     223      break;
     224    case IMAGE_MCAL_APER:
     225      value.Flt = image[N].McalAPER;
    223226      break;
    224227    case IMAGE_dMCAL:
     
    226229      break;
    227230    case IMAGE_XM:
    228       value.Flt = pow(10.0, 0.01*image[N].Xm);
     231      value.Flt = image[N].McalChiSq;
    229232      break;
    230233    case IMAGE_PHOTCODE:
  • trunk/Ohana/src/libdvo/src/dbExtractMeasures.c

    r39926 r40291  
    740740      break;
    741741
    742     case MEAS_MCAL_OFFSET: { value.Flt = measure[0].Mcal; break; }
     742    case MEAS_MCAL_OFFSET_PSF:  { value.Flt = measure[0].McalPSF;  break; }
     743    case MEAS_MCAL_OFFSET_APER: { value.Flt = measure[0].McalAPER; break; }
    743744    case MEAS_FLAT: { value.Flt = measure[0].Mflat; break; }
    744745
  • trunk/Ohana/src/libdvo/src/dbFields.c

    r39633 r40291  
    333333
    334334  // make a local working copy of fieldName and replace ':' with spaces
     335  // XXX memory leak here:
    335336  char *fieldCopy = strcreate(fieldName);
    336337  for (j = 0; fieldCopy[j]; j++) {
     
    338339  }
    339340
     341  // XXX potential memory leak here
    340342  char *firstWord = getword(fieldCopy);
     343  if (!firstWord) return FALSE;
    341344 
    342345  // firstWord may be either flux, mag or photcode
     
    606609  if (!strcasecmp (fieldName, "SKY"))            ESCAPE (MEAS_SKY,            OPIHI_FLT);
    607610  if (!strcasecmp (fieldName, "SKY_ERR"))        ESCAPE (MEAS_dSKY,           OPIHI_FLT);
    608   if (!strcasecmp (fieldName, "MCAL_OFFSET"))    ESCAPE (MEAS_MCAL_OFFSET,    OPIHI_FLT);
     611  if (!strcasecmp (fieldName, "MCAL_OFFSET"))    ESCAPE (MEAS_MCAL_OFFSET_PSF,    OPIHI_FLT);
     612  if (!strcasecmp (fieldName, "MCAL_OFFSET_PSF"))  ESCAPE (MEAS_MCAL_OFFSET_PSF,  OPIHI_FLT);
     613  if (!strcasecmp (fieldName, "MCAL_OFFSET_APER")) ESCAPE (MEAS_MCAL_OFFSET_APER, OPIHI_FLT);
    609614  if (!strcasecmp (fieldName, "FLAT"))           ESCAPE (MEAS_FLAT,           OPIHI_FLT);
    610615  if (!strcasecmp (fieldName, "CENTER_OFFSET"))  ESCAPE (MEAS_CENTER_OFFSET,  OPIHI_FLT);
     
    842847  if (!strcasecmp (fieldName, "dapresid" )) ESCAPE (IMAGE_DAPRESID,  OPIHI_FLT);
    843848
    844   if (!strcasecmp (fieldName, "Mcal"     )) ESCAPE (IMAGE_MCAL,      OPIHI_FLT);
    845   if (!strcasecmp (fieldName, "dMcal"    )) ESCAPE (IMAGE_dMCAL,     OPIHI_FLT);
    846   if (!strcasecmp (fieldName, "Xm"       )) ESCAPE (IMAGE_XM,        OPIHI_FLT);
    847   if (!strcasecmp (fieldName, "photcode" )) ESCAPE (IMAGE_PHOTCODE,  OPIHI_INT);
    848   if (!strcasecmp (fieldName, "exptime"  )) ESCAPE (IMAGE_EXPTIME,   OPIHI_FLT);
    849   if (!strcasecmp (fieldName, "expname"  )) ESCAPE (IMAGE_EXPNAME_AS_INT, OPIHI_INT);
    850   if (!strcasecmp (fieldName, "sidtime"  )) ESCAPE (IMAGE_SIDTIME,   OPIHI_FLT);
     849  if (!strcasecmp (fieldName, "Mcal"        )) ESCAPE (IMAGE_MCAL_PSF,       OPIHI_FLT);
     850  if (!strcasecmp (fieldName, "McalPSF"     )) ESCAPE (IMAGE_MCAL_PSF,       OPIHI_FLT);
     851  if (!strcasecmp (fieldName, "McalAPER"    )) ESCAPE (IMAGE_MCAL_APER,      OPIHI_FLT);
     852  if (!strcasecmp (fieldName, "McalAPERTURE")) ESCAPE (IMAGE_MCAL_APER,      OPIHI_FLT);
     853  if (!strcasecmp (fieldName, "dMcal"       )) ESCAPE (IMAGE_dMCAL,          OPIHI_FLT);
     854  if (!strcasecmp (fieldName, "Xm"          )) ESCAPE (IMAGE_XM,             OPIHI_FLT);
     855  if (!strcasecmp (fieldName, "photcode"    )) ESCAPE (IMAGE_PHOTCODE,       OPIHI_INT);
     856  if (!strcasecmp (fieldName, "exptime"     )) ESCAPE (IMAGE_EXPTIME,        OPIHI_FLT);
     857  if (!strcasecmp (fieldName, "expname"     )) ESCAPE (IMAGE_EXPNAME_AS_INT, OPIHI_INT);
     858  if (!strcasecmp (fieldName, "sidtime"     )) ESCAPE (IMAGE_SIDTIME,        OPIHI_FLT);
    851859
    852860  if (!strcasecmp (fieldName, "latitude" )) ESCAPE (IMAGE_LATITUDE,  OPIHI_FLT);
  • trunk/Ohana/src/libdvo/src/dvo_catalog.c

    r40063 r40291  
    5757  if (!strcasecmp (catformat, "PS1_V4"))          return (DVO_FORMAT_PS1_V4);
    5858  if (!strcasecmp (catformat, "PS1_V5"))          return (DVO_FORMAT_PS1_V5);
     59  if (!strcasecmp (catformat, "PS1_V6"))          return (DVO_FORMAT_PS1_V6);
    5960  if (!strcasecmp (catformat, "PS1_V5_LOAD"))     return (DVO_FORMAT_PS1_V5_LOAD);
    6061  if (!strcasecmp (catformat, "PS1_REF"))         return (DVO_FORMAT_PS1_REF);
     
    234235
    235236  if (mode & SECFILT_RESET_CHIP) {
    236     secfilt->M           = NAN;
    237     secfilt->dM          = NAN;
    238     secfilt->Map         = NAN;
    239     secfilt->dMap        = NAN;
    240     secfilt->sMap        = NAN;
    241     secfilt->Mkron       = NAN;
    242     secfilt->dMkron      = NAN;
    243     secfilt->sMkron      = NAN;
     237    secfilt->MpsfChp     = NAN;
     238    secfilt->dMpsfChp    = NAN;
     239    secfilt->sMpsfChp    = NAN;
     240    secfilt->MapChp      = NAN;
     241    secfilt->dMapChp     = NAN;
     242    secfilt->sMapChp     = NAN;
     243    secfilt->MkronChp    = NAN;
     244    secfilt->dMkronChp   = NAN;
     245    secfilt->sMkronChp   = NAN;
    244246
    245247    secfilt->psfQfMax     = NAN;
    246248    secfilt->psfQfPerfMax = NAN;
    247249
    248     secfilt->Mstdev      = NAN;
    249250    secfilt->Mmin        = NAN;
    250251    secfilt->Mmax        = NAN;
     
    316317 measure->Mkron     = NAN;
    317318 measure->dMkron    = NAN;
    318  measure->Mcal      = NAN;
     319 measure->McalPSF   = NAN;
     320 measure->McalAPER  = NAN;
    319321 measure->dMcal     = NAN;
    320322 measure->dt        = NAN;
     
    343345
    344346 measure->Mflat     = 0.0;
    345  measure->dummy2    = 0;
    346347
    347348 measure->Sky       = NAN;
     
    394395 measure->D         = NAN;
    395396 measure->M         = NAN;
    396  measure->Mcal      = NAN;
     397 measure->McalPSF   = NAN;
     398 measure->McalAPER  = NAN;
    397399 measure->dM        = NAN;
    398400
     
    922924    for (in = out = i = 0; i < catalog[0].Naverage; i++) {
    923925      for (j = 0; j < catalog[0].Nsecfilt; j++, in++, out++) {
    924         outsec[out].M      = insec[in].M;
    925         outsec[out].dM     = insec[in].dM;
    926         outsec[out].Mchisq = insec[in].Mchisq;
     926        outsec[out].MpsfChp  = insec[in].MpsfChp;
     927        outsec[out].dMpsfChp = insec[in].dMpsfChp;
     928        outsec[out].Mchisq   = insec[in].Mchisq;
    927929      }
    928930      for (j = 0; j < Nextra; j++, out++) {
    929         outsec[out].M      = NAN;
    930         outsec[out].dM    = NAN;
    931         outsec[out].Mchisq = NAN;
     931        outsec[out].MpsfChp  = NAN;
     932        outsec[out].dMpsfChp = NAN;
     933        outsec[out].Mchisq   = NAN;
    932934      }
    933935    }
  • trunk/Ohana/src/libdvo/src/dvo_catalog_raw.c

    r40063 r40291  
    9191      FORMAT_CASE (PS1_V4,      PS1_V4);
    9292      FORMAT_CASE (PS1_V5,      PS1_V5);
     93      FORMAT_CASE (PS1_V6,      PS1_V6);
    9394      FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD);
    9495      FORMAT_CASE (PS1_REF,     PS1_REF);
     
    288289  if (catalog[0].catformat == DVO_FORMAT_PS1_V4)          gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_V4");
    289290  if (catalog[0].catformat == DVO_FORMAT_PS1_V5)          gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_V5");
     291  if (catalog[0].catformat == DVO_FORMAT_PS1_V6)          gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_V6");
    290292  if (catalog[0].catformat == DVO_FORMAT_PS1_V5_LOAD)     gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_V5_LOAD");
    291293  if (catalog[0].catformat == DVO_FORMAT_PS1_REF)         gfits_modify (&catalog[0].header, "FORMAT", "%s", 1, "PS1_REF");
     
    394396      FORMAT_CASE (PS1_V4,      PS1_V4);
    395397      FORMAT_CASE (PS1_V5,      PS1_V5);
     398      FORMAT_CASE (PS1_V6,      PS1_V6);
    396399      FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD);
    397400      FORMAT_CASE (PS1_REF,     PS1_REF);
     
    448451      FORMAT_CASE (PS1_V4,      PS1_V4);
    449452      FORMAT_CASE (PS1_V5,      PS1_V5);
     453      FORMAT_CASE (PS1_V6,      PS1_V6);
    450454      FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD);
    451455      FORMAT_CASE (PS1_REF,     PS1_REF);
     
    505509      FORMAT_CASE (PS1_V3,      PS1_V3);
    506510      FORMAT_CASE (PS1_V5,      PS1_V5);
     511      FORMAT_CASE (PS1_V6,      PS1_V6);
    507512      FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD);
    508513      FORMAT_CASE (PS1_REF,     PS1_REF);
     
    559564      FORMAT_CASE (PS1_V4,      PS1_V4);
    560565      FORMAT_CASE (PS1_V5,      PS1_V5);
     566      FORMAT_CASE (PS1_V6,      PS1_V6);
    561567      FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD);
    562568      FORMAT_CASE (PS1_REF,     PS1_REF);
     
    617623      FORMAT_CASE (PS1_V4,      PS1_V4);
    618624      FORMAT_CASE (PS1_V5,      PS1_V5);
     625      FORMAT_CASE (PS1_V6,      PS1_V6);
    619626      FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD);
    620627      FORMAT_CASE (PS1_REF,     PS1_REF);
     
    671678      FORMAT_CASE (PS1_V4,      PS1_V4);
    672679      FORMAT_CASE (PS1_V5,      PS1_V5);
     680      FORMAT_CASE (PS1_V6,      PS1_V6);
    673681      FORMAT_CASE (PS1_V5_LOAD, PS1_V5_LOAD);
    674682      FORMAT_CASE (PS1_REF,     PS1_REF);
  • trunk/Ohana/src/libdvo/src/dvo_catalog_split.c

    r39395 r40291  
    464464  catalog[0].Nmissing_disk = Nmissing;
    465465  catalog[0].Nsecfilt_disk = Naverage * Nsecfilt;
    466   catalog[0].Nlensing_disk  = Nlensing;
    467   catalog[0].Nlensobj_disk  = Nlensobj;
    468   catalog[0].Nstarpar_disk  = Nstarpar;
     466  catalog[0].Nlensing_disk = Nlensing;
     467  catalog[0].Nlensobj_disk = Nlensobj;
     468  catalog[0].Nstarpar_disk = Nstarpar;
    469469  catalog[0].Ngalphot_disk = Ngalphot;
    470470
  • trunk/Ohana/src/libdvo/src/dvo_convert.c

    r40063 r40291  
    4242  CONVERT_FORMAT ("DVO_AVERAGE_PS1_V4",          PS1_V4);
    4343  CONVERT_FORMAT ("DVO_AVERAGE_PS1_V5",          PS1_V5);
     44  CONVERT_FORMAT ("DVO_AVERAGE_PS1_V6",          PS1_V6);
    4445  CONVERT_FORMAT ("DVO_AVERAGE_PS1_V5_LOAD",     PS1_V5_LOAD);
    4546  CONVERT_FORMAT ("DVO_AVERAGE_PS1_REF",         PS1_REF);
     
    133134  CONVERT_FORMAT ("DVO_AVERAGE_PS1_V4",          PS1_V4,          PS1_V4);
    134135  CONVERT_FORMAT ("DVO_AVERAGE_PS1_V5",          PS1_V5,          PS1_V5);
     136  CONVERT_FORMAT ("DVO_AVERAGE_PS1_V6",          PS1_V6,          PS1_V6);
    135137  CONVERT_FORMAT ("DVO_AVERAGE_PS1_V5_LOAD",     PS1_V5_LOAD,     PS1_V5_LOAD);
    136138  CONVERT_FORMAT ("DVO_AVERAGE_PS1_REF",         PS1_REF,         PS1_REF);
     
    171173      FORMAT_CASE (PS1_V4,          PS1_V4);
    172174      FORMAT_CASE (PS1_V5,          PS1_V5);
     175      FORMAT_CASE (PS1_V6,          PS1_V6);
    173176      FORMAT_CASE (PS1_V5_LOAD,     PS1_V5_LOAD);
    174177      FORMAT_CASE (PS1_REF,         PS1_REF);
     
    270273  CONVERT_FORMAT ("DVO_MEASURE_PS1_V4",          PS1_V4,          PS1_V4,          FALSE);
    271274  CONVERT_FORMAT ("DVO_MEASURE_PS1_V5",          PS1_V5,          PS1_V5,          TRUE);
     275  CONVERT_FORMAT ("DVO_MEASURE_PS1_V6",          PS1_V6,          PS1_V6,          TRUE);
    272276  CONVERT_FORMAT ("DVO_MEASURE_PS1_V5_LOAD",     PS1_V5_LOAD,     PS1_V5_LOAD,     TRUE);
    273277  CONVERT_FORMAT ("DVO_MEASURE_PS1_REF",         PS1_REF,         PS1_REF,         FALSE);
     
    310314      FORMAT_CASE (PS1_V4,          PS1_V4,          FALSE);
    311315      FORMAT_CASE (PS1_V5,          PS1_V5,          TRUE);
     316      FORMAT_CASE (PS1_V6,          PS1_V6,          TRUE);
    312317      FORMAT_CASE (PS1_V5_LOAD,     PS1_V5_LOAD,     TRUE);
    313318      FORMAT_CASE (PS1_REF,         PS1_REF,         FALSE);
     
    391396  SKIPPING_FORMAT ("DVO_MISSING_PS1_V4",          PS1_V4,          PS1_V4);
    392397  SKIPPING_FORMAT ("DVO_MISSING_PS1_V5",          PS1_V5,          PS1_V5);
     398  SKIPPING_FORMAT ("DVO_MISSING_PS1_V6",          PS1_V6,          PS1_V6);
    393399  SKIPPING_FORMAT ("DVO_MISSING_PS1_V5_LOAD",     PS1_V5_LOAD,     PS1_V5_LOAD);
    394400# undef CONVERT_FORMAT
     
    466472  CONVERT_FORMAT ("DVO_SECFILT_PS1_V4",          PS1_V4,          PS1_V4);
    467473  CONVERT_FORMAT ("DVO_SECFILT_PS1_V5",          PS1_V5,          PS1_V5);
     474  CONVERT_FORMAT ("DVO_SECFILT_PS1_V6",          PS1_V6,          PS1_V6);
    468475  CONVERT_FORMAT ("DVO_SECFILT_PS1_V5_LOAD",     PS1_V5_LOAD,     PS1_V5_LOAD);
    469476  CONVERT_FORMAT ("DVO_SECFILT_PS1_REF",         PS1_REF,         PS1_REF);
     
    504511      FORMAT_CASE (PS1_V4,          PS1_V4);
    505512      FORMAT_CASE (PS1_V5,          PS1_V5);
     513      FORMAT_CASE (PS1_V6,          PS1_V6);
    506514      FORMAT_CASE (PS1_V5_LOAD,     PS1_V5_LOAD);
    507515      FORMAT_CASE (PS1_REF,         PS1_REF);
     
    612620  SKIPPING_FORMAT ("DVO_LENSING_PS1_V4",          PS1_V4,          PS1_V4);
    613621  CONVERT_FORMAT  ("DVO_LENSING_PS1_V5",          PS1_V5,          PS1_V5_R3);
     622  CONVERT_FORMAT  ("DVO_LENSING_PS1_V6",          PS1_V6,          PS1_V6);
    614623  CONVERT_FORMAT  ("DVO_LENSING_PS1_V5_LOAD",     PS1_V5_LOAD,     PS1_V5_LOAD);
    615624  SKIPPING_FORMAT ("DVO_LENSING_PS1_SIM",         PS1_SIM,         PS1_SIM);
     
    652661//    FORMAT_CASE (PS1_V4,          PS1_V4);
    653662      FORMAT_CASE (PS1_V5,          PS1_V5_R3);
     663      FORMAT_CASE (PS1_V6,          PS1_V6);
    654664      FORMAT_CASE (PS1_V5_LOAD,     PS1_V5_LOAD);
    655665# undef FORMAT_CASE
     
    732742  SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_V4",          PS1_V4,          PS1_V4);
    733743  CONVERT_FORMAT  ("DVO_LENSOBJ_PS1_V5",          PS1_V5,          PS1_V5_R1);
     744  CONVERT_FORMAT  ("DVO_LENSOBJ_PS1_V6",          PS1_V6,          PS1_V6);
    734745  CONVERT_FORMAT  ("DVO_LENSOBJ_PS1_V5_LOAD",     PS1_V5_LOAD,     PS1_V5_LOAD);
    735746  SKIPPING_FORMAT ("DVO_LENSOBJ_PS1_SIM",         PS1_SIM,         PS1_SIM);
     
    772783//    FORMAT_CASE (PS1_V4,          PS1_V4);
    773784      FORMAT_CASE (PS1_V5,          PS1_V5_R1);
     785      FORMAT_CASE (PS1_V6,          PS1_V6);
    774786      FORMAT_CASE (PS1_V5_LOAD,     PS1_V5_LOAD);
    775787# undef FORMAT_CASE
     
    840852  SKIPPING_FORMAT ("DVO_STARPAR_PS1_V4",          PS1_V4,          PS1_V4);
    841853  CONVERT_FORMAT  ("DVO_STARPAR_PS1_V5",          PS1_V5,          PS1_V5);
     854  CONVERT_FORMAT  ("DVO_STARPAR_PS1_V6",          PS1_V6,          PS1_V6);
    842855  CONVERT_FORMAT  ("DVO_STARPAR_PS1_V5_LOAD",     PS1_V5_LOAD,     PS1_V5_LOAD);
    843856# undef CONVERT_FORMAT
     
    880893//    FORMAT_CASE (PS1_V4,          PS1_V4);
    881894      FORMAT_CASE (PS1_V5,          PS1_V5);
     895      FORMAT_CASE (PS1_V6,          PS1_V6);
    882896      FORMAT_CASE (PS1_V5_LOAD,     PS1_V5_LOAD);
    883897# undef FORMAT_CASE
     
    961975  SKIPPING_FORMAT ("DVO_GALPHOT_PS1_V4",          PS1_V4,          PS1_V4);
    962976  CONVERT_FORMAT  ("DVO_GALPHOT_PS1_V5",          PS1_V5,          PS1_V5_R1);
     977  CONVERT_FORMAT  ("DVO_GALPHOT_PS1_V6",          PS1_V6,          PS1_V6);
    963978  CONVERT_FORMAT  ("DVO_GALPHOT_PS1_V5_LOAD",     PS1_V5_LOAD,     PS1_V5_LOAD);
    964979  SKIPPING_FORMAT ("DVO_GALPHOT_PS1_SIM",         PS1_SIM,         PS1_SIM);
     
    10011016//    FORMAT_CASE (PS1_V4,          PS1_V4);
    10021017      FORMAT_CASE (PS1_V5,          PS1_V5_R1);
     1018      FORMAT_CASE (PS1_V6,          PS1_V6);
    10031019      FORMAT_CASE (PS1_V5_LOAD,     PS1_V5_LOAD);
    10041020# undef FORMAT_CASE
     
    10751091  CONVERT_FORMAT ("DVO_IMAGE_PS1_V4",          PS1_V4,          PS1_V4);
    10761092  CONVERT_FORMAT ("DVO_IMAGE_PS1_V5",          PS1_V5,          PS1_V5);
     1093  CONVERT_FORMAT ("DVO_IMAGE_PS1_V6",          PS1_V6,          PS1_V6);
    10771094  CONVERT_FORMAT ("DVO_IMAGE_PS1_V5_LOAD",     PS1_V5_LOAD,     PS1_V5_LOAD);
    10781095  CONVERT_FORMAT ("DVO_IMAGE_PS1_REF",         PS1_REF,         PS1_REF);
     
    10961113    tmpImage = ImageInternalTo_##TYPE ((Image *) ftable[0].buffer, Nimage); \
    10971114    free (ftable[0].buffer);                                            \
     1115    ftable[0].buffer = NULL;                                            \
    10981116    gfits_free_header (ftable->header);                                 \
    10991117    gfits_table_set_Image_##TYPE (ftable, tmpImage, Nimage, TRUE);      \
     
    11141132    FORMAT_CASE (PS1_V4,          PS1_V4);
    11151133    FORMAT_CASE (PS1_V5,          PS1_V5);
     1134    FORMAT_CASE (PS1_V6,          PS1_V6);
    11161135    FORMAT_CASE (PS1_V5_LOAD,     PS1_V5_LOAD);
    11171136    FORMAT_CASE (PS1_REF,         PS1_REF);
     
    11661185    FORMAT_CASE (PS1_V4,          PS1_V4);
    11671186    FORMAT_CASE (PS1_V5,          PS1_V5);
     1187    FORMAT_CASE (PS1_V6,          PS1_V6);
    11681188    FORMAT_CASE (PS1_V5_LOAD,     PS1_V5_LOAD);
    11691189    FORMAT_CASE (PS1_REF,         PS1_REF);
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c

    r39457 r40291  
    1717    out[i].D          = ave[averef].D - in[i].dD / 3600.0;
    1818    out[i].M          = in[i].M;
    19     out[i].Mcal       = in[i].Mcal;
     19    out[i].McalPSF    = in[i].Mcal;
     20    out[i].McalAPER   = in[i].Mcal;
    2021    out[i].dM         = in[i].dM;
    2122    out[i].dt         = in[i].dt;
     
    6465    out[i].dD         = 3600.0*(ave[averef].D - in[i].D);
    6566    out[i].M          = in[i].M;
    66     out[i].Mcal       = in[i].Mcal;
     67    out[i].Mcal       = in[i].McalPSF;
    6768    out[i].dM         = in[i].dM;
    6869    out[i].dt         = in[i].dt;
     
    182183    dvo_secfilt_init (&out[i], SECFILT_RESET_ALL);
    183184
    184     out[i].M     = in[i].M;     
    185     out[i].dM    = in[i].dM;     
     185    out[i].MpsfChp     = in[i].M;     
     186    out[i].dMpsfChp    = in[i].dM;     
     187
    186188    out[i].Mchisq= pow (10.0, 0.01*in[i].Xm);     
    187189    out[i].Ncode = in[i].Ncode;
     
    199201
    200202  for (i = 0; i < Nvalues; i++) {
    201     out[i].M     = in[i].M;     
    202     out[i].dM    = in[i].dM;     
     203    out[i].M             = in[i].MpsfChp;     
     204    out[i].dM            = in[i].dMpsfChp;     
     205
    203206    out[i].Xm    = 100.0*log10(in[i].Mchisq);     
    204207    out[i].Ncode = in[i].Ncode;
     
    237240    out[i].apmifit          = in[i].apmifit;
    238241    out[i].dapmifit         = in[i].dapmifit;
    239     out[i].Mcal             = in[i].Mcal;
     242
     243    out[i].McalPSF          = in[i].Mcal;
     244    out[i].McalAPER         = in[i].Mcal;
    240245    out[i].dMcal            = in[i].dMcal;
    241     out[i].Xm               = in[i].Xm;
     246    out[i].McalChiSq        = pow(10.0, 0.01*in[i].Xm);
     247
    242248    out[i].photcode         = in[i].photcode;
    243249    out[i].exptime          = in[i].exptime;
     
    306312    out[i].apmifit          = in[i].apmifit;
    307313    out[i].dapmifit         = in[i].dapmifit;
    308     out[i].Mcal             = in[i].Mcal;
     314
     315    out[i].Mcal             = in[i].McalPSF;
    309316    out[i].dMcal            = in[i].dMcal;
    310     out[i].Xm               = in[i].Xm;
     317    out[i].Xm               = 100.0*log10(in[i].McalChiSq);
     318
    311319    out[i].photcode         = in[i].photcode;
    312320    out[i].exptime          = in[i].exptime;
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c

    r39457 r40291  
    1717    out[i].D          = ave[averef].D - in[i].dD / 3600.0;
    1818    out[i].M          = in[i].M;
    19     out[i].Mcal       = in[i].Mcal;
     19    out[i].McalPSF    = in[i].Mcal;
     20    out[i].McalAPER   = in[i].Mcal;
    2021    out[i].Map        = in[i].Map;
    2122    out[i].dM         = in[i].dM;
     
    6263    out[i].dD         = 3600.0*(ave[averef].D - in[i].D);
    6364    out[i].M          = in[i].M;
    64     out[i].Mcal       = in[i].Mcal;
     65    out[i].Mcal       = in[i].McalPSF;
    6566    out[i].Map        = in[i].Map;
    6667    out[i].dM         = in[i].dM;
     
    177178    dvo_secfilt_init (&out[i], SECFILT_RESET_ALL);
    178179
    179     out[i].M     = in[i].M;     
    180     out[i].dM    = in[i].dM;     
     180    out[i].MpsfChp     = in[i].M;     
     181    out[i].dMpsfChp    = in[i].dM;     
     182
    181183    out[i].Mchisq= pow (10.0, 0.01*in[i].Xm);     
    182184    out[i].Ncode = in[i].Ncode;
     
    194196
    195197  for (i = 0; i < Nvalues; i++) {
    196     out[i].M     = in[i].M;     
    197     out[i].dM    = in[i].dM;     
     198    out[i].M             = in[i].MpsfChp;     
     199    out[i].dM            = in[i].dMpsfChp;     
     200
    198201    out[i].Xm    = 100.0*log10(in[i].Mchisq);     
    199202    out[i].Ncode = in[i].Ncode;
     
    232235    out[i].apmifit          = in[i].apmifit;
    233236    out[i].dapmifit         = in[i].dapmifit;
    234     out[i].Mcal             = in[i].Mcal;
     237
     238    out[i].McalPSF          = in[i].Mcal;
     239    out[i].McalAPER         = in[i].Mcal;
    235240    out[i].dMcal            = in[i].dMcal;
    236     out[i].Xm               = in[i].Xm;
     241    out[i].McalChiSq        = pow(10.0, 0.01*in[i].Xm);
     242
    237243    out[i].photcode         = in[i].photcode;
    238244    out[i].exptime          = in[i].exptime;
     
    298304    out[i].apmifit          = in[i].apmifit;
    299305    out[i].dapmifit         = in[i].dapmifit;
    300     out[i].Mcal             = in[i].Mcal;
     306
     307    out[i].Mcal             = in[i].McalPSF;
    301308    out[i].dMcal            = in[i].dMcal;
    302     out[i].Xm               = in[i].Xm;
     309    out[i].Xm               = 100.0*log10(in[i].McalChiSq);
     310
    303311    out[i].photcode         = in[i].photcode;
    304312    out[i].exptime          = in[i].exptime;
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_3.c

    r37807 r40291  
    3434    out[i].apmifit          = in[i].apmifit;
    3535    out[i].dapmifit         = in[i].dapmifit;
    36     out[i].Mcal             = in[i].Mcal;
     36
     37    out[i].McalPSF          = in[i].Mcal;
     38    out[i].McalAPER         = in[i].Mcal;
    3739    out[i].dMcal            = in[i].dMcal;
    38     out[i].Xm               = in[i].Xm;
     40    out[i].McalChiSq        = pow(10.0, 0.01*in[i].Xm);
     41
    3942    out[i].photcode         = in[i].photcode;
    4043    out[i].exptime          = in[i].exptime;
     
    9598    out[i].apmifit          = in[i].apmifit;
    9699    out[i].dapmifit         = in[i].dapmifit;
    97     out[i].Mcal             = in[i].Mcal;
     100
     101    out[i].Mcal             = in[i].McalPSF;
    98102    out[i].dMcal            = in[i].dMcal;
    99     out[i].Xm               = in[i].Xm;
     103    out[i].Xm               = 100.0*log10(in[i].McalChiSq);
     104
    100105    out[i].photcode         = in[i].photcode;
    101106    out[i].exptime          = in[i].exptime;
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_REF.c

    r39457 r40291  
    114114    dvo_secfilt_init (&out[i], SECFILT_RESET_ALL);
    115115
    116     out[i].M     = in[i].M;     
    117     out[i].dM    = in[i].dM;     
     116    out[i].MpsfChp     = in[i].M;     
     117    out[i].dMpsfChp    = in[i].dM;     
    118118 }
    119119  return (out);
     
    128128
    129129  for (i = 0; i < Nvalues; i++) {
    130     out[i].M     = in[i].M;     
    131     out[i].dM    = in[i].dM;     
     130    out[i].M             = in[i].MpsfChp;     
     131    out[i].dM            = in[i].dMpsfChp;     
    132132  }
    133133  return (out);
     
    163163    out[i].apmifit          = in[i].apmifit;
    164164    out[i].dapmifit         = in[i].dapmifit;
    165     out[i].Mcal             = in[i].Mcal;
     165
     166    out[i].McalPSF          = in[i].Mcal;
     167    out[i].McalAPER         = in[i].Mcal;
    166168    out[i].dMcal            = in[i].dMcal;
    167     out[i].Xm               = in[i].Xm;
     169    out[i].McalChiSq        = pow(10.0, 0.01*in[i].Xm);
     170
    168171    out[i].photcode         = in[i].photcode;
    169172    out[i].exptime          = in[i].exptime;
     
    227230    out[i].apmifit          = in[i].apmifit;
    228231    out[i].dapmifit         = in[i].dapmifit;
    229     out[i].Mcal             = in[i].Mcal;
     232
     233    out[i].Mcal             = in[i].McalPSF;
    230234    out[i].dMcal            = in[i].dMcal;
    231     out[i].Xm               = in[i].Xm;
     235    out[i].Xm               = 100.0*log10(in[i].McalChiSq);
     236
    232237    out[i].photcode         = in[i].photcode;
    233238    out[i].exptime          = in[i].exptime;
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_SIM.c

    r39457 r40291  
    1818    out[i].M          = in[i].M;
    1919    out[i].dM         = in[i].dM;
    20     out[i].Mcal       = in[i].Mcal;
     20    out[i].McalPSF    = in[i].Mcal;
     21    out[i].McalAPER   = in[i].Mcal;
    2122    out[i].dt         = in[i].dt;
    2223    out[i].airmass    = in[i].airmass;
     
    6465    out[i].M          = in[i].M;
    6566    out[i].dM         = in[i].dM;
    66     out[i].Mcal       = in[i].Mcal;
     67    out[i].Mcal       = in[i].McalPSF;
    6768    out[i].dt         = in[i].dt;
    6869    out[i].airmass    = in[i].airmass;
     
    199200    dvo_secfilt_init (&out[i], SECFILT_RESET_ALL);
    200201
    201     out[i].M             = in[i].M;     
    202     out[i].dM            = in[i].dM;     
     202    out[i].MpsfChp     = in[i].M;     
     203    out[i].dMpsfChp    = in[i].dM;     
     204
    203205    out[i].Ncode         = in[i].Ncode;
    204206    out[i].Nused         = in[i].Nused;
     
    217219  for (i = 0; i < Nvalues; i++) {
    218220
    219     out[i].M             = in[i].M;     
    220     out[i].dM            = in[i].dM;     
     221    out[i].M             = in[i].MpsfChp;     
     222    out[i].dM            = in[i].dMpsfChp;     
     223
    221224    out[i].Ncode         = in[i].Ncode;
    222225    out[i].Nused         = in[i].Nused;
     
    320323    out[i].apmifit          = in[i].apmifit;
    321324    out[i].dapmifit         = in[i].dapmifit;
    322     out[i].Mcal             = in[i].Mcal;
     325
     326    out[i].McalPSF          = in[i].Mcal;
     327    out[i].McalAPER         = in[i].Mcal;
    323328    out[i].dMcal            = in[i].dMcal;
    324     out[i].Xm               = in[i].Xm;
     329    out[i].McalChiSq        = pow(10.0, 0.01*in[i].Xm);
     330
    325331    out[i].photcode         = in[i].photcode;
    326332    out[i].exptime          = in[i].exptime;
     
    386392    out[i].apmifit          = in[i].apmifit;
    387393    out[i].dapmifit         = in[i].dapmifit;
    388     out[i].Mcal             = in[i].Mcal;
     394
     395    out[i].Mcal             = in[i].McalPSF;
    389396    out[i].dMcal            = in[i].dMcal;
    390     out[i].Xm               = in[i].Xm;
     397    out[i].Xm               = 100.0*log10(in[i].McalChiSq);
     398
    391399    out[i].photcode         = in[i].photcode;
    392400    out[i].exptime          = in[i].exptime;
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V1.c

    r39457 r40291  
    1717    out[i].D          = ave[averef].D - in[i].dD / 3600.0;
    1818    out[i].M          = in[i].M;
    19     out[i].Mcal       = in[i].Mcal;
     19    out[i].McalPSF    = in[i].Mcal;
     20    out[i].McalAPER   = in[i].Mcal;
    2021    out[i].Map        = in[i].Map;
    2122    out[i].dM         = in[i].dM;
     
    7172    out[i].dD         = 3600.0*(ave[averef].D - in[i].D);
    7273    out[i].M          = in[i].M;
    73     out[i].Mcal       = in[i].Mcal;
     74    out[i].Mcal       = in[i].McalPSF;
    7475    out[i].Map        = in[i].Map;
    7576    out[i].dM         = in[i].dM;
     
    197198    dvo_secfilt_init (&out[i], SECFILT_RESET_ALL);
    198199
    199     out[i].M     = in[i].M;     
    200     out[i].dM    = in[i].dM;     
     200    out[i].MpsfChp     = in[i].M;     
     201    out[i].dMpsfChp    = in[i].dM;     
     202
    201203    out[i].Mchisq= in[i].Mchisq;     
    202204    out[i].Ncode = in[i].Ncode;
     
    216218
    217219  for (i = 0; i < Nvalues; i++) {
    218     out[i].M     = in[i].M;     
    219     out[i].dM    = in[i].dM;     
     220    out[i].M             = in[i].MpsfChp;     
     221    out[i].dM            = in[i].dMpsfChp;     
     222
    220223    out[i].Mchisq= in[i].Mchisq;     
    221224    out[i].Ncode = in[i].Ncode;
     
    256259    out[i].apmifit          = in[i].apmifit;
    257260    out[i].dapmifit         = in[i].dapmifit;
    258     out[i].Mcal             = in[i].Mcal;
     261
     262    out[i].McalPSF          = in[i].Mcal;
     263    out[i].McalAPER         = in[i].Mcal;
    259264    out[i].dMcal            = in[i].dMcal;
    260     out[i].Xm               = in[i].Xm;
     265    out[i].McalChiSq        = pow(10.0, 0.01*in[i].Xm);
     266
    261267    out[i].photcode         = in[i].photcode;
    262268    out[i].exptime          = in[i].exptime;
     
    321327    out[i].apmifit          = in[i].apmifit;
    322328    out[i].dapmifit         = in[i].dapmifit;
    323     out[i].Mcal             = in[i].Mcal;
     329
     330    out[i].Mcal             = in[i].McalPSF;
    324331    out[i].dMcal            = in[i].dMcal;
    325     out[i].Xm               = in[i].Xm;
     332    out[i].Xm               = 100.0*log10(in[i].McalChiSq);
     333
    326334    out[i].photcode         = in[i].photcode;
    327335    out[i].exptime          = in[i].exptime;
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V2.c

    r39457 r40291  
    1717    out[i].D          = ave[averef].D - in[i].dD / 3600.0;
    1818    out[i].M          = in[i].M;
    19     out[i].Mcal       = in[i].Mcal;
     19    out[i].McalPSF    = in[i].Mcal;
     20    out[i].McalAPER   = in[i].Mcal;
    2021    out[i].Map        = in[i].Map;
    2122    out[i].dM         = in[i].dM;
     
    7273    out[i].dD         = 3600.0*(ave[averef].D - in[i].D);
    7374    out[i].M          = in[i].M;
    74     out[i].Mcal       = in[i].Mcal;
     75    out[i].Mcal       = in[i].McalPSF;
    7576    out[i].Map        = in[i].Map;
    7677    out[i].dM         = in[i].dM;
     
    206207    dvo_secfilt_init (&out[i], SECFILT_RESET_ALL);
    207208
    208     out[i].M     = in[i].M;     
    209     out[i].dM    = in[i].dM;     
     209    out[i].MpsfChp     = in[i].M;     
     210    out[i].dMpsfChp    = in[i].dM;     
     211
    210212    out[i].Mchisq= in[i].Mchisq;     
    211213    out[i].flags = in[i].flags;     
     
    226228
    227229  for (i = 0; i < Nvalues; i++) {
    228     out[i].M     = in[i].M;     
    229     out[i].dM    = in[i].dM;     
     230    out[i].M             = in[i].MpsfChp;     
     231    out[i].dM            = in[i].dMpsfChp;     
     232
    230233    out[i].Mchisq= in[i].Mchisq;     
    231234    out[i].flags = in[i].flags;     
     
    267270    out[i].apmifit          = in[i].apmifit;
    268271    out[i].dapmifit         = in[i].dapmifit;
    269     out[i].Mcal             = in[i].Mcal;
     272
     273    out[i].McalPSF          = in[i].Mcal;
     274    out[i].McalAPER         = in[i].Mcal;
    270275    out[i].dMcal            = in[i].dMcal;
    271     out[i].Xm               = in[i].Xm;
     276    out[i].McalChiSq        = pow(10.0, 0.01*in[i].Xm);
     277
    272278    out[i].photcode         = in[i].photcode;
    273279    out[i].exptime          = in[i].exptime;
     
    332338    out[i].apmifit          = in[i].apmifit;
    333339    out[i].dapmifit         = in[i].dapmifit;
    334     out[i].Mcal             = in[i].Mcal;
     340
     341    out[i].Mcal             = in[i].McalPSF;
    335342    out[i].dMcal            = in[i].dMcal;
    336     out[i].Xm               = in[i].Xm;
     343    out[i].Xm               = 100.0*log10(in[i].McalChiSq);
     344
    337345    out[i].photcode         = in[i].photcode;
    338346    out[i].exptime          = in[i].exptime;
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V3.c

    r39457 r40291  
    1717    out[i].D          = ave[averef].D - in[i].dD / 3600.0;
    1818    out[i].M          = in[i].M;
    19     out[i].Mcal       = in[i].Mcal;
     19    out[i].McalPSF    = in[i].Mcal;
     20    out[i].McalAPER   = in[i].Mcal;
    2021    out[i].Map        = in[i].Map;
    2122    out[i].dM         = in[i].dM;
     
    7273    out[i].dD         = 3600.0*(ave[averef].D - in[i].D);
    7374    out[i].M          = in[i].M;
    74     out[i].Mcal       = in[i].Mcal;
     75    out[i].Mcal       = in[i].McalPSF;
    7576    out[i].Map        = in[i].Map;
    7677    out[i].dM         = in[i].dM;
     
    210211    dvo_secfilt_init (&out[i], SECFILT_RESET_ALL);
    211212
    212     out[i].M           = in[i].M;     
    213     out[i].Map         = in[i].Map;     
    214     out[i].dM          = in[i].dM;     
     213    out[i].MpsfChp     = in[i].M;     
     214    out[i].sMpsfChp    = in[i].Mstdev;     
     215    out[i].dMpsfChp    = in[i].dM;     
     216    out[i].MapChp      = in[i].Map;     
     217
    215218    out[i].Mchisq      = in[i].Mchisq;     
    216219    out[i].flags       = in[i].flags;     
     
    219222    out[i].Mmin        = in[i].M_20*0.001;     
    220223    out[i].Mmax        = in[i].M_80*0.001;     
    221     out[i].Mstdev      = in[i].Mstdev;     
    222224    out[i].ubercalDist = in[i].ubercalDist;     
    223225 }
     
    233235
    234236  for (i = 0; i < Nvalues; i++) {
    235     out[i].M           = in[i].M;     
    236     out[i].Map         = in[i].Map;     
    237     out[i].dM          = in[i].dM;     
     237    out[i].M             = in[i].MpsfChp;     
     238    out[i].dM            = in[i].dMpsfChp;     
     239    out[i].Mstdev        = in[i].sMpsfChp;     
     240    out[i].Map           = in[i].MapChp;     
     241
    238242    out[i].Mchisq      = in[i].Mchisq;     
    239243    out[i].flags       = in[i].flags;     
     
    242246    out[i].M_20        = in[i].Mmin*1000.0;     
    243247    out[i].M_80        = in[i].Mmax*1000.0;     
    244     out[i].Mstdev      = in[i].Mstdev;     
    245248    out[i].ubercalDist = in[i].ubercalDist;     
    246249  }
     
    277280    out[i].apmifit          = in[i].apmifit;
    278281    out[i].dapmifit         = in[i].dapmifit;
    279     out[i].Mcal             = in[i].Mcal;
     282
     283    out[i].McalPSF          = in[i].Mcal;
     284    out[i].McalAPER         = in[i].Mcal;
    280285    out[i].dMcal            = in[i].dMcal;
    281     out[i].Xm               = in[i].Xm;
     286    out[i].McalChiSq        = pow(10.0, 0.01*in[i].Xm);
     287
    282288    out[i].photcode         = in[i].photcode;
    283289    out[i].exptime          = in[i].exptime;
     
    342348    out[i].apmifit          = in[i].apmifit;
    343349    out[i].dapmifit         = in[i].dapmifit;
    344     out[i].Mcal             = in[i].Mcal;
     350
     351    out[i].Mcal             = in[i].McalPSF;
    345352    out[i].dMcal            = in[i].dMcal;
    346     out[i].Xm               = in[i].Xm;
     353    out[i].Xm               = 100.0*log10(in[i].McalChiSq);
     354
    347355    out[i].photcode         = in[i].photcode;
    348356    out[i].exptime          = in[i].exptime;
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c

    r39457 r40291  
    1717    out[i].D          = ave[averef].D - in[i].dD / 3600.0;
    1818    out[i].M          = in[i].M;
    19     out[i].Mcal       = in[i].Mcal;
     19    out[i].McalPSF    = in[i].Mcal;
     20    out[i].McalAPER   = in[i].Mcal;
    2021    out[i].Map        = in[i].Map;
    2122    out[i].Mkron      = in[i].Mkron;
     
    8182    out[i].dD         = 3600.0*(ave[averef].D - in[i].D);
    8283    out[i].M          = in[i].M;
    83     out[i].Mcal       = in[i].Mcal;
     84    out[i].Mcal       = in[i].McalPSF;
    8485    out[i].Map        = in[i].Map;
    8586    out[i].Mkron      = in[i].Mkron;
     
    234235    dvo_secfilt_init (&out[i], SECFILT_RESET_ALL);
    235236
    236     out[i].M             = in[i].M;     
    237     out[i].Map           = in[i].Map;     
    238     out[i].Mkron         = in[i].Mkron;     
    239     out[i].dMkron        = in[i].dMkron;     
    240     out[i].dM            = in[i].dM;     
     237    out[i].MpsfChp       = in[i].M;     
     238    out[i].sMpsfChp      = in[i].Mstdev;     
     239    out[i].dMpsfChp      = in[i].dM;     
     240    out[i].MapChp        = in[i].Map;     
     241    out[i].MkronChp      = in[i].Mkron;     
     242
    241243    out[i].Mchisq        = in[i].Mchisq;     
    242244    out[i].FpsfStk       = in[i].FluxPSF;
     
    249251    out[i].Mmin          = in[i].M_20*0.001;     
    250252    out[i].Mmax          = in[i].M_80*0.001;     
    251     out[i].Mstdev        = in[i].Mstdev;     
    252253    out[i].ubercalDist   = in[i].ubercalDist;     
    253254    out[i].stackPrmryOff = in[i].stackPrmryOff;     
     
    265266
    266267  for (i = 0; i < Nvalues; i++) {
    267     out[i].M             = in[i].M;     
    268     out[i].Map           = in[i].Map;     
    269     out[i].Mkron         = in[i].Mkron;     
    270     out[i].dMkron        = in[i].dMkron;     
    271     out[i].dM            = in[i].dM;     
     268    out[i].M             = in[i].MpsfChp;     
     269    out[i].dM            = in[i].dMpsfChp;     
     270    out[i].Mstdev        = in[i].sMpsfChp;     
     271    out[i].Map           = in[i].MapChp;     
     272    out[i].Mkron         = in[i].MkronChp;     
     273
    272274    out[i].Mchisq        = in[i].Mchisq;
    273275    out[i].FluxPSF       = in[i].FpsfStk;
     
    280282    out[i].M_20          = in[i].Mmin*1000.0;     
    281283    out[i].M_80          = in[i].Mmax*1000.0;     
    282     out[i].Mstdev        = in[i].Mstdev;     
    283284    out[i].ubercalDist   = in[i].ubercalDist;     
    284285    out[i].stackPrmryOff = in[i].stackPrmryOff;     
     
    317318    out[i].apmifit          = in[i].apmifit;
    318319    out[i].dapmifit         = in[i].dapmifit;
    319     out[i].Mcal             = in[i].Mcal;
     320
     321    out[i].McalPSF          = in[i].Mcal;
     322    out[i].McalAPER         = in[i].Mcal;
    320323    out[i].dMcal            = in[i].dMcal;
    321     out[i].Xm               = in[i].Xm;
     324    out[i].McalChiSq        = pow(10.0, 0.01*in[i].Xm);
     325
    322326    out[i].photcode         = in[i].photcode;
    323327    out[i].exptime          = in[i].exptime;
     
    382386    out[i].apmifit          = in[i].apmifit;
    383387    out[i].dapmifit         = in[i].dapmifit;
    384     out[i].Mcal             = in[i].Mcal;
     388
     389    out[i].Mcal             = in[i].McalPSF;
    385390    out[i].dMcal            = in[i].dMcal;
    386     out[i].Xm               = in[i].Xm;
     391    out[i].Xm               = 100.0*log10(in[i].McalChiSq);
     392
    387393    out[i].photcode         = in[i].photcode;
    388394    out[i].exptime          = in[i].exptime;
     
    513519    out[i].D          = ave[averef].D - in[i].dD / 3600.0;
    514520    out[i].M          = in[i].M;
    515     out[i].Mcal       = in[i].Mcal;
     521    out[i].McalPSF    = in[i].Mcal;
     522    out[i].McalAPER   = in[i].Mcal;
    516523    out[i].Map        = in[i].Map;
    517524    out[i].Mkron      = in[i].Mkron;
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c

    r39486 r40291  
    2222    out[i].Mkron      = in[i].Mkron;
    2323    out[i].dMkron     = in[i].dMkron;
    24     out[i].Mcal       = in[i].Mcal;
     24    out[i].McalPSF    = in[i].Mcal;
     25    out[i].McalAPER   = in[i].Mcal;
    2526    out[i].dMcal      = in[i].dMcal;
    2627    out[i].dt         = in[i].dt;
     
    9697    out[i].Mkron      = in[i].Mkron;
    9798    out[i].dMkron     = in[i].dMkron;
    98     out[i].Mcal       = in[i].Mcal;
     99    out[i].Mcal       = in[i].McalPSF;
    99100    out[i].dMcal      = in[i].dMcal;
    100101    out[i].dt         = in[i].dt;
     
    311312    dvo_secfilt_init (&out[i], SECFILT_RESET_ALL);
    312313
    313     out[i].M             = in[i].M;     
    314     out[i].dM            = in[i].dM;     
    315     out[i].Map           = in[i].Map;     
    316     out[i].dMap          = in[i].dMap;     
    317     out[i].sMap          = in[i].sMap;     
    318     out[i].Mkron         = in[i].Mkron;     
    319     out[i].dMkron        = in[i].dMkron;     
    320     out[i].sMkron        = in[i].sMkron;     
     314    out[i].MpsfChp       = in[i].M;     
     315    out[i].sMpsfChp      = in[i].Mstdev;     
     316    out[i].dMpsfChp      = in[i].dM;     
     317    out[i].MapChp        = in[i].Map;     
     318    out[i].dMapChp       = in[i].dMap;     
     319    out[i].sMapChp       = in[i].sMap;     
     320    out[i].MkronChp      = in[i].Mkron;     
     321    out[i].dMkronChp     = in[i].dMkron;     
     322    out[i].sMkronChp     = in[i].sMkron;     
    321323
    322324    out[i].psfQfMax      = in[i].psfQfMax;     
    323325    out[i].psfQfPerfMax  = in[i].psfQfPerfMax;     
    324326
    325     out[i].Mstdev        = in[i].Mstdev;     
    326327    out[i].Mmin          = in[i].Mmin;     
    327328    out[i].Mmax          = in[i].Mmax;     
     
    389390  for (i = 0; i < Nvalues; i++) {
    390391
    391     out[i].M             = in[i].M;     
    392     out[i].dM            = in[i].dM;     
    393     out[i].Map           = in[i].Map;     
    394     out[i].dMap          = in[i].dMap;     
    395     out[i].sMap          = in[i].sMap;     
    396     out[i].Mkron         = in[i].Mkron;     
    397     out[i].dMkron        = in[i].dMkron;     
    398     out[i].sMkron        = in[i].sMkron;     
     392    out[i].M             = in[i].MpsfChp;     
     393    out[i].dM            = in[i].dMpsfChp;     
     394    out[i].Mstdev        = in[i].sMpsfChp;     
     395    out[i].Map           = in[i].MapChp;     
     396    out[i].dMap          = in[i].dMapChp;     
     397    out[i].sMap          = in[i].sMapChp;     
     398    out[i].Mkron         = in[i].MkronChp;     
     399    out[i].dMkron        = in[i].dMkronChp;     
     400    out[i].sMkron        = in[i].sMkronChp;     
    399401
    400402    out[i].psfQfMax      = in[i].psfQfMax;     
    401403    out[i].psfQfPerfMax  = in[i].psfQfPerfMax;     
    402404
    403     out[i].Mstdev        = in[i].Mstdev;     
    404405    out[i].Mmin          = in[i].Mmin;     
    405406    out[i].Mmax          = in[i].Mmax;     
     
    11431144    out[i].apmifit          = in[i].apmifit;
    11441145    out[i].dapmifit         = in[i].dapmifit;
    1145     out[i].Mcal             = in[i].Mcal;
     1146
     1147    out[i].McalPSF          = in[i].Mcal;
     1148    out[i].McalAPER         = in[i].Mcal;
    11461149    out[i].dMcal            = in[i].dMcal;
    1147     out[i].Xm               = in[i].Xm;
     1150    out[i].McalChiSq        = pow(10.0, 0.01*in[i].Xm);
     1151
    11481152    out[i].photcode         = in[i].photcode;
    11491153    out[i].exptime          = in[i].exptime;
     
    12091213    out[i].apmifit          = in[i].apmifit;
    12101214    out[i].dapmifit         = in[i].dapmifit;
    1211     out[i].Mcal             = in[i].Mcal;
     1215
     1216    out[i].Mcal             = in[i].McalPSF;
    12121217    out[i].dMcal            = in[i].dMcal;
    1213     out[i].Xm               = in[i].Xm;
     1218    out[i].Xm               = 100.0*log10(in[i].McalChiSq);
     1219
    12141220    out[i].photcode         = in[i].photcode;
    12151221    out[i].exptime          = in[i].exptime;
     
    14951501    dvo_secfilt_init (&out[i], SECFILT_RESET_ALL);
    14961502
    1497     out[i].M             = in[i].M;     
    1498     out[i].dM            = in[i].dM;     
    1499     out[i].Map           = in[i].Map;     
    1500     out[i].dMap          = in[i].dMap;     
    1501     out[i].sMap          = in[i].sMap;     
    1502     out[i].Mkron         = in[i].Mkron;     
    1503     out[i].dMkron        = in[i].dMkron;     
    1504 
    1505     out[i].Mstdev        = in[i].Mstdev;     
     1503    out[i].MpsfChp       = in[i].M;     
     1504    out[i].dMpsfChp      = in[i].dM;     
     1505    out[i].sMpsfChp      = in[i].Mstdev;     
     1506    out[i].MapChp        = in[i].Map;     
     1507    out[i].dMapChp       = in[i].dMap;     
     1508    out[i].sMapChp       = in[i].sMap;     
     1509    out[i].MkronChp      = in[i].Mkron;     
     1510    out[i].dMkronChp     = in[i].dMkron;     
     1511    out[i].sMkronChp     = in[i].sMkron;     
     1512
    15061513    out[i].Mmin          = in[i].Mmin;     
    15071514    out[i].Mmax          = in[i].Mmax;     
     
    16681675    out[i].Mkron      = in[i].Mkron;
    16691676    out[i].dMkron     = in[i].dMkron;
    1670     out[i].Mcal       = in[i].Mcal;
     1677    out[i].McalPSF    = in[i].Mcal;
     1678    out[i].McalAPER   = in[i].Mcal;
    16711679    out[i].dMcal      = in[i].dMcal;
    16721680    out[i].dt         = in[i].dt;
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V5_LOAD.c

    r40063 r40291  
    2222    out[i].Mkron      = in[i].Mkron;
    2323    out[i].dMkron     = in[i].dMkron;
    24     out[i].Mcal       = in[i].Mcal;
     24    out[i].McalPSF    = in[i].Mcal;
     25    out[i].McalAPER   = in[i].Mcal;
    2526    out[i].dMcal      = in[i].dMcal;
    2627    out[i].dt         = in[i].dt;
     
    9697    out[i].Mkron      = in[i].Mkron;
    9798    out[i].dMkron     = in[i].dMkron;
    98     out[i].Mcal       = in[i].Mcal;
     99    out[i].Mcal       = in[i].McalPSF;
    99100    out[i].dMcal      = in[i].dMcal;
    100101    out[i].dt         = in[i].dt;
     
    221222    dvo_secfilt_init (&out[i], SECFILT_RESET_ALL);
    222223
    223     out[i].M             = in[i].M;     
     224    out[i].MpsfChp       = in[i].M;     
    224225    out[i].Ncode         = in[i].Ncode;
    225226    out[i].Nused         = in[i].Nused;
     
    237238  for (i = 0; i < Nvalues; i++) {
    238239
    239     out[i].M             = in[i].M;     
     240    out[i].M             = in[i].MpsfChp;     
    240241    out[i].Ncode         = in[i].Ncode;
    241242    out[i].Nused         = in[i].Nused;
     
    654655    out[i].apmifit          = in[i].apmifit;
    655656    out[i].dapmifit         = in[i].dapmifit;
    656     out[i].Mcal             = in[i].Mcal;
     657
     658    out[i].McalPSF          = in[i].Mcal;
     659    out[i].McalAPER         = in[i].Mcal;
    657660    out[i].dMcal            = in[i].dMcal;
    658     out[i].Xm               = in[i].Xm;
     661    out[i].McalChiSq        = pow(10.0, 0.01*in[i].Xm);
     662
    659663    out[i].photcode         = in[i].photcode;
    660664    out[i].exptime          = in[i].exptime;
     
    720724    out[i].apmifit          = in[i].apmifit;
    721725    out[i].dapmifit         = in[i].dapmifit;
    722     out[i].Mcal             = in[i].Mcal;
     726
     727    out[i].Mcal             = in[i].McalPSF;
    723728    out[i].dMcal            = in[i].dMcal;
    724     out[i].Xm               = in[i].Xm;
     729    out[i].Xm               = 100.0*log10(in[i].McalChiSq);
     730
    725731    out[i].photcode         = in[i].photcode;
    726732    out[i].exptime          = in[i].exptime;
  • trunk/Ohana/src/libdvo/src/dvo_convert_elixir.c

    r38462 r40291  
    2424    out[i].dM       = (in[i].dM      == NAN_U_CHAR)  ? NAN : in[i].dM     * 0.001;
    2525    out[i].dt       = (in[i].dt      == NAN_S_SHORT) ? NAN : in[i].dt     * 0.001;
    26     out[i].Mcal     = (in[i].Mcal    == NAN_S_SHORT) ? NAN : in[i].Mcal   * 0.001;
     26    out[i].McalPSF  = (in[i].Mcal    == NAN_S_SHORT) ? NAN : in[i].Mcal   * 0.001;
     27    out[i].McalAPER = (in[i].Mcal    == NAN_S_SHORT) ? NAN : in[i].Mcal   * 0.001;
    2728    out[i].Map      = (in[i].Mgal    == NAN_S_SHORT) ? NAN : in[i].Mgal   * 0.001;
    2829    out[i].airmass  = (in[i].airmass == NAN_S_SHORT) ? NAN : in[i].airmass* 0.001;
     
    7273    out[i].dM       = isnan(in[i].dM     ) ? NAN_U_CHAR  : in[i].dM      * 1000.0;
    7374    out[i].dt       = isnan(in[i].dt     ) ? NAN_S_SHORT : in[i].dt      * 1000.0;
    74     out[i].Mcal     = isnan(in[i].Mcal   ) ? NAN_S_SHORT : in[i].Mcal    * 1000.0;
     75    out[i].Mcal     = isnan(in[i].McalPSF) ? NAN_S_SHORT : in[i].McalPSF * 1000.0;
    7576    out[i].Mgal     = isnan(in[i].Map    ) ? NAN_S_SHORT : in[i].Map     * 1000.0;
    7677    out[i].airmass  = isnan(in[i].airmass) ? NAN_S_SHORT : in[i].airmass * 1000.0;
     
    109110
    110111    // changed for PANSTARRS_DEV_0 (moved from Average to Measure)
    111     primary[0][i].M     = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M  * 0.001;     
    112     primary[0][i].dM    = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM * 0.001;     
     112    primary[0][i].MpsfChp  = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M  * 0.001;     
     113    primary[0][i].dMpsfChp = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM * 0.001;     
    113114    primary[0][i].Mchisq= pow (10.0, 0.01*in[i].Xm);     
    114115
     
    142143
    143144    // changed for PANSTARRS_DEV_0 (moved from Average to Measure)
    144     out[i].M       = isnan(primary[i].M)  ? NAN_S_SHORT : primary[i].M   * 1000.0;
    145     out[i].dM      = isnan(primary[i].dM) ? NAN_S_SHORT : primary[i].dM  * 1000.0;
     145    out[i].M       = isnan(primary[i].MpsfChp)  ? NAN_S_SHORT : primary[i].MpsfChp   * 1000.0;
     146    out[i].dM      = isnan(primary[i].dMpsfChp) ? NAN_S_SHORT : primary[i].dMpsfChp  * 1000.0;
    146147    out[i].Xm      = 100.0*log10(primary[i].Mchisq);     
    147148
     
    172173
    173174    // added or changed for PANSTARRS_DEV_0
    174     out[i].M     = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M   * 0.001;
    175     out[i].dM    = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM  * 0.001;
     175    out[i].MpsfChp     = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M   * 0.001;
     176    out[i].dMpsfChp    = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM  * 0.001;
    176177  }
    177178  return (out);
     
    190191
    191192    // added or changed for PANSTARRS_DEV_0
    192     out[i].M     = isnan(in[i].M)  ? NAN_S_SHORT : in[i].M   * 1000.0;
    193     out[i].dM    = isnan(in[i].dM) ? NAN_S_SHORT : in[i].dM  * 1000.0;
     193    out[i].M     = isnan(in[i].MpsfChp)  ? NAN_S_SHORT : in[i].MpsfChp   * 1000.0;
     194    out[i].dM    = isnan(in[i].dMpsfChp) ? NAN_S_SHORT : in[i].dMpsfChp  * 1000.0;
    194195  }
    195196  return (out);
     
    223224    out[i].NX               = in[i].NX;
    224225    out[i].NY               = in[i].NY;
    225     out[i].Xm               = in[i].Xm;
    226226    out[i].photcode         = in[i].source;
    227227    out[i].exptime          = in[i].exptime;
     
    252252    out[i].apmifit          = (in[i].apmifit  == NAN_S_SHORT) ? NAN : in[i].apmifit  * 0.001;
    253253    out[i].dapmifit         = (in[i].dapmifit == NAN_S_SHORT) ? NAN : in[i].dapmifit * 0.001;
    254     out[i].Mcal             = (in[i].Mcal     == NAN_S_SHORT) ? NAN : in[i].Mcal     * 0.001;
     254
     255    out[i].McalPSF          = (in[i].Mcal     == NAN_S_SHORT) ? NAN : in[i].Mcal     * 0.001;
     256    out[i].McalAPER         = (in[i].Mcal     == NAN_S_SHORT) ? NAN : in[i].Mcal     * 0.001;
    255257    out[i].dMcal            = (in[i].dMcal    == NAN_S_SHORT) ? NAN : in[i].dMcal    * 0.001;
     258    out[i].McalChiSq        = (in[i].dMcal    == NAN_S_SHORT) ? NAN : pow(10.0, 0.01*in[i].Xm);
     259
    256260    out[i].sidtime          = NAN;
    257261    out[i].latitude         = NAN;
     
    295299    out[i].NY               = in[i].NY;
    296300
    297     out[i].Xm               = in[i].Xm;
    298301    out[i].source           = in[i].photcode;
    299302    out[i].exptime          = in[i].exptime;
     
    324327    out[i].apmifit          = isnan(in[i].apmifit ) ? NAN_S_SHORT : in[i].apmifit  * 1000.0;
    325328    out[i].dapmifit         = isnan(in[i].dapmifit) ? NAN_S_SHORT : in[i].dapmifit * 1000.0;
    326     out[i].Mcal             = isnan(in[i].Mcal    ) ? NAN_S_SHORT : in[i].Mcal     * 1000.0;
     329
     330    out[i].Mcal             = isnan(in[i].McalPSF ) ? NAN_S_SHORT : in[i].McalPSF  * 1000.0;
    327331    out[i].dMcal            = isnan(in[i].dMcal   ) ? NAN_S_SHORT : in[i].dMcal    * 1000.0;
     332    out[i].Xm               = isnan(in[i].dMcal   ) ? NAN_S_SHORT : 100.0*log10(in[i].McalChiSq);
    328333
    329334    // changed or added for PS1_V1
  • trunk/Ohana/src/libdvo/src/dvo_convert_loneos.c

    r38462 r40291  
    2626    out[i].M        = (in[i].M       == NAN_S_SHORT) ? NAN : in[i].M      * 0.001;
    2727    out[i].dM       = (in[i].dM      == NAN_U_CHAR)  ? NAN : in[i].dM     * 0.001;
    28     out[i].Mcal     = (in[i].Mcal    == NAN_S_SHORT) ? NAN : in[i].Mcal   * 0.001;
     28    out[i].McalPSF  = (in[i].Mcal    == NAN_S_SHORT) ? NAN : in[i].Mcal   * 0.001;
     29    out[i].McalAPER = (in[i].Mcal    == NAN_S_SHORT) ? NAN : in[i].Mcal   * 0.001;
    2930    out[i].Map      = (in[i].M       == NAN_S_SHORT) ? NAN : in[i].M      * 0.001;
    3031    out[i].photcode = in[i].source;
     
    5960    out[i].M      = isnan(in[i].M      ) ? NAN_S_SHORT : in[i].M       * 1000.0;
    6061    out[i].dM     = isnan(in[i].dM     ) ? NAN_U_CHAR  : in[i].dM      * 1000.0;
    61     out[i].Mcal   = isnan(in[i].Mcal   ) ? NAN_S_SHORT : in[i].Mcal    * 1000.0;
     62    out[i].Mcal   = isnan(in[i].McalPSF) ? NAN_S_SHORT : in[i].McalPSF * 1000.0;
    6263    out[i].source = in[i].photcode;
    6364    out[i].t      = in[i].t;
     
    8990
    9091    // changed for PANSTARRS_DEV_0 (moved from Average to Measure)
    91     primary[0][i].M    = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M  * 0.001;     
    92     primary[0][i].Mchisq= pow (10.0, 0.01*in[i].Xm);     
     92    primary[0][i].MpsfChp = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M  * 0.001;     
     93    primary[0][i].Mchisq  = pow (10.0, 0.01*in[i].Xm);     
    9394
    9495    // added for PANSTARRS_DEV_0
     
    123124
    124125    // changed for PANSTARRS_DEV_0 (moved from Average to Measure)
    125     out[i].M       = isnan(primary[i].M)  ? NAN_S_SHORT : primary[i].M   * 1000.0;
     126    out[i].M       = isnan(primary[i].MpsfChp)  ? NAN_S_SHORT : primary[i].MpsfChp   * 1000.0;
    126127    out[i].Xm      = 100.0*log10(primary[i].Mchisq);     
    127128
     
    152153
    153154    // added or changed for PANSTARRS_DEV_0
    154     out[i].M    = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M * 0.001;
     155    out[i].MpsfChp = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M * 0.001;
    155156  }
    156157  return (out);
     
    169170
    170171    // added or changed for PANSTARRS_DEV_0
    171     out[i].M    = isnan(in[i].M)  ? NAN_S_SHORT : in[i].M * 1000.0;
     172    out[i].M    = isnan(in[i].MpsfChp)  ? NAN_S_SHORT : in[i].MpsfChp * 1000.0;
    172173  }
    173174  return (out);
     
    202203    out[i].NY               = in[i].NY;
    203204
    204     out[i].Xm               = in[i].Xm;
    205205    out[i].photcode         = in[i].source;
    206206    out[i].exptime          = in[i].exptime;
     
    231231    out[i].apmifit          = (in[i].apmifit  == NAN_S_SHORT) ? NAN : in[i].apmifit  * 0.001;
    232232    out[i].dapmifit         = (in[i].dapmifit == NAN_S_SHORT) ? NAN : in[i].dapmifit * 0.001;
    233     out[i].Mcal             = (in[i].Mcal     == NAN_S_SHORT) ? NAN : in[i].Mcal     * 0.001;
     233
     234    out[i].McalPSF          = (in[i].Mcal     == NAN_S_SHORT) ? NAN : in[i].Mcal     * 0.001;
     235    out[i].McalAPER         = (in[i].Mcal     == NAN_S_SHORT) ? NAN : in[i].Mcal     * 0.001;
    234236    out[i].dMcal            = (in[i].dMcal    == NAN_S_SHORT) ? NAN : in[i].dMcal    * 0.001;
     237    out[i].McalChiSq        = (in[i].dMcal    == NAN_S_SHORT) ? NAN : pow(10.0, 0.01*in[i].Xm);
     238
    235239    out[i].sidtime          = NAN;
    236240    out[i].latitude         = NAN;
     
    274278    out[i].NY               = in[i].NY;
    275279
    276     out[i].Xm               = in[i].Xm;
    277280    out[i].source           = in[i].photcode;
    278281    out[i].exptime          = in[i].exptime;
     
    303306    out[i].apmifit          = isnan(in[i].apmifit ) ? NAN_S_SHORT : in[i].apmifit  * 1000.0;
    304307    out[i].dapmifit         = isnan(in[i].dapmifit) ? NAN_S_SHORT : in[i].dapmifit * 1000.0;
    305     out[i].Mcal             = isnan(in[i].Mcal    ) ? NAN_S_SHORT : in[i].Mcal     * 1000.0;
     308
     309    out[i].Mcal             = isnan(in[i].McalPSF ) ? NAN_S_SHORT : in[i].McalPSF  * 1000.0;
    306310    out[i].dMcal            = isnan(in[i].dMcal   ) ? NAN_S_SHORT : in[i].dMcal    * 1000.0;
     311    out[i].Xm               = isnan(in[i].dMcal   ) ? NAN_S_SHORT : 100.0*log10(in[i].McalChiSq);
    307312
    308313    // changed or added for PS1_V1
  • trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c

    r39457 r40291  
    1717    out[i].M          = in[i].M;
    1818    out[i].dM         = in[i].dM;
    19     out[i].Mcal       = in[i].Mcal;
     19    out[i].McalPSF    = in[i].Mcal;
     20    out[i].McalAPER   = in[i].Mcal;
    2021
    2122    out[i].airmass    = in[i].airmass;
     
    6869    out[i].M          = in[i].M;
    6970    out[i].dM         = in[i].dM;
    70     out[i].Mcal       = in[i].Mcal;
     71    out[i].Mcal       = in[i].McalPSF;
    7172    out[i].airmass    = in[i].airmass;
    7273    out[i].az         = in[i].az;
     
    188189    dvo_secfilt_init (&out[i], SECFILT_RESET_ALL);
    189190
    190     out[i].M     = in[i].M;     
    191     out[i].dM    = in[i].dM;     
     191    out[i].MpsfChp     = in[i].M;     
     192    out[i].dMpsfChp    = in[i].dM;     
     193
    192194    out[i].Mchisq= pow (10.0, 0.01*in[i].Xm);     
    193195    out[i].Ncode = in[i].Ncode;
     
    206208
    207209  for (i = 0; i < Nvalues; i++) {
    208     out[i].M     = in[i].M;     
    209     out[i].dM    = in[i].dM;     
     210    out[i].M             = in[i].MpsfChp;     
     211    out[i].dM            = in[i].dMpsfChp;     
     212
    210213    out[i].Xm    = 100.0*log10(in[i].Mchisq);     
    211214    out[i].Ncode = in[i].Ncode;
     
    245248    out[i].apmifit          = in[i].apmifit;
    246249    out[i].dapmifit         = in[i].dapmifit;
    247     out[i].Mcal             = in[i].Mcal;
     250
     251    out[i].McalPSF          = in[i].Mcal;
     252    out[i].McalAPER         = in[i].Mcal;
    248253    out[i].dMcal            = in[i].dMcal;
    249     out[i].Xm               = in[i].Xm;
     254    out[i].McalChiSq        = pow(10.0, 0.01*in[i].Xm);
     255
    250256    out[i].photcode         = in[i].photcode;
    251257    out[i].exptime          = in[i].exptime;
     
    316322    out[i].apmifit          = in[i].apmifit;
    317323    out[i].dapmifit         = in[i].dapmifit;
    318     out[i].Mcal             = in[i].Mcal;
     324
     325    out[i].Mcal             = in[i].McalPSF;
    319326    out[i].dMcal            = in[i].dMcal;
    320     out[i].Xm               = in[i].Xm;
     327    out[i].Xm               = 100.0*log10(in[i].McalChiSq);
     328
    321329    out[i].photcode         = in[i].photcode;
    322330    out[i].exptime          = in[i].exptime;
  • trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c

    r39457 r40291  
    1717    out[i].M          = in[i].M;
    1818    out[i].dM         = in[i].dM;
    19     out[i].Mcal       = in[i].Mcal;
     19    out[i].McalPSF    = in[i].Mcal;
     20    out[i].McalAPER   = in[i].Mcal;
    2021
    2122    out[i].airmass    = in[i].airmass;
     
    6869    out[i].M          = in[i].M;
    6970    out[i].dM         = in[i].dM;
    70     out[i].Mcal       = in[i].Mcal;
     71    out[i].Mcal       = in[i].McalPSF;
    7172    out[i].airmass    = in[i].airmass;
    7273    out[i].az         = in[i].az;
     
    188189    dvo_secfilt_init (&out[i], SECFILT_RESET_ALL);
    189190
    190     out[i].M     = in[i].M;     
    191     out[i].dM    = in[i].dM;     
     191    out[i].MpsfChp     = in[i].M;     
     192    out[i].dMpsfChp    = in[i].dM;     
     193
    192194    out[i].Mchisq= pow (10.0, 0.01*in[i].Xm);     
    193195    out[i].Ncode = in[i].Ncode;
     
    206208
    207209  for (i = 0; i < Nvalues; i++) {
    208     out[i].M     = in[i].M;     
    209     out[i].dM    = in[i].dM;     
     210    out[i].M             = in[i].MpsfChp;     
     211    out[i].dM            = in[i].dMpsfChp;     
     212
    210213    out[i].Xm    = 100.0*log10(in[i].Mchisq);     
    211214    out[i].Ncode = in[i].Ncode;
     
    245248    out[i].apmifit          = in[i].apmifit;
    246249    out[i].dapmifit         = in[i].dapmifit;
    247     out[i].Mcal             = in[i].Mcal;
     250
     251    out[i].McalPSF          = in[i].Mcal;
     252    out[i].McalAPER         = in[i].Mcal;
    248253    out[i].dMcal            = in[i].dMcal;
    249     out[i].Xm               = in[i].Xm;
     254    out[i].McalChiSq        = pow(10.0, 0.01*in[i].Xm);
     255
    250256    out[i].photcode         = in[i].photcode;
    251257    out[i].exptime          = in[i].exptime;
     
    316322    out[i].apmifit          = in[i].apmifit;
    317323    out[i].dapmifit         = in[i].dapmifit;
    318     out[i].Mcal             = in[i].Mcal;
     324
     325    out[i].Mcal             = in[i].McalPSF;
    319326    out[i].dMcal            = in[i].dMcal;
    320     out[i].Xm               = in[i].Xm;
     327    out[i].Xm               = 100.0*log10(in[i].McalChiSq);
     328
    321329    out[i].photcode         = in[i].photcode;
    322330    out[i].exptime          = in[i].exptime;
  • trunk/Ohana/src/libdvo/src/dvo_image.c

    r40063 r40291  
    223223  if (db[0].format == DVO_FORMAT_PS1_V4)          gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_V4");
    224224  if (db[0].format == DVO_FORMAT_PS1_V5)          gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_V5");
     225  if (db[0].format == DVO_FORMAT_PS1_V6)          gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_V6");
    225226  if (db[0].format == DVO_FORMAT_PS1_V5_LOAD)     gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_V5_LOAD");
    226227  if (db[0].format == DVO_FORMAT_PS1_REF)         gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_REF");
     
    256257  int start_size = header->datasize;
    257258
    258   long A = time(NULL);
     259  int PID = getpid();
     260  long A = PID + time(NULL);
    259261  srand48(A);
    260262 
     
    321323  gfits_define_bintable_column (header, "E",    "APMIFIT",          "aperture correction",             "mag",               1.0, 0.0);
    322324  gfits_define_bintable_column (header, "E",    "DAPMIFIT",         "apmifit error",                   "mag",               1.0, 0.0);
    323   gfits_define_bintable_column (header, "E",    "MCAL",             "calibration mag",                 "mag",               1.0, 0.0);
     325  gfits_define_bintable_column (header, "E",    "MCAL_PSF",         "calibration mag for psfs",        "mag",               1.0, 0.0);
     326  gfits_define_bintable_column (header, "E",    "MCAL_APER",        "calibration mag for aper",        "mag",               1.0, 0.0);
    324327  gfits_define_bintable_column (header, "E",    "DMCAL",            "error on Mcal",                   "mag",               1.0, 0.0);
    325   gfits_define_bintable_column (header, "I",    "XM",               "image chisq",                     "10*log(value)",     1.0, 0.0);
     328  gfits_define_bintable_column (header, "E",    "XM",               "image chisq",                     "10*log(value)",     1.0, 0.0);
     329  gfits_define_bintable_column (header, "I",    "PADDING",          "filler for 8-byte boundaries,",   "",                  1.0, 0.0);
    326330  gfits_define_bintable_column (header, "I",    "PHOTCODE",         "identifier for CCD,",             "",                  1.0, 0.0);
    327331  gfits_define_bintable_column (header, "E",    "EXPTIME",          "exposure time",                   "seconds",           1.0, 0.0);
  • trunk/Ohana/src/libdvo/src/dvo_image_raw.c

    r40063 r40291  
    6060  if (db[0].format == DVO_FORMAT_PS1_V4)          ImageSize = sizeof(Image_PS1_V4);
    6161  if (db[0].format == DVO_FORMAT_PS1_V5)          ImageSize = sizeof(Image_PS1_V5);
     62  if (db[0].format == DVO_FORMAT_PS1_V6)          ImageSize = sizeof(Image_PS1_V6);
    6263  if (db[0].format == DVO_FORMAT_PS1_V5_LOAD)     ImageSize = sizeof(Image_PS1_V5_LOAD);
    6364  if (db[0].format == DVO_FORMAT_PS1_REF)         ImageSize = sizeof(Image_PS1_REF);
     
    9394  if (db[0].format == DVO_FORMAT_PS1_V4)          gfits_table_mkheader_Image_PS1_V4 (&db[0].theader);
    9495  if (db[0].format == DVO_FORMAT_PS1_V5)          gfits_table_mkheader_Image_PS1_V5 (&db[0].theader);
     96  if (db[0].format == DVO_FORMAT_PS1_V6)          gfits_table_mkheader_Image_PS1_V6 (&db[0].theader);
    9597  if (db[0].format == DVO_FORMAT_PS1_V5_LOAD)     gfits_table_mkheader_Image_PS1_V5_LOAD (&db[0].theader);
    9698  if (db[0].format == DVO_FORMAT_PS1_REF)         gfits_table_mkheader_Image_PS1_REF (&db[0].theader);
  • trunk/Ohana/src/libdvo/src/dvo_photcode_ops.c

    r39670 r40291  
    381381
    382382  float Mraw = NAN;
     383  float Mcal = NAN;
    383384  switch (class) {
    384385    case MAG_CLASS_PSF:
    385386      Mraw = measure[0].M;
     387      Mcal = measure[0].McalPSF;
    386388      break;
    387389    case MAG_CLASS_KRON:
    388390      Mraw = measure[0].Mkron;
     391      Mcal = measure[0].McalAPER;
    389392      break;
    390393    case MAG_CLASS_APER:
    391394      Mraw = measure[0].Map;
     395      Mcal = measure[0].McalAPER;
    392396      break;
    393397    default:
     
    398402  }
    399403  float Mflat = isfinite(measure[0].Mflat) ? measure[0].Mflat : 0.0;
    400   float Mcat = Mraw - ZERO_POINT + code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C - measure[0].Mcal - Mflat;
     404  float Mcat = Mraw - ZERO_POINT + code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C - Mcal - Mflat;
    401405
    402406  /* for DEP, color must be made of PRI/SEC */
     
    479483      switch (class) {
    480484        case MAG_CLASS_PSF:
    481           Mave = secfilt[Ns].M;
     485          Mave = secfilt[Ns].MpsfChp;
    482486          break;
    483487        case MAG_CLASS_KRON:
    484           Mave = secfilt[Ns].Mkron;
     488          Mave = secfilt[Ns].MkronChp;
    485489          break;
    486490        case MAG_CLASS_APER:
    487           Mave = secfilt[Ns].Map;
     491          Mave = secfilt[Ns].MapChp;
    488492          break;
    489493        default:
     
    592596      switch (class) {
    593597        case MAG_CLASS_PSF:
    594           dMave = secfilt[Ns].dM;
     598          dMave = secfilt[Ns].dMpsfChp;
    595599          break;
    596600        case MAG_CLASS_KRON:
    597           dMave = secfilt[Ns].dMkron;
     601          dMave = secfilt[Ns].dMkronChp;
    598602          break;
    599603        case MAG_CLASS_APER:
    600           dMave = secfilt[Ns].dMap;
     604          dMave = secfilt[Ns].dMapChp;
    601605          break;
    602606        default:
     
    677681    Ns2 = photcodes[0].hashNsec[code[0].c2];
    678682 
    679     m1 = (Ns1 == -1) ? NAN : secfilt[Ns1].M;
    680     m2 = (Ns2 == -1) ? NAN : secfilt[Ns2].M;
     683    m1 = (Ns1 == -1) ? NAN : secfilt[Ns1].MpsfChp;
     684    m2 = (Ns2 == -1) ? NAN : secfilt[Ns2].MpsfChp;
    681685    mc = (isnan(m1) || isnan(m2)) ? NAN : (m1 - m2);
    682686    return (mc);
     
    694698  } else {
    695699    Ns = photcodes[0].hashNsec[color[0].code];
    696     m1 = (Ns == -1) ? NAN : secfilt[Ns].M;
     700    m1 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp;
    697701  }     
    698702
     
    708712  } else {
    709713    Ns = photcodes[0].hashNsec[color[0].code];
    710     m2 = (Ns == -1) ? NAN : secfilt[Ns].M;
     714    m2 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp;
    711715  }     
    712716  mc = (isnan(m1) || isnan(m2)) ? NAN : (m1 - m2);
     
    727731      switch (class) {
    728732        case MAG_CLASS_PSF:
    729           Mstdev = secfilt[Ns].Mstdev;
     733          Mstdev = secfilt[Ns].sMpsfChp;
    730734          break;
    731735        case MAG_CLASS_KRON:
    732           Mstdev = secfilt[Ns].sMkron;
     736          Mstdev = secfilt[Ns].sMkronChp;
    733737          break;
    734738        case MAG_CLASS_APER:
    735           Mstdev = secfilt[Ns].sMap;
     739          Mstdev = secfilt[Ns].sMapChp;
    736740          break;
    737741        default:
     
    10401044  } else {
    10411045    Ns = photcodes[0].hashNsec[code[0].code];
    1042     M1 = (Ns == -1) ? NAN : secfilt[Ns].M;
     1046    M1 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp;
    10431047  }     
    10441048
     
    10561060  } else {
    10571061    Ns = photcodes[0].hashNsec[code[0].code];
    1058     M2 = (Ns == -1) ? NAN : secfilt[Ns].M;
     1062    M2 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp;
    10591063  }     
    10601064 
     
    11301134
    11311135  // measure.M has the static ZERO_POINT (25.0) applied, but not measure.Flux
    1132   float Mcal = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C;
    1133   float Moff = Mcal - ZERO_POINT + 8.9;
    1134   float Foff = 3630.8 * MagToFlux(Mcal);
     1136  float Mzpt = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C;
     1137  float Moff = Mzpt - ZERO_POINT + 8.9;
     1138  float Foff = 3630.8 * MagToFlux(Mzpt);
    11351139  float Fcat = NAN;
    11361140  switch (class) {
     
    11581162
    11591163  // measure.M has the static ZERO_POINT (25.0) applied, but not measure.Flux
    1160   float Mcal = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C;
    1161   float Moff = Mcal - ZERO_POINT + 8.9;
    1162   float Foff = 3630.8 * MagToFlux(Mcal);
     1164  float Mzpt = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C;
     1165  float Moff = Mzpt - ZERO_POINT + 8.9;
     1166  float Foff = 3630.8 * MagToFlux(Mzpt);
    11631167  float Fcat = NAN;
    11641168  switch (class) {
     
    12031207
    12041208  // measure.M has the static ZERO_POINT (25.0) applied, but not measure.Flux
     1209
     1210  // use Mcal APER for aperture-like data
     1211  float Mcal = (class == MAG_CLASS_PSF) ? measure[0].McalPSF : measure[0].McalAPER;
    12051212  float Mflat = isfinite(measure[0].Mflat) ? measure[0].Mflat : 0.0;
    1206   float Mcal = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C - measure[0].Mcal - Mflat;
    1207   float Moff = Mcal - ZERO_POINT + 8.9;
    1208   float Foff = 3630.8 * MagToFlux(Mcal);
     1213
     1214  float Mzpt = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C - Mcal - Mflat;
     1215  float Moff = Mzpt - ZERO_POINT + 8.9;
     1216  float Foff = 3630.8 * MagToFlux(Mzpt);
    12091217  float Fcat = NAN;
    12101218  switch (class) {
     
    12891297      switch (class) {
    12901298        case MAG_CLASS_PSF:
    1291           Fave = MagToFlux(secfilt[Ns].M - 8.9);
     1299          Fave = MagToFlux(secfilt[Ns].MpsfChp - 8.9);
    12921300          break;
    12931301        case MAG_CLASS_KRON:
    1294           Fave = MagToFlux(secfilt[Ns].Mkron - 8.9);
     1302          Fave = MagToFlux(secfilt[Ns].MkronChp - 8.9);
    12951303          break;
    12961304        case MAG_CLASS_APER:
    1297           Fave = MagToFlux(secfilt[Ns].Map - 8.9);
     1305          Fave = MagToFlux(secfilt[Ns].MapChp - 8.9);
    12981306          break;
    12991307        default:
     
    13501358      switch (class) {
    13511359        case MAG_CLASS_PSF:
    1352           dFave = secfilt[Ns].dM * MagToFlux(secfilt[Ns].M - 8.9);
     1360          dFave = secfilt[Ns].dMpsfChp * MagToFlux(secfilt[Ns].MpsfChp - 8.9);
    13531361          break;
    13541362        case MAG_CLASS_KRON:
    1355           dFave = secfilt[Ns].dMkron * MagToFlux(secfilt[Ns].Mkron - 8.9);
     1363          dFave = secfilt[Ns].dMkronChp * MagToFlux(secfilt[Ns].MkronChp - 8.9);
    13561364          break;
    13571365        case MAG_CLASS_APER:
    1358           dFave = secfilt[Ns].dMap * MagToFlux(secfilt[Ns].Map - 8.9);
     1366          dFave = secfilt[Ns].dMapChp * MagToFlux(secfilt[Ns].MapChp - 8.9);
    13591367          break;
    13601368        default:
     
    14701478
    14711479  // measure.M has the static ZERO_POINT (25.0) applied, but not measure.Flux
    1472   float Mcal = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C;
    1473   float Moff = Mcal - ZERO_POINT + 8.9;
    1474   float Foff = 3630.8 * MagToFlux(Mcal);
     1480  float Mzpt = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C;
     1481  float Moff = Mzpt - ZERO_POINT + 8.9;
     1482  float Foff = 3630.8 * MagToFlux(Mzpt);
    14751483
    14761484  // use dFlux if we can, but use dMag if we must:
     
    15161524
    15171525  // measure.M has the static ZERO_POINT (25.0) applied, but not measure.Flux
    1518   float Mcal = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C;
    1519   float Moff = Mcal - ZERO_POINT + 8.9;
    1520   float Foff = 3630.8 * MagToFlux(Mcal);
     1526  float Mzpt = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C;
     1527  float Moff = Mzpt - ZERO_POINT + 8.9;
     1528  float Foff = 3630.8 * MagToFlux(Mzpt);
    15211529
    15221530  // use dFlux if we can, but use dMag if we must:
     
    15791587
    15801588  // measure.M has the static ZERO_POINT (25.0) applied, but not measure.Flux
     1589  // XXX fix this too:
    15811590  float Mflat = isfinite(measure[0].Mflat) ? measure[0].Mflat : 0.0;
    1582   float Mcal = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C - measure[0].Mcal - Mflat;
    1583   float Moff = Mcal - ZERO_POINT + 8.9;
    1584   float Foff = 3630.8 * MagToFlux(Mcal);
     1591  float Mcal = (class == MAG_CLASS_PSF) ? measure[0].McalPSF : measure[0].McalAPER;
     1592
     1593  float Mzpt = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C - Mcal - Mflat;
     1594  float Moff = Mzpt - ZERO_POINT + 8.9;
     1595  float Foff = 3630.8 * MagToFlux(Mzpt);
    15851596
    15861597  // use dFlux if we can, but use dMag if we must:
     
    16491660      break;
    16501661    case MAG_CLASS_KRON:
    1651       // Mraw = measure[0].Mkron;
     1662      Mraw = measure[0].Mkron;
    16521663      break;
    16531664    case MAG_CLASS_APER:
    1654       // Mraw = measure[0].Map;
     1665      // Mraw = measure[0].Map; // MeasureTiny does not have Map
    16551666      break;
    16561667    default:
     
    16771688      break;
    16781689    case MAG_CLASS_KRON:
    1679       // Mraw = measure[0].Mkron;
     1690      Mraw = measure[0].Mkron;
    16801691      break;
    16811692    case MAG_CLASS_APER:
    1682       // Mraw = measure[0].Map;
     1693      // Mraw = measure[0].Map; // MeasureTiny does not have Map
    16831694      break;
    16841695    default:
     
    17061717      break;
    17071718    case MAG_CLASS_KRON:
    1708       // Mraw = measure[0].Mkron;
     1719      Mraw = measure[0].Mkron;
    17091720      break;
    17101721    case MAG_CLASS_APER:
    1711       // Mraw = measure[0].Map;
     1722      // Mraw = measure[0].Map; // MeasureTiny does not have Map
    17121723      break;
    17131724    default:
     
    17421753
    17431754  float Mraw = NAN;
     1755  float Mcal = NAN;
    17441756  switch (class) {
    17451757    case MAG_CLASS_PSF:
    17461758      Mraw = measure[0].M;
     1759      Mcal = measure[0].McalPSF;
    17471760      break;
    17481761    case MAG_CLASS_KRON:
    1749       // Mraw = measure[0].Mkron;
     1762      Mraw = measure[0].Mkron;
     1763      Mcal = measure[0].McalAPER;
    17501764      break;
    17511765    case MAG_CLASS_APER:
    1752       // Mraw = measure[0].Map;
     1766      // Mraw = measure[0].Map; // MeasureTiny does not have Map
     1767      // Mcal = measure[0].McalAPER;
    17531768      break;
    17541769    default:
     
    17591774  }
    17601775  float Mflat = isfinite(measure[0].Mflat) ? measure[0].Mflat : 0.0;
    1761   float Mcat = Mraw - ZERO_POINT + code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C - measure[0].Mcal - Mflat;
     1776  float Mcat = Mraw - ZERO_POINT + code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C - Mcal - Mflat;
    17621777
    17631778  /* for DEP, color must be made of PRI/SEC */
     
    17991814        break;
    18001815      case MAG_CLASS_KRON:
    1801         // Mraw = thisone[0].Mkron;
     1816        Mraw = thisone[0].Mkron;
    18021817        break;
    18031818      case MAG_CLASS_APER:
    1804         // Mraw = thisone[0].Map;
     1819        // Mraw = thisone[0].Map; // MeasureTiny does not have Map
    18051820        break;
    18061821      default:
     
    18401855      switch (class) {
    18411856        case MAG_CLASS_PSF:
    1842           Mave = secfilt[Ns].M;
     1857          Mave = secfilt[Ns].MpsfChp;
    18431858          break;
    18441859        case MAG_CLASS_KRON:
    1845           Mave = secfilt[Ns].Mkron;
     1860          Mave = secfilt[Ns].MkronChp;
    18461861          break;
    18471862        case MAG_CLASS_APER:
    1848           Mave = secfilt[Ns].Map;
     1863          Mave = secfilt[Ns].MapChp;
    18491864          break;
    18501865        default:
     
    19271942    Ns2 = photcodes[0].hashNsec[code[0].c2];
    19281943 
    1929     m1 = (Ns1 == -1) ? NAN : secfilt[Ns1].M;
    1930     m2 = (Ns2 == -1) ? NAN : secfilt[Ns2].M;
     1944    m1 = (Ns1 == -1) ? NAN : secfilt[Ns1].MpsfChp;
     1945    m2 = (Ns2 == -1) ? NAN : secfilt[Ns2].MpsfChp;
    19311946    mc = (isnan(m1) || isnan(m2)) ? NAN : (m1 - m2);
    19321947    return (mc);
     
    19441959  } else {
    19451960    Ns = photcodes[0].hashNsec[color[0].code];
    1946     m1 = (Ns == -1) ? NAN : secfilt[Ns].M;
     1961    m1 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp;
    19471962  }     
    19481963
     
    19581973  } else {
    19591974    Ns = photcodes[0].hashNsec[color[0].code];
    1960     m2 = (Ns == -1) ? NAN : secfilt[Ns].M;
     1975    m2 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp;
    19611976  }     
    19621977  mc = (isnan(m1) || isnan(m2)) ? NAN : (m1 - m2);
     
    19731988
    19741989  Ns = photcodes[0].hashNsec[code[0].code];
    1975   dM  = (Ns == -1) ? NAN : secfilt[Ns].dM;
     1990  dM  = (Ns == -1) ? NAN : secfilt[Ns].dMpsfChp;
    19761991  return (dM);
    19771992}
     
    20102025  } else {
    20112026    Ns = photcodes[0].hashNsec[code[0].code];
    2012     M1 = (Ns == -1) ? NAN : secfilt[Ns].M;
     2027    M1 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp;
    20132028  }     
    20142029
     
    20262041  } else {
    20272042    Ns = photcodes[0].hashNsec[code[0].code];
    2028     M2 = (Ns == -1) ? NAN : secfilt[Ns].M;
     2043    M2 = (Ns == -1) ? NAN : secfilt[Ns].MpsfChp;
    20292044  }     
    20302045 
  • trunk/Ohana/src/libdvo/src/dvo_tiny_values.c

    r39457 r40291  
    1919  measureT[0].D          = measure[0].D;
    2020  measureT[0].M          = measure[0].M;
    21   measureT[0].Mcal       = measure[0].Mcal;
     21  measureT[0].Mkron      = measure[0].Mkron;
     22  measureT[0].McalPSF    = measure[0].McalPSF;
     23  measureT[0].McalAPER   = measure[0].McalAPER;
    2224  measureT[0].dM         = measure[0].dM;
    2325  measureT[0].airmass    = measure[0].airmass;
Note: See TracChangeset for help on using the changeset viewer.