IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15511


Ignore:
Timestamp:
Nov 8, 2007, 10:43:14 AM (19 years ago)
Author:
eugene
Message:

fixed conversion, some cleanup to autocode files

Location:
trunk/Ohana/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libautocode/def/average-panstarrs-dev-0.d

    r15034 r15511  
    1919FIELD dP,             PAR_ERR,    float,            parallax error,               arcsec
    2020
    21 # XXX drop the old primary magnitude concept
    22 # FIELD M,            MAG,        float,            primary mag,                  mag
    23 # FIELD dM,           MAG_ERR,    float,            error on primary mag,         mag
    24 # FIELD Xm,           CHISQ_MAG,  short,            chisq for primary mag,        [100*log(value)]
    25 # FIELD Xg,           CHISQ_GAL,  short,            chisq for galaxy mags,        [100*log(value)]
    26 
    2721FIELD Xp,             SIGMA_POS,  short,            position scatter,             1/100 arcsec
    2822FIELD Nm,             NMEAS,      unsigned short,   number of measures
     
    4135# the index for the secfilt table is just Nsecfilt times the index for the average table.
    4236
    43 # XXX after the rest of the DVO re-org work, remove the magnitude based values from this table
    44 # and move them to the secfilt table.
    45 
    4637# the DVO object IDs are generated internally and are not equivalent to the PSPS object IDs
    4738# probably need to add position chisq
  • trunk/Ohana/src/libautocode/def/average-panstarrs-dev-1.d

    r15510 r15511  
    3535# the index for the secfilt table is just Nsecfilt times the index for the average table.
    3636
    37 # XXX after the rest of the DVO re-org work, remove the magnitude based values from this table
    38 # and move them to the secfilt table.
    39 
    4037# the DVO object IDs are generated internally and are not equivalent to the PSPS object IDs
    4138# probably need to add position chisq
  • trunk/Ohana/src/libautocode/def/average-ps1-dev-1.d

    r15034 r15511  
    1919FIELD dP,             PAR_ERR,    float,            parallax error,               arcsec
    2020
    21 # XXX drop the old primary magnitude concept
    22 # FIELD M,            MAG,        float,            primary mag,                  mag
    23 # FIELD dM,           MAG_ERR,    float,            error on primary mag,         mag
    24 # FIELD Xm,           CHISQ_MAG,  short,            chisq for primary mag,        [100*log(value)]
    25 # FIELD Xg,           CHISQ_GAL,  short,            chisq for galaxy mags,        [100*log(value)]
    26 
    2721FIELD Xp,             SIGMA_POS,  short,            position scatter,             1/100 arcsec
    2822FIELD Nm,             NMEAS,      unsigned short,   number of measures
     
    4135# the index for the secfilt table is just Nsecfilt times the index for the average table.
    4236
    43 # XXX after the rest of the DVO re-org work, remove the magnitude based values from this table
    44 # and move them to the secfilt table.
    45 
    4637# the DVO object IDs are generated internally and are not equivalent to the PSPS object IDs
    4738# probably need to add position chisq
  • trunk/Ohana/src/libautocode/def/average.d

    r14401 r15511  
    3030FIELD objID_lo,       OBJ_ID_LO,    unsigned int,   ID lower bytes
    3131
    32 # XXX record the number of detections used for average astrometry
    33 
    3432# this structure should only be used for internal representations
    3533# the average-FORMAT structures should be used for external representations
     
    3735# the index for the secfilt table is just Nsecfilt times the index for the average table.
    3836
    39 # XXX after the rest of the DVO re-org work, remove the magnitude based values from this table
    40 # and move them to the secfilt table.
    41 
    4237# the DVO object IDs are generated internally and are not equivalent to the PSPS object IDs
    4338# probably need to add position chisq
  • trunk/Ohana/src/libautocode/def/measure-panstarrs-dev-0.d

    r15034 r15511  
    88FIELD dD,             D_DEC,        float,          DEC offset,                   arcsec
    99FIELD M,              MAG,          float,          catalog mag,                  mag
    10 FIELD Mcal,           Mcal,         float,          image cal mag,                mag
    11 FIELD Mgal,           Mgal,         float,          galaxy mag,                   mag
    12 FIELD dM,             dM,           float,          mag error,                    mag
    13 FIELD dt,             dt,           float,          exposure time,                2.5*log(exptime)
     10FIELD Mcal,           M_CAL,        float,          image cal mag,                mag
     11FIELD Mgal,           M_GAL,        float,          galaxy mag,                   mag
     12FIELD dM,             MAG_ERR,      float,          mag error,                    mag
     13FIELD dt,             M_TIME,       float,          exposure time,                2.5*log(exptime)
    1414
    1515# note that with airmass = 1.0 / cos(90 - alt), we have full alt/az representation
    16 FIELD airmass,        airmass,      float,          (airmass - 1),                airmass
     16FIELD airmass,        AIRMASS,      float,          (airmass - 1),                airmass
    1717FIELD az,             AZ,           float,          telescope azimuth
    1818
     
    2525FIELD dSky,           SKY_FLUX_ERR, float,          local estimate of sky flux,    counts/sec
    2626
    27 FIELD t,              t,            unsigned int,   time in seconds (UNIX)
    28 FIELD averef,         averef,       unsigned int,   reference to average entry     
     27FIELD t,              TIME,         unsigned int,   time in seconds (UNIX)
     28FIELD averef,         AVE_REF,      unsigned int,   reference to average entry     
    2929
    3030# Pan-STARRS uses a 64-bit detection ID.  keep this in two 32 bit ints for backwards compatibility?
     
    3535FIELD imageID_lo,     IMAGE_ID_LO,  unsigned int,   reference to image
    3636
    37 FIELD FWx,            FWx,          short,          object fwhm major axis,       1/100 of arcsec
    38 FIELD FWy,            FWy,          short,          object fwhm minor axis,       1/100 of arcsec
    39 FIELD theta,          theta,        short,          angle wrt ccd X dir,          (0xffff/360) deg
    40 FIELD photcode,       photcode,     unsigned short, photcode
     37FIELD FWx,            FWHM_MAJOR,   short,          object fwhm major axis,       1/100 of arcsec
     38FIELD FWy,            FWHM_MINOR,   short,          object fwhm minor axis,       1/100 of arcsec
     39FIELD theta,          PSF_THETA,    short,          angle wrt ccd X dir,          (0xffff/360) deg
     40FIELD photcode,       PHOTCODE,     unsigned short, photcode
    4141
    42 FIELD flags,          flags,        unsigned short, flags for various uses 
     42FIELD flags,          FLAGS,        unsigned short, flags for various uses 
    4343
    4444FIELD dXccd,          X_CCD_ERR,    short,          X coord error on chip,         pixels
     
    4848FIELD qPSF,           PSF_QF,       short,          psf coverage/quality factor
    4949
    50 FIELD dophot,         dophot,       char,           dophot type
    51 FIELD stargal,        stargal,      char,           star-galaxy separator
     50FIELD dophot,         DOPHOT,       char,           dophot type
     51FIELD stargal,        STAR_GAL,     char,           star-galaxy separator
    5252
    5353# we need extra bytes for padding purposes...
    54 FIELD dummy,          dummy,        char[2],        padding
    55 
    56 # float : 13 x 4 = 52
    57 # int:     6 x 4 = 24
    58 # short:   8 x 2 = 16
    59 # char :   2     =  2
     54FIELD dummy,          DUMMY,        char[2],        padding
  • trunk/Ohana/src/libautocode/def/measure-panstarrs-dev-1.d

    r15034 r15511  
    88FIELD dD,             D_DEC,        float,          DEC offset,                   arcsec
    99FIELD M,              MAG,          float,          catalog mag,                  mag
    10 FIELD Mcal,           Mcal,         float,          image cal mag,                mag
    11 FIELD Mgal,           Mgal,         float,          galaxy mag,                   mag
    12 FIELD dM,             dM,           float,          mag error,                    mag
    13 FIELD dt,             dt,           float,          exposure time,                2.5*log(exptime)
     10FIELD Mcal,           M_CAL,        float,          image cal mag,                mag
     11FIELD Mgal,           M_GAL,        float,          galaxy mag,                   mag
     12FIELD dM,             MAG_ERR,      float,          mag error,                    mag
     13FIELD dt,             M_TIME,       float,          exposure time,                2.5*log(exptime)
    1414
    1515# note that with airmass = 1.0 / cos(90 - alt), we have full alt/az representation
    16 FIELD airmass,        airmass,      float,          (airmass - 1),                airmass
     16FIELD airmass,        AIRMASS,      float,          (airmass - 1),                airmass
    1717FIELD az,             AZ,           float,          telescope azimuth
    1818
     
    2525FIELD dSky,           SKY_FLUX_ERR, float,          local estimate of sky flux,    counts/sec
    2626
    27 FIELD t,              t,            unsigned int,   time in seconds (UNIX)
    28 FIELD averef,         averef,       unsigned int,   reference to average entry     
     27FIELD t,              TIME,         unsigned int,   time in seconds (UNIX)
     28FIELD averef,         AVE_REF,      unsigned int,   reference to average entry     
    2929
    3030# Pan-STARRS uses a 64-bit detection ID.  keep this in two 32 bit ints for backwards compatibility?
     
    3535FIELD imageID_lo,     IMAGE_ID_LO,  unsigned int,   reference to image
    3636
    37 FIELD FWx,            FWx,          short,          object fwhm major axis,       1/100 of arcsec
    38 FIELD FWy,            FWy,          short,          object fwhm minor axis,       1/100 of arcsec
    39 FIELD theta,          theta,        short,          angle wrt ccd X dir,          (0xffff/360) deg
    40 FIELD photcode,       photcode,     unsigned short, photcode
     37FIELD FWx,            FWHM_MAJOR,   short,          object fwhm major axis,       1/100 of arcsec
     38FIELD FWy,            FWHM_MINOR,   short,          object fwhm minor axis,       1/100 of arcsec
     39FIELD theta,          PSF_THETA,    short,          angle wrt ccd X dir,          (0xffff/360) deg
     40FIELD photcode,       PHOTCODE,     unsigned short, photcode
    4141
    42 FIELD flags,          flags,        unsigned short, flags for various uses 
     42FIELD flags,          FLAGS,        unsigned short, flags for various uses 
    4343
    4444FIELD dXccd,          X_CCD_ERR,    short,          X coord error on chip,         pixels
     
    4848FIELD qPSF,           PSF_QF,       short,          psf coverage/quality factor
    4949
    50 FIELD dophot,         dophot,       char,           dophot type
    51 FIELD stargal,        stargal,      char,           star-galaxy separator
     50FIELD dophot,         DOPHOT,       char,           dophot type
     51FIELD stargal,        STAR_GAL,     char,           star-galaxy separator
    5252
    5353# we need extra bytes for padding purposes...
    54 FIELD dummy,          dummy,        char[2],        padding
    55 
    56 # float : 13 x 4 = 52
    57 # int:     6 x 4 = 24
    58 # short:   8 x 2 = 16
    59 # char :   2     =  2
     54FIELD dummy,          DUMMY,        char[2],        padding
  • trunk/Ohana/src/libautocode/def/measure-ps1-dev-1.d

    r15038 r15511  
    2929
    3030# Pan-STARRS uses a 64-bit detection ID.  keep this in two 32 bit ints for backwards compatibility?
    31 FIELD detID,          DET_ID,       unsigned int,   ID upper bytes
     31FIELD detID,          DET_ID,       unsigned int,   detection ID
    3232FIELD imageID,        IMAGE_ID,     unsigned int,   reference to image
    3333
     
    5555
    5656FIELD dummy,          DUMMY,        char[2],        padding
    57 
    58 # float : 17 x 4 = 68
    59 # int:     6 x 4 = 24
    60 # short:   8 x 2 = 16
    61 # char :   2     =  2
  • trunk/Ohana/src/libautocode/def/measure.d

    r15038 r15511  
    88FIELD dD,             D_DEC,        float,          DEC offset,                   arcsec
    99FIELD M,              MAG,          float,          catalog mag,                  mag
    10 FIELD Mcal,           Mcal,         float,          image cal mag,                mag
    11 FIELD Mgal,           Mgal,         float,          galaxy mag,                   mag
    12 FIELD dM,             dM,           float,          mag error,                    mag
    13 FIELD dt,             dt,           float,          exposure time,                2.5*log(exptime)
     10FIELD Mcal,           M_CAL,        float,          image cal mag,                mag
     11FIELD Mgal,           M_GAL,        float,          galaxy mag,                   mag
     12FIELD dM,             MAG_ERR,      float,          mag error,                    mag
     13FIELD dt,             M_TIME,       float,          exposure time,                2.5*log(exptime)
    1414
    1515# note that with airmass = 1.0 / cos(90 - alt), we have full alt/az representation
    16 FIELD airmass,        airmass,      float,          (airmass - 1),                airmass
     16FIELD airmass,        AIRMASS,      float,          (airmass - 1),                airmass
    1717FIELD az,             AZ,           float,          telescope azimuth
    1818
     
    2525FIELD dSky,           SKY_FLUX_ERR, float,          local estimate of sky flux,    counts/sec
    2626
    27 FIELD t,              t,            unsigned int,   time in seconds (UNIX)
    28 FIELD averef,         averef,       unsigned int,   reference to average entry     
     27FIELD t,              TIME,         unsigned int,   time in seconds (UNIX)
     28FIELD averef,         AVE_REF,      unsigned int,   reference to average entry     
    2929
    3030# Pan-STARRS uses a 64-bit detection ID.  keep this in two 32 bit ints for backwards compatibility?
     
    3838FIELD extNsigma,      EXT_NSIGMA,   float,          psf coverage/quality factor
    3939
    40 FIELD FWx,            FWx,          short,          object fwhm major axis,       1/100 of arcsec
    41 FIELD FWy,            FWy,          short,          object fwhm minor axis,       1/100 of arcsec
    42 FIELD theta,          theta,        short,          angle wrt ccd X dir,          (0xffff/360) deg
    43 FIELD photcode,       photcode,     unsigned short, photcode
     40FIELD FWx,            FWHM_MAJOR,   short,          object fwhm major axis,       1/100 of arcsec
     41FIELD FWy,            FWHM_MINOR,   short,          object fwhm minor axis,       1/100 of arcsec
     42FIELD theta,          PSF_THETA,    short,          angle wrt ccd X dir,          (0xffff/360) deg
     43FIELD photcode,       PHOTCODE,     unsigned short, photcode
    4444
    4545FIELD dXccd,          X_CCD_ERR,    short,          X coord error on chip,         pixels
     
    4949FIELD photFlags,      PHOT_FLAGS,   unsigned short, flags supplied by photometry program
    5050
    51 FIELD stargal,        stargal,      char,           star-galaxy separator
     51FIELD stargal,        STAR_GAL,     char,           star-galaxy separator
    5252
    5353# absorb these into photFlags?
    54 FIELD dophot,         dophot,       char,           dophot type
     54FIELD dophot,         DOPHOT,       char,           dophot type
    5555
    5656FIELD dummy,          DUMMY,        char[2],        padding
  • trunk/Ohana/src/libdvo/src/dvo_convert_elixir.c

    r15487 r15511  
    1010
    1111  for (i = 0; i < Nvalues; i++) {
    12     out[i].dR       = in[i].dR * 0.01;
    13     out[i].dD       = in[i].dD * 0.01;
    14     out[i].M        = in[i].M  * 0.001;
    15     out[i].dM       = in[i].dM * 0.001;
    16     out[i].dt       = in[i].dt * 0.001;
    17     out[i].Mcal     = in[i].Mcal * 0.001;
    18     out[i].Mgal     = in[i].Mgal * 0.001;
    19     out[i].airmass  = in[i].airmass * 0.001;
     12    out[i].dR       = (in[i].dR      == NAN_S_SHORT) ? NAN : in[i].dR    * 0.01;
     13    out[i].dD       = (in[i].dD      == NAN_S_SHORT) ? NAN : in[i].dD    * 0.01;
     14    out[i].M        = (in[i].M       == NAN_S_SHORT) ? NAN : in[i].M      * 0.001;
     15    out[i].dM       = (in[i].dM      == NAN_U_CHAR)  ? NAN : in[i].dM    * 0.001;
     16    out[i].dt       = (in[i].dt      == NAN_S_SHORT) ? NAN : in[i].dt    * 0.001;
     17    out[i].Mcal     = (in[i].Mcal    == NAN_S_SHORT) ? NAN : in[i].Mcal  * 0.001;
     18    out[i].Mgal     = (in[i].Mgal    == NAN_S_SHORT) ? NAN : in[i].Mgal  * 0.001;
     19    out[i].airmass  = (in[i].airmass == NAN_S_SHORT) ? NAN : in[i].airmass* 0.001;
    2020    out[i].FWx      = in[i].FWx;
    2121    out[i].FWy      = in[i].fwy * in[i].FWx * 0.01;
     
    6060
    6161  for (i = 0; i < Nvalues; i++) {
    62     out[i].dR      = in[i].dR * 100.0;
    63     out[i].dD      = in[i].dD * 100.0;
    64     out[i].M       = in[i].M  * 1000.0;
     62    out[i].dR       = isnan(in[i].dR     ) ? NAN_S_SHORT : in[i].dR      *  100.0;
     63    out[i].dD       = isnan(in[i].dD     ) ? NAN_S_SHORT : in[i].dD      *  100.0;
     64    out[i].M        = isnan(in[i].M      ) ? NAN_S_SHORT : in[i].M       * 1000.0;
     65    out[i].dM       = isnan(in[i].dM     ) ? NAN_U_CHAR  : in[i].dM      * 1000.0;
     66    out[i].dt       = isnan(in[i].dt     ) ? NAN_S_SHORT : in[i].dt      * 1000.0;
     67    out[i].Mcal     = isnan(in[i].Mcal   ) ? NAN_S_SHORT : in[i].Mcal    * 1000.0;
     68    out[i].Mgal     = isnan(in[i].Mgal   ) ? NAN_S_SHORT : in[i].Mgal    * 1000.0;
     69    out[i].airmass  = isnan(in[i].airmass) ? NAN_S_SHORT : in[i].airmass * 1000.0;
     70
    6571    if (out[i].M < 0) {
    6672        fprintf (stderr, ".");
    6773    }
    68     out[i].dM      = in[i].dM * 1000.0;
    69     out[i].dt      = in[i].dt * 1000.0;
    70     out[i].Mcal    = in[i].Mcal * 1000.0;
    71     out[i].Mgal    = in[i].Mgal * 1000.0;
    72     out[i].airmass = in[i].airmass * 1000.0;
     74
    7375    out[i].FWx     = in[i].FWx;
    7476    out[i].fwy     = in[i].FWy * 100.0 / in[i].FWx;
     
    116118    out[i].objID_lo = 0;
    117119
    118     primary[0][i].M  = in[i].M  * 0.001;     
    119     primary[0][i].dM = in[i].dM * 0.001;     
    120     primary[0][i].Xm = in[i].Xm;     
     120    primary[0][i].M     = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M  * 0.001;     
     121    primary[0][i].dM    = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM * 0.001;     
     122    primary[0][i].Xm    = in[i].Xm;     
    121123    primary[0][i].Ncode = 0;     
    122124    primary[0][i].Nused = 0;
    123 
    124     // XXX drop this or keep this?
    125     // primary[0][i].Xg = in[i].Xg;
    126125  }
    127126  return (out);
     
    146145    out[i].missing = in[i].missing;
    147146
    148     out[i].M       = primary[i].M  * 1000.0;     
    149     out[i].dM      = primary[i].dM * 1000.0;
     147    out[i].M       = isnan(primary[i].M)  ? NAN_S_SHORT : primary[i].M   * 1000.0;
     148    out[i].dM      = isnan(primary[i].dM) ? NAN_S_SHORT : primary[i].dM * 1000.0;
    150149    out[i].Xm      = primary[i].Xm;     
    151     // out[i].Xg      = in[i].Xg;
    152150  }
    153151  return (out);
     
    163161
    164162  for (i = 0; i < Nvalues; i++) {
    165     out[i].M     = in[i].M  * 0.001;     
    166     out[i].dM    = in[i].dM * 0.001;     
     163    out[i].M     = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M   * 0.001;
     164    out[i].dM    = (in[i].dM == NAN_S_SHORT) ? NAN : in[i].dM  * 0.001;
    167165    out[i].Xm    = in[i].Xm;     
    168166    out[i].Ncode = 0;
     
    181179
    182180  for (i = 0; i < Nvalues; i++) {
    183     out[i].M       = in[i].M  * 1000.0;     
    184     out[i].dM      = in[i].dM * 1000.0;
    185     out[i].Xm      = in[i].Xm;     
     181    out[i].M     = isnan(in[i].M)  ? NAN_S_SHORT : in[i].M   * 1000.0;
     182    out[i].dM    = isnan(in[i].dM) ? NAN_S_SHORT : in[i].dM * 1000.0;
     183    out[i].Xm    = in[i].Xm;     
    186184  }
    187185  return (out);
     
    198196  for (i = 0; i < Nvalues; i++) {
    199197    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    200     memcpy (out[i].dummy, in[i].dummy, 20);
    201     strcpy (out[i].name, in[i].name);
     198    strcpy (out[i].name, in[i].name); // out[64], in[32]
    202199
    203200    out[i].tzero            = in[i].tzero;
    204201    out[i].nstar            = in[i].nstar;
    205     out[i].secz             = in[i].secz * 0.001;
    206202    out[i].NX               = in[i].NX;
    207203    out[i].NY               = in[i].NY;
    208     out[i].apmifit          = in[i].apmifit * 0.001;
    209     out[i].dapmifit         = in[i].dapmifit * 0.001;
    210     out[i].Mcal             = in[i].Mcal * 0.001;
    211     out[i].dMcal            = in[i].dMcal * 0.001;
     204    out[i].secz             = (in[i].secz     == NAN_S_SHORT) ? NAN : in[i].secz     * 0.001;
     205    out[i].apmifit          = (in[i].apmifit  == NAN_S_SHORT) ? NAN : in[i].apmifit  * 0.001;
     206    out[i].dapmifit         = (in[i].dapmifit == NAN_S_SHORT) ? NAN : in[i].dapmifit * 0.001;
     207    out[i].Mcal             = (in[i].Mcal     == NAN_S_SHORT) ? NAN : in[i].Mcal     * 0.001;
     208    out[i].dMcal            = (in[i].dMcal    == NAN_S_SHORT) ? NAN : in[i].dMcal    * 0.001;
    212209    out[i].Xm               = in[i].Xm;
    213210    out[i].photcode         = in[i].source;
     
    221218    out[i].code             = in[i].code;
    222219    out[i].ccdnum           = in[i].ccdnum;
     220
    223221    out[i].order            = in[i].order;
    224222    out[i].Mx               = in[i].Mx;
     
    239237    /* XXX add these later */
    240238    out[i].imageID = 0;
     239
     240    // not available in ELIXIR
     241    out[i].sidtime          = NAN;
     242    out[i].latitude         = NAN;
    241243  }
    242244  return (out);
     
    253255  for (i = 0; i < Nvalues; i++) {
    254256    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    255     memcpy (out[i].dummy, in[i].dummy, 20);
    256     strcpy (out[i].name, in[i].name);
     257    strncpy (out[i].name, in[i].name, 31); // out[32], in[64]
     258    out[i].name[31] = 0; // force termination
    257259
    258260    out[i].tzero            = in[i].tzero;
    259261    out[i].nstar            = in[i].nstar;
    260     out[i].secz             = in[i].secz * 1000.0;
    261262    out[i].NX               = in[i].NX;
    262263    out[i].NY               = in[i].NY;
    263     out[i].apmifit          = in[i].apmifit * 1000.0;
    264     out[i].dapmifit         = in[i].dapmifit * 1000.0;
    265     out[i].Mcal             = in[i].Mcal * 1000.0;
    266     out[i].dMcal            = in[i].dMcal * 1000.0;
     264    out[i].secz             = isnan(in[i].secz    ) ? NAN_S_SHORT : in[i].secz     * 1000.0;
     265    out[i].apmifit          = isnan(in[i].apmifit ) ? NAN_S_SHORT : in[i].apmifit  * 1000.0;
     266    out[i].dapmifit         = isnan(in[i].dapmifit) ? NAN_S_SHORT : in[i].dapmifit * 1000.0;
     267    out[i].Mcal             = isnan(in[i].Mcal    ) ? NAN_S_SHORT : in[i].Mcal     * 1000.0;
     268    out[i].dMcal            = isnan(in[i].dMcal   ) ? NAN_S_SHORT : in[i].dMcal    * 1000.0;
    267269    out[i].Xm               = in[i].Xm;
    268270    out[i].source           = in[i].photcode;
     
    276278    out[i].code             = in[i].code;
    277279    out[i].ccdnum           = in[i].ccdnum;
     280
    278281    out[i].order            = in[i].order;
    279282    out[i].Mx               = in[i].Mx;
  • trunk/Ohana/src/libdvo/src/dvo_convert_loneos.c

    r15038 r15511  
    1010
    1111  for (i = 0; i < Nvalues; i++) {
    12     out[i].dR        = in[i].dR * 0.01;
    13     out[i].dD        = in[i].dD * 0.01;
    14     out[i].M         = in[i].M  * 0.001;
    15     out[i].dM        = in[i].dM * 0.001;
    16     out[i].Mcal      = in[i].Mcal * 0.001;
     12    out[i].dR        = (in[i].dR      == NAN_S_SHORT) ? NAN : in[i].dR    * 0.01;
     13    out[i].dD        = (in[i].dD      == NAN_S_SHORT) ? NAN : in[i].dD    * 0.01;
     14    out[i].M         = (in[i].M       == NAN_S_SHORT) ? NAN : in[i].M      * 0.001;
     15    out[i].dM        = (in[i].dM      == NAN_U_CHAR)  ? NAN : in[i].dM    * 0.001;
     16    out[i].Mcal      = (in[i].Mcal    == NAN_S_SHORT) ? NAN : in[i].Mcal  * 0.001;
    1717    out[i].dophot    = in[i].dophot;
    1818    out[i].photcode  = in[i].source;
     
    2424
    2525    /* these values don't exist in the Loneos format */
    26     out[i].Mgal     = in[i].M;
     26    out[i].Mgal     = out[i].M;
    2727    out[i].dt       = 0;
    2828    out[i].airmass  = 0;
     
    6262
    6363  for (i = 0; i < Nvalues; i++) {
    64     out[i].dR     = in[i].dR * 100.0;
    65     out[i].dD     = in[i].dD * 100.0;
    66     out[i].M      = in[i].M  * 1000.0;
    67     out[i].dM     = in[i].dM * 1000.0;
    68     out[i].Mcal   = in[i].Mcal * 1000.0;
     64    out[i].dR     = isnan(in[i].dR     ) ? NAN_S_SHORT : in[i].dR      * 100.0;
     65    out[i].dD     = isnan(in[i].dD     ) ? NAN_S_SHORT : in[i].dD      * 100.0;
     66    out[i].M      = isnan(in[i].M      ) ? NAN_S_SHORT : in[i].M       * 1000.0;
     67    out[i].dM     = isnan(in[i].dM     ) ? NAN_U_CHAR  : in[i].dM      * 1000.0;
     68    out[i].Mcal   = isnan(in[i].Mcal   ) ? NAN_S_SHORT : in[i].Mcal    * 1000.0;
    6969    out[i].dophot = in[i].dophot;
    7070    out[i].source = in[i].photcode;
     
    110110    out[i].objID_lo = 0;
    111111
    112     primary[0][i].M  = in[i].M  * 0.001;     
     112    primary[0][i].M  = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M  * 0.001;     
    113113    primary[0][i].Xm = in[i].Xm;     
    114     primary[0][i].dM = 0xffff;
     114    primary[0][i].dM = NAN;
    115115    primary[0][i].Ncode = 0;     
    116116    primary[0][i].Nused = 0;
    117 
    118     // XXX drop this or keep this?
    119     // primary[0][i].Xg = in[i].Xg;
    120117  }
    121118  return (out);
     
    140137    out[i].missing = in[i].missing;
    141138
    142     out[i].M       = primary[i].M * 1000.0;     
     139    out[i].M       = isnan(primary[i].M)  ? NAN_S_SHORT : primary[i].M   * 1000.0;
    143140    out[i].Xm      = primary[i].Xm;     
    144141  }
     
    155152
    156153  for (i = 0; i < Nvalues; i++) {
    157     out[i].M     = in[i].M*0.001;     
     154    out[i].M     = (in[i].M  == NAN_S_SHORT) ? NAN : in[i].M * 0.001;
    158155    out[i].Xm    = in[i].Xm;     
    159     out[i].dM    = 0xffff;
     156    out[i].dM    = NAN;
    160157    out[i].Ncode = 0;
    161158    out[i].Nused = 0;
     
    173170
    174171  for (i = 0; i < Nvalues; i++) {
    175     out[i].M    = in[i].M*1000.0;     
     172    out[i].M    = isnan(in[i].M)  ? NAN_S_SHORT : in[i].M * 1000.0;
    176173    out[i].Xm   = in[i].Xm;     
    177174  }
     
    189186  for (i = 0; i < Nvalues; i++) {
    190187    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    191     memcpy (out[i].dummy, in[i].dummy, 20);
    192     strcpy (out[i].name, in[i].name);
     188    strcpy (out[i].name, in[i].name); // out[64], in[32]
    193189
    194190    out[i].tzero            = in[i].tzero;
    195191    out[i].nstar            = in[i].nstar;
    196     out[i].secz             = in[i].secz * 0.001;
    197192    out[i].NX               = in[i].NX;
    198193    out[i].NY               = in[i].NY;
    199     out[i].apmifit          = in[i].apmifit * 0.001;
    200     out[i].dapmifit         = in[i].dapmifit * 0.001;
    201     out[i].Mcal     = in[i].Mcal * 0.001;
    202     out[i].dMcal            = in[i].dMcal * 0.001;
     194
     195    out[i].secz             = (in[i].secz     == NAN_S_SHORT) ? NAN : in[i].secz     * 0.001;
     196    out[i].apmifit          = (in[i].apmifit  == NAN_S_SHORT) ? NAN : in[i].apmifit  * 0.001;
     197    out[i].dapmifit         = (in[i].dapmifit == NAN_S_SHORT) ? NAN : in[i].dapmifit * 0.001;
     198    out[i].Mcal             = (in[i].Mcal     == NAN_S_SHORT) ? NAN : in[i].Mcal     * 0.001;
     199    out[i].dMcal            = (in[i].dMcal    == NAN_S_SHORT) ? NAN : in[i].dMcal    * 0.001;
     200
    203201    out[i].Xm               = in[i].Xm;
    204202    out[i].photcode         = in[i].source;
     
    244242  for (i = 0; i < Nvalues; i++) {
    245243    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    246     memcpy (out[i].dummy, in[i].dummy, 20);
    247     strcpy (out[i].name, in[i].name);
     244    strncpy (out[i].name, in[i].name, 31); // out[32], in[64]
     245    out[i].name[31] = 0; // force termination
    248246
    249247    out[i].tzero            = in[i].tzero;
    250248    out[i].nstar            = in[i].nstar;
    251     out[i].secz             = in[i].secz * 1000.0;
    252249    out[i].NX               = in[i].NX;
    253250    out[i].NY               = in[i].NY;
    254     out[i].apmifit          = in[i].apmifit * 1000.0;
    255     out[i].dapmifit         = in[i].dapmifit * 1000.0;
    256     out[i].Mcal             = in[i].Mcal * 1000.0;
    257     out[i].dMcal            = in[i].dMcal * 1000.0;
     251
     252    out[i].secz             = isnan(in[i].secz    ) ? NAN_S_SHORT : in[i].secz     * 1000.0;
     253    out[i].apmifit          = isnan(in[i].apmifit ) ? NAN_S_SHORT : in[i].apmifit  * 1000.0;
     254    out[i].dapmifit         = isnan(in[i].dapmifit) ? NAN_S_SHORT : in[i].dapmifit * 1000.0;
     255    out[i].Mcal             = isnan(in[i].Mcal    ) ? NAN_S_SHORT : in[i].Mcal     * 1000.0;
     256    out[i].dMcal            = isnan(in[i].dMcal   ) ? NAN_S_SHORT : in[i].dMcal    * 1000.0;
     257
    258258    out[i].Xm               = in[i].Xm;
    259259    out[i].source           = in[i].photcode;
  • trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c

    r15038 r15511  
    3434    out[i].Sky        = in[i].Sky;
    3535    out[i].dSky       = in[i].dSky;
    36     out[i].qPSF       = in[i].qPSF;
     36    out[i].qPSF       = (in[i].qPSF == NAN_S_SHORT) ? NAN : in[i].qPSF;
    3737    out[i].detID      = in[i].detID_lo;
    3838    out[i].imageID    = in[i].imageID_lo;
     
    8080    out[i].Sky        = in[i].Sky;
    8181    out[i].dSky       = in[i].dSky;
    82     out[i].qPSF       = in[i].qPSF;
     82    out[i].qPSF       = isnan(in[i].qPSF) ? NAN_S_SHORT : in[i].qPSF;
    8383    out[i].detID_hi   = 0;
    8484    out[i].detID_lo   = in[i].detID;
     
    199199  for (i = 0; i < Nvalues; i++) {
    200200    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    201     strcpy (out[i].name, in[i].name);
     201    strcpy (out[i].name, in[i].name); // out[64], in[32]
    202202
    203203    out[i].tzero            = in[i].tzero;
     
    254254  for (i = 0; i < Nvalues; i++) {
    255255    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    256     strcpy (out[i].name, in[i].name);
     256    strncpy (out[i].name, in[i].name, 31); // out[32], in[64]
     257    out[i].name[31] = 0; // force termination
    257258
    258259    out[i].tzero            = in[i].tzero;
  • trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c

    r15038 r15511  
    3434    out[i].Sky        = in[i].Sky;
    3535    out[i].dSky       = in[i].dSky;
    36     out[i].qPSF       = in[i].qPSF;
     36    out[i].qPSF       = (in[i].qPSF == NAN_S_SHORT) ? NAN : in[i].qPSF;
    3737    out[i].detID      = in[i].detID_lo;
    3838    out[i].imageID    = in[i].imageID_lo;
     
    8080    out[i].Sky        = in[i].Sky;
    8181    out[i].dSky       = in[i].dSky;
    82     out[i].qPSF       = in[i].qPSF;
     82    out[i].qPSF       = isnan(in[i].qPSF) ? NAN_S_SHORT : in[i].qPSF;
    8383    out[i].detID_hi   = 0;
    8484    out[i].detID_lo   = in[i].detID;
Note: See TracChangeset for help on using the changeset viewer.