IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 30, 2012, 10:06:05 AM (14 years ago)
Author:
eugene
Message:

merge from eam/20120905 (updates to delstar, setposangle, update to ps1-v4 schema to add measure.Xoff,Yoff)

Location:
trunk/Ohana/src/libdvo
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libdvo/doc/notes.txt

    r34260 r34749  
    1717
    18184) create a DVOTableFormat entry for the new format
    19    (libdvo/include/dvo.h).  the naming convetion is DVO_FORMAT_FOO.
     19   (libdvo/include/dvo.h).  the naming convention is DVO_FORMAT_FOO.
    2020
    21215) add an entry for the new format in dvo_catalog_catformat
  • trunk/Ohana/src/libdvo/include/dvo.h

    r34717 r34749  
    175175  ID_OBJ_GOOD       = 0x04000000, // good-quality measurement in our data (eg,PS)
    176176  ID_OBJ_GOOD_ALT   = 0x08000000, // good-quality measurement in  external data (eg, 2MASS)
     177  ID_OBJ_GOOD_STACK = 0x10000000, // good-quality object in the stack (> 1 good stack)
     178  ID_OBJ_SUSPECT_STACK = 0x20000000, // suspect object in the stack (> 1 good or suspect stack, < 2 good)
     179  ID_OBJ_BAD_STACK  = 0x40000000, // good-quality object in the stack (> 1 good stack)
    177180} DVOAverageFlags;
    178181
  • trunk/Ohana/src/libdvo/include/dvodb.h

    r34620 r34749  
    122122      MEAS_XCCD_ERR,
    123123      MEAS_YCCD_ERR,
     124      MEAS_XOFF,
     125      MEAS_YOFF,
    124126      MEAS_POS_SYS_ERR,
    125127      MEAS_XMOSAIC,
  • trunk/Ohana/src/libdvo/src/LoadPhotcodes.c

    r28246 r34749  
    1111  }
    1212
     13  if (!master_file) return FALSE;
     14
    1315  /* next try to load the photcodes from the master text photcode file */
    1416  /* automatically (or on demand?) save the text file to the FITS version */
  • trunk/Ohana/src/libdvo/src/dbExtractMeasures.c

    r34405 r34749  
    385385      value.Flt = FromShortDegrees(measure[0].theta);
    386386      break;
     387
     388    case MEAS_POSANGLE: /* OK */
     389      value.Flt = FromShortDegrees(measure[0].posangle);
     390      break;
     391    case MEAS_PLATESCALE: /* OK */
     392      value.Flt = measure[0].pltscale;
     393      break;
     394
    387395    case MEAS_MXX: /* OK */
    388396      value.Flt = FromShortPixels(measure[0].Mxx);
     
    435443# endif
    436444      break;
     445    case MEAS_XOFF: /* OK */
     446      value.Flt = measure[0].Xoff;
     447      break;
     448    case MEAS_YOFF: /* OK */
     449      value.Flt = measure[0].Yoff;
     450      break;
    437451    case MEAS_XCCD_ERR: /* OK */
    438452      value.Flt = FromShortPixels(measure[0].dXccd);
  • trunk/Ohana/src/libdvo/src/dbFields.c

    r34620 r34749  
    217217  if (!strcasecmp (fieldName, "XCCD:ERR"))       ESCAPE (MEAS_XCCD_ERR,       MAG_NONE, OPIHI_FLT);
    218218  if (!strcasecmp (fieldName, "YCCD:ERR"))       ESCAPE (MEAS_YCCD_ERR,       MAG_NONE, OPIHI_FLT);
     219  if (!strcasecmp (fieldName, "XOFF"))           ESCAPE (MEAS_XOFF,           MAG_NONE, OPIHI_FLT);
     220  if (!strcasecmp (fieldName, "YOFF"))           ESCAPE (MEAS_YOFF,           MAG_NONE, OPIHI_FLT);
    219221  if (!strcasecmp (fieldName, "POS_SYS_ERR"))    ESCAPE (MEAS_POS_SYS_ERR,    MAG_NONE, OPIHI_FLT);
    220222  if (!strcasecmp (fieldName, "XMOSAIC"))        ESCAPE (MEAS_XMOSAIC,        MAG_NONE, OPIHI_FLT);
     
    228230  if (!strcasecmp (fieldName, "CATID"))          ESCAPE (MEAS_CAT_ID,         MAG_NONE, OPIHI_INT);
    229231  if (!strcasecmp (fieldName, "IMAGEID"))        ESCAPE (MEAS_IMAGE_ID,       MAG_NONE, OPIHI_INT);
     232  if (!strcasecmp (fieldName, "EXTERNID"))       ESCAPE (MEAS_EXTERN_ID,      MAG_NONE, OPIHI_INT);
    230233  if (!strcasecmp (fieldName, "PSF_QF"))         ESCAPE (MEAS_PSF_QF,         MAG_NONE, OPIHI_FLT);
    231234  if (!strcasecmp (fieldName, "PSF_QF_PERFECT")) ESCAPE (MEAS_PSF_QF_PERFECT, MAG_NONE, OPIHI_FLT);
     
    237240  if (!strcasecmp (fieldName, "SKY"))            ESCAPE (MEAS_SKY,            MAG_NONE, OPIHI_FLT);
    238241  if (!strcasecmp (fieldName, "SKY_ERR"))        ESCAPE (MEAS_dSKY,           MAG_NONE, OPIHI_FLT);
    239   if (!strcasecmp (fieldName, "externID"))       ESCAPE (MEAS_EXTERN_ID,      MAG_NONE, OPIHI_INT);
    240242  if (!strcasecmp (fieldName, "MCAL_OFFSET"))    ESCAPE (MEAS_MCAL_OFFSET,    MAG_NONE, OPIHI_FLT);
    241243  if (!strcasecmp (fieldName, "FLAT"))           ESCAPE (MEAS_FLAT,           MAG_NONE, OPIHI_FLT);
  • trunk/Ohana/src/libdvo/src/dvo_catalog.c

    r34620 r34749  
    8383  average->dP              = 0;
    8484
    85   average->ChiSqAve        = 0.0;
    86   average->ChiSqPM         = 0.0;
    87   average->ChiSqPar        = 0.0;
     85  average->ChiSqAve        = NAN;
     86  average->ChiSqPM         = NAN;
     87  average->ChiSqPar        = NAN;
    8888  average->Tmean           = 0;
    8989  average->Trange          = 0;
    9090
    91   average->psfQF           = 0.0;
    92   average->psfQFperf       = 0.0;
     91  average->psfQF           = NAN;
     92  average->psfQFperf       = NAN;
    9393
    9494  average->stargal         = 0.0;
     
    161161 measure->Xccd      = NAN;
    162162 measure->Yccd      = NAN;
     163 measure->Xoff      = 0.0;
     164 measure->Yoff      = 0.0;
    163165
    164166 measure->Sky       = NAN;
     
    176178
    177179 measure->psfQF     = NAN;
     180 measure->psfQFperf = NAN;
    178181 measure->psfChisq  = NAN;
    179182 measure->psfNdof   = 0;
  • trunk/Ohana/src/libdvo/src/dvo_catalog_split.c

    r33963 r34749  
    8383    return (FALSE);
    8484  }
     85  off_t fullsize = catalog->header.datasize;
    8586
    8687  // write the PHU matrix; this is probably a NOP, do I have to keep it in?
     
    9192    return (FALSE);
    9293  }
     94  fullsize += matrix.datasize;
    9395  gfits_free_matrix (&matrix);
    9496
     
    98100    return (FALSE);
    99101  }
     102  fullsize += ftable->datasize + ftable->header->datasize;
     103
     104  // if the output file will be completely re-written, truncate to total datasize
     105  if ((start == 0) && (Nrows == Ntotal)) {
     106    int fd = fileno (catalog->f);
     107    if (ftruncate (fd, fullsize)) {
     108      perror ("dvo_catalog_save_subset: ");
     109      return (FALSE);
     110    }
     111  }
     112
    100113  return (TRUE);
    101114}
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c

    r34620 r34749  
    1111
    1212  for (i = 0; i < Nvalues; i++) {
     13    dvo_measure_init (&out[i]);
    1314    out[i].dR         = in[i].dR;
    1415    out[i].dD         = in[i].dD;
     
    4041    out[i].photFlags  = in[i].photFlags;
    4142
    42     // changed or added for PS1_DEV_2
     43    // changed for PS1_DEV_2
    4344    out[i].Map        = in[i].Mgal;
    44     out[i].dMcal      = 0;
    45 
    46     // changed or added for PS1_V1
     45
     46    // changed for PS1_V1
    4747    out[i].photFlags  = in[i].photFlags | (in[i].dophot << 16);
    48     out[i].t_msec     = 0;
    49     out[i].extID      = 0;
    50     out[i].objID      = 0;
    51     out[i].catID      = 0;
    52     out[i].Mxx        = 0.0;
    53     out[i].Mxy        = 0.0;
    54     out[i].Myy        = 0.0;
    55     out[i].posangle   = 0;
    56     out[i].pltscale   = 0;
    57     out[i].psfNdof    = 0;
    58     out[i].psfNpix    = 0;
    59 
    60     // added for PS1_V4
    61     out[i].Mkron      = NAN;
    62     out[i].dMkron     = NAN;
    63     out[i].FluxPSF    = NAN;
    64     out[i].dFluxPSF   = NAN;
    65     out[i].FluxKron   = NAN;
    66     out[i].dFluxKron  = NAN;
    67     out[i].psfQFperf  = NAN;
    6848  }
    6949  return (out);
     
    125105
    126106  for (i = 0; i < Nvalues; i++) {
     107    dvo_average_init (&out[i]);
     108
    127109    out[i].R             = in[i].R;     
    128110    out[i].D             = in[i].D;     
     
    138120    out[i].catID         = in[i].catID;
    139121
    140     // changed or added for PS1_DEV_2
     122    // changed for PS1_DEV_2
    141123    out[i].Nmeasure      = in[i].Nm;     
    142124    out[i].Nmissing      = in[i].Nn;     
    143125    out[i].measureOffset = in[i].offset;
    144126    out[i].missingOffset = in[i].missing;
    145     out[i].Nextend       = 0;
    146     out[i].extendOffset  = 0;
    147 
    148     // changed or added for PS1_V1
     127
     128    // changed for PS1_V1
    149129    out[i].flags         = in[i].code;   
    150     out[i].ChiSqAve      = NAN;
    151     out[i].ChiSqPM       = NAN;
    152     out[i].ChiSqPar      = NAN;
    153     out[i].Tmean         = 0;
    154     out[i].Trange        = 0;
    155     out[i].Npos          = 0.0;
    156     out[i].extID         = 0;
    157 
    158     // added in PS1_V3
    159     out[i].photFlagsUpper = 0;
    160     out[i].photFlagsLower = 0;
    161 
    162     // added for PS1_V4 (Xp dropped in V4 onward, was not really used anyway)
    163     out[i].psfQF         = NAN;
    164     out[i].psfQFperf     = NAN;
    165     out[i].stargal       = NAN;
     130
     131    // PS1_V4 : Xp dropped in V4 onward, was not really used anyway
    166132  }
    167133  return (out);
     
    210176
    211177  for (i = 0; i < Nvalues; i++) {
     178    dvo_secfilt_init (&out[i]);
     179
    212180    out[i].M     = in[i].M;     
    213181    out[i].dM    = in[i].dM;     
     
    215183    out[i].Ncode = in[i].Ncode;
    216184    out[i].Nused = in[i].Nused;
    217 
    218     // changed or added for PS1_V1
    219     out[i].M_20  = 0;     
    220     out[i].M_80  = 0;     
    221 
    222     // changed or added for PS1_V2
    223     out[i].flags = 0;
    224 
    225     // added in PS1_V3
    226     out[i].Map         = 0;
    227     out[i].Mstdev      = 0;
    228     out[i].ubercalDist = 0;
    229 
    230     // added for PS1_V4
    231     out[i].Mkron       = NAN;
    232     out[i].dMkron      = NAN;
    233     out[i].FluxPSF     = NAN;
    234     out[i].dFluxPSF    = NAN;
    235     out[i].FluxKron    = NAN;
    236     out[i].dFluxKron   = NAN;
    237     out[i].stackDetectID     = 0;
    238185 }
    239186  return (out);
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c

    r34620 r34749  
    1111
    1212  for (i = 0; i < Nvalues; i++) {
     13    dvo_measure_init (&out[i]);
    1314    out[i].dR         = in[i].dR;
    1415    out[i].dD         = in[i].dD;
     
    4142    out[i].dbFlags    = in[i].dbFlags;
    4243
    43     // changed or added for PS1_V1
     44    // changed for PS1_V1
    4445    out[i].photFlags  = in[i].photFlags | (in[i].dophot << 16);
    45     out[i].t_msec     = 0;
    46     out[i].extID      = 0;
    47     out[i].objID      = 0;
    48     out[i].catID      = 0;
    49     out[i].Mxx        = 0.0;
    50     out[i].Mxy        = 0.0;
    51     out[i].Myy        = 0.0;
    52     out[i].posangle   = 0;
    53     out[i].pltscale   = 0;
    54     out[i].psfNdof    = 0;
    55     out[i].psfNpix    = 0;
    56 
    57     // added for PS1_V4
    58     out[i].Mkron      = NAN;
    59     out[i].dMkron     = NAN;
    60     out[i].FluxPSF    = NAN;
    61     out[i].dFluxPSF   = NAN;
    62     out[i].FluxKron   = NAN;
    63     out[i].dFluxKron  = NAN;
    64     out[i].psfQFperf  = NAN;
    6546 }
    6647  return (out);
     
    121102
    122103  for (i = 0; i < Nvalues; i++) {
     104    dvo_average_init (&out[i]);
     105
    123106    out[i].R             = in[i].R;     
    124107    out[i].D             = in[i].D;     
     
    140123    out[i].catID         = in[i].catID;
    141124
    142     // changed or added for PS1_V1
     125    // changed for PS1_V1
    143126    out[i].flags         = in[i].code;   
    144     out[i].ChiSqAve      = NAN;
    145     out[i].ChiSqPM       = NAN;
    146     out[i].ChiSqPar      = NAN;
    147     out[i].Tmean         = 0;
    148     out[i].Trange        = 0;
    149     out[i].Npos          = 0.0;
    150     out[i].extID         = 0;
    151 
    152     // added in PS1_V3
    153     out[i].photFlagsUpper = 0;
    154     out[i].photFlagsLower = 0;
    155 
    156     // added for PS1_V4 (Xp dropped in V4 onward, was not really used anyway)
    157     out[i].psfQF         = NAN;
    158     out[i].psfQFperf     = NAN;
    159     out[i].stargal       = NAN;
    160127  }
    161128  return (out);
     
    204171
    205172  for (i = 0; i < Nvalues; i++) {
     173    dvo_secfilt_init (&out[i]);
     174
    206175    out[i].M     = in[i].M;     
    207176    out[i].dM    = in[i].dM;     
     
    209178    out[i].Ncode = in[i].Ncode;
    210179    out[i].Nused = in[i].Nused;
    211 
    212     // changed or added for PS1_V1
    213     out[i].M_20  = 0;     
    214     out[i].M_80  = 0;     
    215 
    216     // changed or added for PS1_V2
    217     out[i].flags = 0;
    218 
    219     // added in PS1_V3
    220     out[i].Map         = 0;
    221     out[i].Mstdev      = 0;
    222     out[i].ubercalDist = 0;
    223 
    224     // added for PS1_V4
    225     out[i].Mkron       = NAN;
    226     out[i].dMkron      = NAN;
    227     out[i].FluxPSF     = NAN;
    228     out[i].dFluxPSF    = NAN;
    229     out[i].FluxKron    = NAN;
    230     out[i].dFluxKron   = NAN;
    231     out[i].stackDetectID     = 0;
    232180 }
    233181  return (out);
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_REF.c

    r34620 r34749  
    1111
    1212  for (i = 0; i < Nvalues; i++) {
     13    dvo_measure_init (&out[i]);
     14
    1315    out[i].dR         = in[i].dR;
    1416    out[i].dD         = in[i].dD;
    1517    out[i].M          = in[i].M;
    16     out[i].Mcal       = 0.0;
    17     out[i].Map        = NAN;
    1818    out[i].dM         = in[i].dM;
    19     out[i].dMcal      = 0.0;
    2019    out[i].dt         = in[i].dt;
    21     out[i].airmass    = NAN;
    22     out[i].az         = NAN;
    23     out[i].Xccd       = NAN;
    24     out[i].Yccd       = NAN;
    25     out[i].Sky        = NAN;
    26     out[i].dSky       = NAN;
    2720    out[i].t          = in[i].t;
    28     out[i].t_msec     = 0;
    2921    out[i].averef     = in[i].averef;
    30     out[i].detID      = 0;
    31     out[i].imageID    = 0;
    3222    out[i].objID      = in[i].objID;
    3323    out[i].catID      = in[i].catID;
    34     out[i].extID      = 0;
    3524    out[i].psfQF      = 1.0; // we do not save a value, but some operations (relphot/average) filter on this value..
    36     out[i].psfChisq   = NAN;
    37     out[i].psfNdof    = 0;
    38     out[i].psfNpix    = 0;
    39     out[i].crNsigma   = NAN;
    40     out[i].extNsigma  = NAN;
    41     out[i].FWx        = 0;
    42     out[i].FWy        = 0;
    43     out[i].theta      = 0;
    44     out[i].Mxx        = 0;
    45     out[i].Mxy        = 0;
    46     out[i].Myy        = 0;
    47     out[i].dXccd      = 0;
    48     out[i].dYccd      = 0;
    49     out[i].posangle   = 0;
    50     out[i].pltscale   = NAN;
    5125    out[i].photcode   = in[i].photcode;
    52     out[i].dbFlags    = 0;
    53     out[i].photFlags  = 0;
    54 
    55     // added for PS1_V4
    56     out[i].Mkron      = NAN;
    57     out[i].dMkron     = NAN;
    58     out[i].FluxPSF    = NAN;
    59     out[i].dFluxPSF   = NAN;
    60     out[i].FluxKron   = NAN;
    61     out[i].dFluxKron  = NAN;
    62     out[i].psfQFperf  = NAN;
    6326  }
    6427  return (out);
     
    9659
    9760  for (i = 0; i < Nvalues; i++) {
     61    dvo_average_init (&out[i]);
     62
    9863    out[i].R             = in[i].R;     
    9964    out[i].D             = in[i].D;     
    10065    out[i].dR            = in[i].dR;
    10166    out[i].dD            = in[i].dD;
    102     out[i].uR            = NAN;
    103     out[i].uD            = NAN;
    104     out[i].duR           = NAN;
    105     out[i].duD           = NAN;
    106     out[i].P             = NAN;
    107     out[i].dP            = NAN;
    108     out[i].ChiSqAve      = NAN;
    109     out[i].ChiSqPM       = NAN;
    110     out[i].ChiSqPar      = NAN;
    111     out[i].Tmean         = 0;
    112     out[i].Trange        = 0;
    113     out[i].Npos          = 0;
    11467    out[i].Nmeasure      = in[i].Nmeasure;     
    11568    out[i].Nmissing      = in[i].Nmissing;     
    116     out[i].Nextend       = 0;
    11769    out[i].measureOffset = in[i].measureOffset;
    11870    out[i].missingOffset = in[i].missingOffset;
    119     out[i].extendOffset  = 0;
    120     out[i].flags         = 0;
    12171    out[i].objID         = in[i].objID;
    12272    out[i].catID         = in[i].catID;
    123     out[i].extID         = 0;
    124 
    125     // added in PS1_V3
    126     out[i].photFlagsUpper = 0;
    127     out[i].photFlagsLower = 0;
    128 
    129     // added for PS1_V4 (Xp dropped in V4 onward, was not really used anyway)
    130     out[i].psfQF         = NAN;
    131     out[i].psfQFperf     = NAN;
    132     out[i].stargal       = NAN;
    13373  }
    13474  return (out);
     
    167107
    168108  for (i = 0; i < Nvalues; i++) {
     109    dvo_secfilt_init (&out[i]);
     110
    169111    out[i].M     = in[i].M;     
    170112    out[i].dM    = in[i].dM;     
    171     out[i].Xm    = NAN_S_SHORT;
    172     out[i].Ncode = 0;
    173     out[i].Nused = 0;
    174     out[i].M_20  = 0;
    175     out[i].M_80  = 0;
    176 
    177     // changed or added for PS1_V2
    178     out[i].flags = 0;
    179 
    180     // added in PS1_V3
    181     out[i].Map         = 0;
    182     out[i].Mstdev      = 0;
    183     out[i].ubercalDist = 0;
    184 
    185     // added for PS1_V4
    186     out[i].Mkron       = NAN;
    187     out[i].dMkron      = NAN;
    188     out[i].FluxPSF     = NAN;
    189     out[i].dFluxPSF    = NAN;
    190     out[i].FluxKron    = NAN;
    191     out[i].dFluxKron   = NAN;
    192     out[i].stackDetectID     = 0;
    193113 }
    194114  return (out);
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V1.c

    r34620 r34749  
    1111
    1212  for (i = 0; i < Nvalues; i++) {
     13    dvo_measure_init (&out[i]);
     14
    1315    out[i].dR         = in[i].dR;
    1416    out[i].dD         = in[i].dD;
     
    5254    out[i].dbFlags    = in[i].dbFlags;
    5355    out[i].photFlags  = in[i].photFlags;
    54 
    55     // added for PS1_V4
    56     out[i].Mkron      = NAN;
    57     out[i].dMkron     = NAN;
    58     out[i].FluxPSF    = NAN;
    59     out[i].dFluxPSF   = NAN;
    60     out[i].FluxKron   = NAN;
    61     out[i].dFluxKron  = NAN;
    62     out[i].psfQFperf  = NAN;
    6356  }
    6457  return (out);
     
    128121
    129122  for (i = 0; i < Nvalues; i++) {
     123    dvo_average_init (&out[i]);
     124
    130125    out[i].R             = in[i].R;     
    131126    out[i].D             = in[i].D;     
     
    139134    out[i].dP            = in[i].dP;
    140135    out[i].ChiSqAve      = in[i].ChiSq;     
    141     out[i].ChiSqPM       = NAN;
    142     out[i].ChiSqPar      = NAN;
    143     out[i].Tmean         = 0;
    144     out[i].Trange        = 0;
    145136    out[i].Npos          = in[i].Npos;     
    146137    out[i].Nmeasure      = in[i].Nmeasure;     
     
    154145    out[i].catID         = in[i].catID;
    155146    out[i].extID         = in[i].extID;
    156 
    157     // added in PS1_V3
    158     out[i].photFlagsUpper = 0;
    159     out[i].photFlagsLower = 0;
    160 
    161     // added for PS1_V4 (Xp dropped in V4 onward, was not really used anyway)
    162     out[i].psfQF         = NAN;
    163     out[i].psfQFperf     = NAN;
    164     out[i].stargal       = NAN;
    165147  }
    166148  return (out);
     
    210192
    211193  for (i = 0; i < Nvalues; i++) {
     194    dvo_secfilt_init (&out[i]);
     195
    212196    out[i].M     = in[i].M;     
    213197    out[i].dM    = in[i].dM;     
     
    217201    out[i].M_20  = in[i].M_20;     
    218202    out[i].M_80  = in[i].M_80;     
    219 
    220     // changed or added for PS1_V2
    221     out[i].flags = 0;
    222 
    223     // added in PS1_V3
    224     out[i].Map         = 0;
    225     out[i].Mstdev      = 0;
    226     out[i].ubercalDist = 0;
    227 
    228     // added for PS1_V4
    229     out[i].Mkron       = NAN;
    230     out[i].dMkron      = NAN;
    231     out[i].FluxPSF     = NAN;
    232     out[i].dFluxPSF    = NAN;
    233     out[i].FluxKron    = NAN;
    234     out[i].dFluxKron   = NAN;
    235     out[i].stackDetectID     = 0;
    236203 }
    237204  return (out);
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V2.c

    r34620 r34749  
    1111
    1212  for (i = 0; i < Nvalues; i++) {
     13    dvo_measure_init (&out[i]);
     14
    1315    out[i].dR         = in[i].dR;
    1416    out[i].dD         = in[i].dD;
     
    5355    out[i].dbFlags    = in[i].dbFlags;
    5456    out[i].photFlags  = in[i].photFlags;
    55 
    56     // added for PS1_V4
    57     out[i].Mkron      = NAN;
    58     out[i].dMkron     = NAN;
    59     out[i].FluxPSF    = NAN;
    60     out[i].dFluxPSF   = NAN;
    61     out[i].FluxKron   = NAN;
    62     out[i].dFluxKron  = NAN;
    63     out[i].psfQFperf  = NAN;
    6457  }
    6558  return (out);
     
    129122
    130123  for (i = 0; i < Nvalues; i++) {
     124    dvo_average_init (&out[i]);
     125
    131126    out[i].R             = in[i].R;     
    132127    out[i].D             = in[i].D;     
     
    155150    out[i].catID         = in[i].catID;
    156151    out[i].extID         = in[i].extID;
    157 
    158     // added in PS1_V3
    159     out[i].photFlagsUpper = 0;
    160     out[i].photFlagsLower = 0;
    161 
    162     // added for PS1_V4 (Xp dropped in V4 onward, was not really used anyway)
    163     out[i].psfQF         = NAN;
    164     out[i].psfQFperf     = NAN;
    165     out[i].stargal       = NAN;
    166152  }
    167153  return (out);
     
    215201
    216202  for (i = 0; i < Nvalues; i++) {
     203    dvo_secfilt_init (&out[i]);
     204
    217205    out[i].M     = in[i].M;     
    218206    out[i].dM    = in[i].dM;     
     
    223211    out[i].M_20  = in[i].M_20;     
    224212    out[i].M_80  = in[i].M_80;     
    225 
    226     // added in PS1_V3
    227     out[i].Map         = 0;
    228     out[i].Mstdev      = 0;
    229     out[i].ubercalDist = 0;
    230 
    231     // added for PS1_V4
    232     out[i].Mkron       = NAN;
    233     out[i].dMkron      = NAN;
    234     out[i].FluxPSF     = NAN;
    235     out[i].dFluxPSF    = NAN;
    236     out[i].FluxKron    = NAN;
    237     out[i].dFluxKron   = NAN;
    238     out[i].stackDetectID     = 0;
    239213 }
    240214  return (out);
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V3.c

    r34620 r34749  
    1111
    1212  for (i = 0; i < Nvalues; i++) {
     13    dvo_measure_init (&out[i]);
     14
    1315    out[i].dR         = in[i].dR;
    1416    out[i].dD         = in[i].dD;
     
    5355    out[i].dbFlags    = in[i].dbFlags;
    5456    out[i].photFlags  = in[i].photFlags;
    55 
    56     // added for PS1_V4
    57     out[i].Mkron      = NAN;
    58     out[i].dMkron     = NAN;
    59     out[i].FluxPSF    = NAN;
    60     out[i].dFluxPSF   = NAN;
    61     out[i].FluxKron   = NAN;
    62     out[i].dFluxKron  = NAN;
    63     out[i].psfQFperf  = NAN;
    6457  }
    6558  return (out);
     
    129122
    130123  for (i = 0; i < Nvalues; i++) {
     124    dvo_average_init (&out[i]);
     125
    131126    out[i].R             = in[i].R;     
    132127    out[i].D             = in[i].D;     
     
    157152    out[i].catID         = in[i].catID;
    158153    out[i].extID         = in[i].extID;
    159 
    160     // added for PS1_V4 (Xp dropped in V4 onward, was not really used anyway)
    161     out[i].psfQF         = NAN;
    162     out[i].psfQFperf     = NAN;
    163     out[i].stargal       = NAN;
    164154  }
    165155  return (out);
     
    215205
    216206  for (i = 0; i < Nvalues; i++) {
     207    dvo_secfilt_init (&out[i]);
     208
    217209    out[i].M           = in[i].M;     
    218210    out[i].Map         = in[i].Map;     
     
    226218    out[i].Mstdev      = in[i].Mstdev;     
    227219    out[i].ubercalDist = in[i].ubercalDist;     
    228 
    229     // added for PS1_V4
    230     out[i].Mkron       = NAN;
    231     out[i].dMkron      = NAN;
    232     out[i].FluxPSF     = NAN;
    233     out[i].dFluxPSF    = NAN;
    234     out[i].FluxKron    = NAN;
    235     out[i].dFluxKron   = NAN;
    236     out[i].stackDetectID     = 0;
    237220 }
    238221  return (out);
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c

    r34620 r34749  
    99
    1010  ALLOCATE_ZERO (out, Measure, Nvalues);
     11
     12  for (i = 0; i < Nvalues; i++) {
     13    dvo_measure_init (&out[i]);
     14
     15    out[i].dR         = in[i].dR;
     16    out[i].dD         = in[i].dD;
     17    out[i].M          = in[i].M;
     18    out[i].Mcal       = in[i].Mcal;
     19    out[i].Map        = in[i].Map;
     20    out[i].Mkron      = in[i].Mkron;
     21    out[i].dMkron     = in[i].dMkron;
     22    out[i].dM         = in[i].dM;
     23    out[i].dMcal      = in[i].dMcal;
     24    out[i].dt         = in[i].dt;
     25    out[i].FluxPSF    = in[i].FluxPSF;
     26    out[i].dFluxPSF   = in[i].dFluxPSF;
     27    out[i].FluxKron   = in[i].FluxKron;
     28    out[i].dFluxKron  = in[i].dFluxKron;
     29    out[i].airmass    = in[i].airmass;
     30    out[i].az         = in[i].az;
     31    out[i].Xccd       = in[i].Xccd;
     32    out[i].Yccd       = in[i].Yccd;
     33    out[i].Xoff       = in[i].Xoff;
     34    out[i].Yoff       = in[i].Yoff;
     35    out[i].Sky        = in[i].Sky;
     36    out[i].dSky       = in[i].dSky;
     37    out[i].t          = in[i].t;
     38    out[i].t_msec     = in[i].t_msec;
     39    out[i].averef     = in[i].averef;
     40    out[i].detID      = in[i].detID;
     41    out[i].imageID    = in[i].imageID;
     42    out[i].objID      = in[i].objID;
     43    out[i].catID      = in[i].catID;
     44    out[i].extID      = in[i].extID;
     45    out[i].psfQF      = in[i].psfQF;
     46    out[i].psfQFperf  = in[i].psfQFperf;
     47    out[i].psfChisq   = in[i].psfChisq;
     48    out[i].psfNdof    = in[i].psfNdof;
     49    out[i].psfNpix    = in[i].psfNpix;
     50    out[i].crNsigma   = in[i].crNsigma;
     51    out[i].extNsigma  = in[i].extNsigma;
     52    out[i].FWx        = in[i].FWx;
     53    out[i].FWy        = in[i].FWy;
     54    out[i].theta      = in[i].theta;
     55    out[i].Mxx        = in[i].Mxx;
     56    out[i].Mxy        = in[i].Mxy;
     57    out[i].Myy        = in[i].Myy;
     58    out[i].dXccd      = in[i].dXccd;
     59    out[i].dYccd      = in[i].dYccd;
     60    out[i].dRsys      = in[i].dRsys;
     61    out[i].posangle   = in[i].posangle;
     62    out[i].pltscale   = in[i].pltscale;
     63    out[i].photcode   = in[i].photcode;
     64    out[i].dbFlags    = in[i].dbFlags;
     65    out[i].photFlags  = in[i].photFlags;
     66  }
     67  return (out);
     68}
     69
     70Measure_PS1_V4 *MeasureInternalTo_PS1_V4 (Measure *in, off_t Nvalues) {
     71
     72  off_t i;
     73  Measure_PS1_V4 *out;
     74
     75  ALLOCATE_ZERO (out, Measure_PS1_V4, Nvalues);
    1176
    1277  for (i = 0; i < Nvalues; i++) {
     
    64129}
    65130
    66 Measure_PS1_V4 *MeasureInternalTo_PS1_V4 (Measure *in, off_t Nvalues) {
    67 
    68   off_t i;
    69   Measure_PS1_V4 *out;
    70 
    71   ALLOCATE_ZERO (out, Measure_PS1_V4, Nvalues);
    72 
    73   for (i = 0; i < Nvalues; i++) {
    74     out[i].dR         = in[i].dR;
    75     out[i].dD         = in[i].dD;
    76     out[i].M          = in[i].M;
    77     out[i].Mcal       = in[i].Mcal;
    78     out[i].Map        = in[i].Map;
    79     out[i].Mkron      = in[i].Mkron;
    80     out[i].dMkron     = in[i].dMkron;
    81     out[i].dM         = in[i].dM;
    82     out[i].dMcal      = in[i].dMcal;
    83     out[i].dt         = in[i].dt;
    84     out[i].FluxPSF    = in[i].FluxPSF;
    85     out[i].dFluxPSF   = in[i].dFluxPSF;
    86     out[i].FluxKron   = in[i].FluxKron;
    87     out[i].dFluxKron  = in[i].dFluxKron;
    88     out[i].airmass    = in[i].airmass;
    89     out[i].az         = in[i].az;
    90     out[i].Xccd       = in[i].Xccd;
    91     out[i].Yccd       = in[i].Yccd;
    92     out[i].Sky        = in[i].Sky;
    93     out[i].dSky       = in[i].dSky;
    94     out[i].t          = in[i].t;
    95     out[i].t_msec     = in[i].t_msec;
    96     out[i].averef     = in[i].averef;
    97     out[i].detID      = in[i].detID;
    98     out[i].imageID    = in[i].imageID;
    99     out[i].objID      = in[i].objID;
    100     out[i].catID      = in[i].catID;
    101     out[i].extID      = in[i].extID;
    102     out[i].psfQF      = in[i].psfQF;
    103     out[i].psfQFperf  = in[i].psfQFperf;
    104     out[i].psfChisq   = in[i].psfChisq;
    105     out[i].psfNdof    = in[i].psfNdof;
    106     out[i].psfNpix    = in[i].psfNpix;
    107     out[i].crNsigma   = in[i].crNsigma;
    108     out[i].extNsigma  = in[i].extNsigma;
    109     out[i].FWx        = in[i].FWx;
    110     out[i].FWy        = in[i].FWy;
    111     out[i].theta      = in[i].theta;
    112     out[i].Mxx        = in[i].Mxx;
    113     out[i].Mxy        = in[i].Mxy;
    114     out[i].Myy        = in[i].Myy;
    115     out[i].dXccd      = in[i].dXccd;
    116     out[i].dYccd      = in[i].dYccd;
    117     out[i].dRsys      = in[i].dRsys;
    118     out[i].posangle   = in[i].posangle;
    119     out[i].pltscale   = in[i].pltscale;
    120     out[i].photcode   = in[i].photcode;
    121     out[i].dbFlags    = in[i].dbFlags;
    122     out[i].photFlags  = in[i].photFlags;
    123   }
    124   return (out);
    125 }
    126 
    127131// 'primary' is needed to conform with the API for Loneos and Elixir, but is not used
    128132Average *Average_PS1_V4_ToInternal (Average_PS1_V4 *in, off_t Nvalues, SecFilt **primary) {
     
    134138
    135139  for (i = 0; i < Nvalues; i++) {
     140    dvo_average_init (&out[i]);
     141
    136142    out[i].R             = in[i].R;     
    137143    out[i].D             = in[i].D;     
     
    221227
    222228  for (i = 0; i < Nvalues; i++) {
     229    dvo_secfilt_init (&out[i]);
     230
    223231    out[i].M             = in[i].M;     
    224232    out[i].Map           = in[i].Map;     
  • trunk/Ohana/src/libdvo/src/dvo_convert_elixir.c

    r34620 r34749  
    1010
    1111  for (i = 0; i < Nvalues; i++) {
     12    dvo_measure_init (&out[i]);
    1213    out[i].FWx      = in[i].FWx;
    1314    out[i].t        = in[i].t;
     
    2829   
    2930    // added for PANSTARRS_DEV_0
    30     out[i].Xccd      = 0;  // determine on-the-fly
    31     out[i].Yccd      = 0;  // determine on-the-fly
    32     out[i].dXccd     = 0;
    33     out[i].dYccd     = 0;
    34     out[i].az        = 0;
    35     out[i].Sky       = 0;
    36     out[i].dSky      = 0;
    37     out[i].psfQF     = 0;
    38     out[i].psfChisq  = 0;
    39     out[i].crNsigma  = 0;
    40     out[i].extNsigma = 0;
    41     out[i].detID     = 0;  // determine on-the-fly
    42     out[i].imageID   = 0;  // determine on-the-fly
    43 
    44     // changed or added for PS1_DEV_1 (2008.02.26)
     31    // out[i].Xccd      = 0;  // determine on-the-fly
     32    // out[i].Yccd      = 0;  // determine on-the-fly
     33    // out[i].detID     = 0;  // determine on-the-fly
     34    // out[i].imageID   = 0;  // determine on-the-fly
     35
     36    // changed for PS1_DEV_1 (2008.02.26)
    4537    out[i].dbFlags    = in[i].flags;
    46     out[i].detID      = 0;
    47     out[i].imageID    = 0;
    48 
    49     // changed or added for PS1_DEV_2
     38
     39    // changed for PS1_DEV_2
    5040    out[i].Map        = in[i].Mgal;
    51     out[i].dMcal      = 0;
    52 
    53     // changed or added for PS1_V1
     41
     42    // changed for PS1_V1
    5443    out[i].photFlags  = in[i].dophot << 16;
    55     out[i].t_msec     = 0;
    56     out[i].extID      = 0;
    57     out[i].objID      = 0;
    58     out[i].catID      = 0;
    59     out[i].Mxx        = 0.0;
    60     out[i].Mxy        = 0.0;
    61     out[i].Myy        = 0.0;
    62     out[i].posangle   = 0;
    63     out[i].pltscale   = 0;
    64     out[i].psfNdof    = 0;
    65     out[i].psfNpix    = 0;
    66 
    67     // added for PS1_V4
    68     out[i].Mkron      = NAN;
    69     out[i].dMkron     = NAN;
    70     out[i].FluxPSF    = NAN;
    71     out[i].dFluxPSF   = NAN;
    72     out[i].FluxKron   = NAN;
    73     out[i].dFluxKron  = NAN;
    74     out[i].psfQFperf  = NAN;
    7544  }
    7645  return (out);
     
    12695
    12796  for (i = 0; i < Nvalues; i++) {
     97    dvo_average_init (&out[i]);
     98    dvo_secfilt_init (&primary[0][i]);
     99
    128100    out[i].R             = in[i].R;     
    129101    out[i].D             = in[i].D;     
     
    134106    primary[0][i].Xm    = in[i].Xm;     
    135107
    136     primary[0][i].Ncode = 0;     
    137     primary[0][i].Nused = 0;
    138 
    139108    // added for PANSTARRS_DEV_0
    140     out[i].dR      = 0;
    141     out[i].dD      = 0;
    142     out[i].uR      = 0;
    143     out[i].uD      = 0;
    144     out[i].duR     = 0;
    145     out[i].duD     = 0;
    146     out[i].P       = 0;
    147     out[i].dP      = 0;
    148     out[i].objID   = 0; // determine on-the-fly
    149     out[i].catID   = 0; // determine on-the-fly
     109    // out[i].objID   = 0; // determine on-the-fly
     110    // out[i].catID   = 0; // determine on-the-fly
    150111
    151112    // changed or added for PS1_DEV_2
     
    154115    out[i].measureOffset = in[i].offset;
    155116    out[i].missingOffset = in[i].missing;
    156     out[i].Nextend       = 0;
    157     out[i].extendOffset  = 0;
    158117
    159118    // changed or added for PS1_V1
    160119    out[i].flags         = in[i].code;   
    161     out[i].ChiSqAve      = NAN;
    162     out[i].ChiSqPM       = NAN;
    163     out[i].ChiSqPar      = NAN;
    164     out[i].Tmean         = 0;
    165     out[i].Trange        = 0;
    166     out[i].Npos          = 0.0;
    167     out[i].extID         = 0;
    168 
    169     // added in PS1_V3
    170     out[i].photFlagsUpper = 0;
    171     out[i].photFlagsLower = 0;
    172 
    173     // added for PS1_V4 (Xp dropped in V4 onward, was not really used anyway)
    174     out[i].psfQF         = NAN;
    175     out[i].psfQFperf     = NAN;
    176     out[i].stargal       = NAN;
    177120  }
    178121  return (out);
     
    217160
    218161  for (i = 0; i < Nvalues; i++) {
     162    dvo_secfilt_init (&out[i]);
     163
    219164    out[i].Xm    = in[i].Xm;     
    220165
     
    222167    out[i].M     = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M   * 0.001;
    223168    out[i].dM    = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM  * 0.001;
    224     out[i].Ncode = 0;
    225     out[i].Nused = 0;
    226 
    227     // changed or added for PS1_V1
    228     out[i].M_20  = 0;     
    229     out[i].M_80  = 0;     
    230 
    231     // changed or added for PS1_V2
    232     out[i].flags = 0;
    233 
    234     // added in PS1_V3
    235     out[i].Map         = 0;
    236     out[i].Mstdev      = 0;
    237     out[i].ubercalDist = 0;
    238 
    239     // added for PS1_V4
    240     out[i].Mkron       = NAN;
    241     out[i].dMkron      = NAN;
    242     out[i].FluxPSF    = NAN;
    243     out[i].dFluxPSF   = NAN;
    244     out[i].FluxKron   = NAN;
    245     out[i].dFluxKron  = NAN;
    246     out[i].stackDetectID     = 0;
    247169  }
    248170  return (out);
  • trunk/Ohana/src/libdvo/src/dvo_convert_loneos.c

    r34620 r34749  
    1010
    1111  for (i = 0; i < Nvalues; i++) {
     12    dvo_measure_init (&out[i]);
    1213    out[i].t        = in[i].t;
    1314
     
    1617    out[i].dbFlags   = (in[i].averef & 0xff000000) >> 24;
    1718    out[i].t         = in[i].t;
    18     out[i].dt        = 0;
    19     out[i].airmass   = 0;
    20     out[i].FWy       = 0;
    21     out[i].FWx       = 0;
    22     out[i].theta     = 0;
    2319
    2420    // changed for PANSTARRS_DEV_0
     
    3228   
    3329    // added for PANSTARRS_DEV_0
    34     out[i].Xccd      = 0;  // determine on-the-fly
    35     out[i].Yccd      = 0;  // determine on-the-fly
    36     out[i].dXccd     = 0;
    37     out[i].dYccd     = 0;
    38     out[i].az        = 0;
    39     out[i].Sky       = 0;
    40     out[i].dSky      = 0;
    41     out[i].psfQF     = 0;
    42     out[i].psfChisq  = 0;
    43     out[i].crNsigma  = 0;
    44     out[i].extNsigma = 0;
    45     out[i].detID     = 0;  // determine on-the-fly
    46     out[i].imageID   = 0;  // determine on-the-fly
    47 
    48     // changed or added for PS1_DEV_1 (2008.02.26)
    49     out[i].detID      = 0;
    50     out[i].imageID    = 0;
    51 
    52     // changed or added for PS1_DEV_2
    53     out[i].dMcal      = 0;
     30    // out[i].Xccd      = 0;  // determine on-the-fly
     31    // out[i].Yccd      = 0;  // determine on-the-fly
     32    // out[i].detID     = 0;  // determine on-the-fly
     33    // out[i].imageID   = 0;  // determine on-the-fly
    5434
    5535    // changed or added for PS1_V1
    5636    out[i].photFlags  = in[i].dophot << 16;
    57     out[i].t_msec     = 0;
    58     out[i].extID      = 0;
    59     out[i].objID      = 0;
    60     out[i].catID      = 0;
    61     out[i].Mxx        = 0.0;
    62     out[i].Mxy        = 0.0;
    63     out[i].Myy        = 0.0;
    64     out[i].posangle   = 0;
    65     out[i].pltscale   = 0;
    66     out[i].psfNdof    = 0;
    67     out[i].psfNpix    = 0;
    68 
    69     // added for PS1_V4
    70     out[i].Mkron      = NAN;
    71     out[i].dMkron     = NAN;
    72     out[i].FluxPSF    = NAN;
    73     out[i].dFluxPSF   = NAN;
    74     out[i].FluxKron   = NAN;
    75     out[i].dFluxKron  = NAN;
    76     out[i].psfQFperf  = NAN;
    7737  }
    7838  return (out);
     
    11777
    11878  for (i = 0; i < Nvalues; i++) {
     79    dvo_average_init (&out[i]);
     80    dvo_secfilt_init (&primary[0][i]);
     81
    11982    out[i].R             = in[i].R;     
    12083    out[i].D             = in[i].D;     
    121 
    122     // added for ELIXIR
    123     primary[0][i].dM    = NAN;
    12484
    12585    // changed for PANSTARRS_DEV_0 (moved from Average to Measure)
    12686    primary[0][i].M     = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M  * 0.001;     
    12787    primary[0][i].Xm    = in[i].Xm;     
    128     primary[0][i].Ncode = 0;     
    129     primary[0][i].Nused = 0;
    13088
    13189    // added for PANSTARRS_DEV_0
    132     out[i].dR      = 0;
    133     out[i].dD      = 0;
    134     out[i].uR      = 0;
    135     out[i].uD      = 0;
    136     out[i].duR     = 0;
    137     out[i].duD     = 0;
    138     out[i].P       = 0;
    139     out[i].dP      = 0;
    140     out[i].objID   = 0; // determine on-the-fly
    141     out[i].catID   = 0; // determine on-the-fly
     90    // out[i].objID   = 0; // determine on-the-fly
     91    // out[i].catID   = 0; // determine on-the-fly
    14292
    14393    // changed or added for PS1_DEV_2
     
    14696    out[i].measureOffset = in[i].offset;
    14797    out[i].missingOffset = in[i].missing;
    148     out[i].Nextend       = 0;
    149     out[i].extendOffset  = 0;
    15098
    15199    // changed or added for PS1_V1
    152100    out[i].flags         = in[i].code;   
    153     out[i].ChiSqAve      = NAN;
    154     out[i].ChiSqPM       = NAN;
    155     out[i].ChiSqPar      = NAN;
    156     out[i].Tmean         = 0;
    157     out[i].Trange        = 0;
    158     out[i].Npos          = 0.0;
    159     out[i].extID         = 0;
    160 
    161     // added in PS1_V3
    162     out[i].photFlagsUpper = 0;
    163     out[i].photFlagsLower = 0;
    164 
    165     // added for PS1_V4 (Xp dropped in V4 onward, was not really used anyway)
    166     out[i].psfQF         = NAN;
    167     out[i].psfQFperf     = NAN;
    168     out[i].stargal       = NAN;
     101
     102    // PS1_V4 : (Xp dropped in V4 onward, was not really used anyway)
    169103  }
    170104  return (out);
     
    208142
    209143  for (i = 0; i < Nvalues; i++) {
     144    dvo_secfilt_init (&out[i]);
     145
    210146    out[i].Xm    = in[i].Xm;     
    211147
    212     // added for ELIXIR
    213     out[i].dM    = NAN;
    214 
    215148    // added or changed for PANSTARRS_DEV_0
    216149    out[i].M     = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M * 0.001;
    217     out[i].Ncode = 0;
    218     out[i].Nused = 0;
    219 
    220     // changed or added for PS1_V1
    221     out[i].M_20  = 0;     
    222     out[i].M_80  = 0;     
    223 
    224     // changed or added for PS1_V2
    225     out[i].flags = 0;
    226 
    227     // added in PS1_V3
    228     out[i].Map         = 0;
    229     out[i].Mstdev      = 0;
    230     out[i].ubercalDist = 0;
    231 
    232     // added for PS1_V4
    233     out[i].Mkron       = NAN;
    234     out[i].dMkron      = NAN;
    235     out[i].FluxPSF    = NAN;
    236     out[i].dFluxPSF   = NAN;
    237     out[i].FluxKron   = NAN;
    238     out[i].dFluxKron  = NAN;
    239     out[i].stackDetectID     = 0;
    240150  }
    241151  return (out);
  • trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c

    r34620 r34749  
    1010
    1111  for (i = 0; i < Nvalues; i++) {
     12    dvo_measure_init (&out[i]);
    1213    out[i].dR         = in[i].dR;
    1314    out[i].dD         = in[i].dD;
     
    3536    // magnitudes.  Most uses of Mgal in the past were actually aperture (isophotal) mags
    3637
    37     // changed or added for PS1_DEV_1 (2008.02.26)
     38    // changed for PS1_DEV_1 (2008.02.26)
    3839    out[i].psfQF      = (in[i].psfQF == NAN_S_SHORT) ? NAN : in[i].psfQF;
    3940    out[i].dbFlags    = in[i].flags;
    4041    out[i].detID      = in[i].detID_lo;
    4142    out[i].imageID    = in[i].imageID_lo;
    42     out[i].psfChisq   = 0;
    43     out[i].crNsigma   = 0;
    44     out[i].extNsigma  = 0;
    45 
    46     // changed or added for PS1_DEV_2
     43
     44    // changed for PS1_DEV_2
    4745    out[i].Map        = in[i].Mgal;
    48     out[i].dMcal      = 0;
    49 
    50     // changed or added for PS1_V1
     46
     47    // changed for PS1_V1
    5148    out[i].photFlags  = in[i].dophot << 16;
    52     out[i].t_msec     = 0;
    53     out[i].extID      = 0;
    54     out[i].objID      = 0;
    55     out[i].catID      = 0;
    56     out[i].Mxx        = 0.0;
    57     out[i].Mxy        = 0.0;
    58     out[i].Myy        = 0.0;
    59     out[i].posangle   = 0;
    60     out[i].pltscale   = 0;
    61     out[i].psfNdof    = 0;
    62     out[i].psfNpix    = 0;
    63 
    64     // added for PS1_V4
    65     out[i].Mkron      = NAN;
    66     out[i].dMkron     = NAN;
    67     out[i].FluxPSF    = NAN;
    68     out[i].dFluxPSF   = NAN;
    69     out[i].FluxKron   = NAN;
    70     out[i].dFluxKron  = NAN;
    71     out[i].psfQFperf  = NAN;
    7249  }
    7350  return (out);
     
    132109
    133110  for (i = 0; i < Nvalues; i++) {
     111    dvo_average_init (&out[i]);
     112
    134113    out[i].R             = in[i].R;     
    135114    out[i].D             = in[i].D;     
     
    145124    out[i].catID         = in[i].catID;
    146125
    147     // changed or added for PS1_DEV_2
     126    // changed for PS1_DEV_2
    148127    out[i].Nmeasure      = in[i].Nm;     
    149128    out[i].Nmissing      = in[i].Nn;     
    150129    out[i].measureOffset = in[i].offset;
    151130    out[i].missingOffset = in[i].missing;
    152     out[i].Nextend       = 0;
    153     out[i].extendOffset  = 0;
    154 
    155     // changed or added for PS1_V1
     131
     132    // changed for PS1_V1
    156133    out[i].flags         = in[i].code;   
    157     out[i].ChiSqAve      = NAN;
    158     out[i].ChiSqPM       = NAN;
    159     out[i].ChiSqPar      = NAN;
    160     out[i].Tmean         = 0;
    161     out[i].Trange        = 0;
    162     out[i].Npos          = 0.0;
    163     out[i].extID         = 0;
    164 
    165     // added in PS1_V3
    166     out[i].photFlagsUpper = 0;
    167     out[i].photFlagsLower = 0;
    168 
    169     // added for PS1_V4 (Xp dropped in V4 onward, was not really used anyway)
    170     out[i].psfQF         = NAN;
    171     out[i].psfQFperf     = NAN;
    172     out[i].stargal       = NAN;
    173134  }
    174135  return (out);
     
    219180
    220181  for (i = 0; i < Nvalues; i++) {
     182    dvo_secfilt_init (&out[i]);
     183
    221184    out[i].M     = in[i].M;     
    222185    out[i].dM    = in[i].dM;     
     
    224187    out[i].Ncode = in[i].Ncode;
    225188    out[i].Nused = in[i].Nused;
    226 
    227     // changed or added for PS1_V1
    228     out[i].M_20  = 0;     
    229     out[i].M_80  = 0;     
    230 
    231     // changed or added for PS1_V2
    232     out[i].flags = 0;
    233 
    234     // added in PS1_V3
    235     out[i].Map         = 0;
    236     out[i].Mstdev      = 0;
    237     out[i].ubercalDist = 0;
    238 
    239     // added for PS1_V4
    240     out[i].Mkron       = NAN;
    241     out[i].dMkron      = NAN;
    242     out[i].FluxPSF     = NAN;
    243     out[i].dFluxPSF    = NAN;
    244     out[i].FluxKron    = NAN;
    245     out[i].dFluxKron   = NAN;
    246     out[i].stackDetectID     = 0;
    247189 }
    248190  return (out);
  • trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c

    r34620 r34749  
    1010
    1111  for (i = 0; i < Nvalues; i++) {
     12    dvo_measure_init (&out[i]);
    1213    out[i].dR         = in[i].dR;
    1314    out[i].dD         = in[i].dD;
     
    4041    out[i].detID      = in[i].detID_lo;
    4142    out[i].imageID    = in[i].imageID_lo;
    42     out[i].psfChisq   = 0;
    43     out[i].crNsigma   = 0;
    44     out[i].extNsigma  = 0;
    45 
    46     // changed or added for PS1_DEV_2
     43
     44    // changed for PS1_DEV_2
    4745    out[i].Map        = in[i].Mgal;
    48     out[i].dMcal      = 0;
    49 
    50     // changed or added for PS1_V1
     46
     47    // changed for PS1_V1
    5148    out[i].photFlags  = in[i].dophot << 16;
    52     out[i].t_msec     = 0;
    53     out[i].extID      = 0;
    54     out[i].objID      = 0;
    55     out[i].catID      = 0;
    56     out[i].Mxx        = 0.0;
    57     out[i].Mxy        = 0.0;
    58     out[i].Myy        = 0.0;
    59     out[i].posangle   = 0;
    60     out[i].pltscale   = 0;
    61     out[i].psfNdof    = 0;
    62     out[i].psfNpix    = 0;
    63 
    64     // added for PS1_V4
    65     out[i].Mkron      = NAN;
    66     out[i].dMkron     = NAN;
    67     out[i].FluxPSF    = NAN;
    68     out[i].dFluxPSF   = NAN;
    69     out[i].FluxKron   = NAN;
    70     out[i].dFluxKron  = NAN;
    71     out[i].psfQFperf  = NAN;
    7249  }
    7350  return (out);
     
    132109
    133110  for (i = 0; i < Nvalues; i++) {
     111    dvo_average_init (&out[i]);
     112
    134113    out[i].R             = in[i].R;     
    135114    out[i].D             = in[i].D;     
     
    145124    out[i].catID         = in[i].catID;
    146125
    147     // changed or added for PS1_DEV_2
     126    // changed for PS1_DEV_2
    148127    out[i].Nmeasure      = in[i].Nm;     
    149128    out[i].Nmissing      = in[i].Nn;     
    150129    out[i].measureOffset = in[i].offset;
    151130    out[i].missingOffset = in[i].missing;
    152     out[i].Nextend       = 0;
    153     out[i].extendOffset  = 0;
    154 
    155     // changed or added for PS1_V1
     131
     132    // changed for PS1_V1
    156133    out[i].flags         = in[i].code;   
    157     out[i].ChiSqAve      = NAN;
    158     out[i].ChiSqPM       = NAN;
    159     out[i].ChiSqPar      = NAN;
    160     out[i].Tmean         = 0;
    161     out[i].Trange        = 0;
    162     out[i].Npos          = 0.0;
    163     out[i].extID         = 0;
    164 
    165     // added in PS1_V3
    166     out[i].photFlagsUpper = 0;
    167     out[i].photFlagsLower = 0;
    168 
    169     // added for PS1_V4 (Xp dropped in V4 onward, was not really used anyway)
    170     out[i].psfQF         = NAN;
    171     out[i].psfQFperf     = NAN;
    172     out[i].stargal       = NAN;
    173134  }
    174135  return (out);
     
    219180
    220181  for (i = 0; i < Nvalues; i++) {
     182    dvo_secfilt_init (&out[i]);
     183
    221184    out[i].M     = in[i].M;     
    222185    out[i].dM    = in[i].dM;     
     
    224187    out[i].Ncode = in[i].Ncode;
    225188    out[i].Nused = in[i].Nused;
    226 
    227     // changed or added for PS1_V1
    228     out[i].M_20  = 0;     
    229     out[i].M_80  = 0;     
    230 
    231     // changed or added for PS1_V2
    232     out[i].flags = 0;
    233 
    234     // added in PS1_V3
    235     out[i].Map         = 0;
    236     out[i].Mstdev      = 0;
    237     out[i].ubercalDist = 0;
    238 
    239     // added for PS1_V4
    240     out[i].Mkron       = NAN;
    241     out[i].dMkron      = NAN;
    242     out[i].FluxPSF     = NAN;
    243     out[i].dFluxPSF    = NAN;
    244     out[i].FluxKron    = NAN;
    245     out[i].dFluxKron   = NAN;
    246     out[i].stackDetectID     = 0;
    247189 }
    248190  return (out);
  • trunk/Ohana/src/libdvo/src/fits_db.c

    r29938 r34749  
    159159  make_backup (db[0].filename);
    160160  Fseek (db[0].f, 0, SEEK_SET);
     161
     162  int fd = fileno (db->f);
     163  if (ftruncate (fd, 0)) {
     164    perror ("gfits_db_save: ");
     165    return (FALSE);
     166  }
    161167
    162168  if (!gfits_fwrite_header  (db[0].f, &db[0].header)) {
Note: See TracChangeset for help on using the changeset viewer.