IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39521 for trunk


Ignore:
Timestamp:
Apr 9, 2016, 11:19:31 AM (10 years ago)
Author:
eugene
Message:

add function TimeRange to convert formats; adjust rrLyra & QSO flags

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

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libdvo/include/convert.h

    r38553 r39521  
    1010time_t        TimeRef               PROTO((double time, time_t TimeReference, int TimeFormat));
    1111double        TimeValue             PROTO((time_t time, time_t TimeReference, int TimeFormat));
     12double        TimeRange             PROTO((time_t time, int TimeFormat));
    1213
    1314int           hh_hms                PROTO((double hh, int *hr, int *mn, double *sc));
  • trunk/Ohana/src/libdvo/include/dvo.h

    r39480 r39521  
    174174  ID_OBJ_FEW             = 0x00000001, // used within relphot: skip star
    175175  ID_OBJ_POOR            = 0x00000002, // used within relphot: skip star
     176
    176177  // NOTE: bits used for object classification:
    177178  ID_OBJ_ICRF_QSO        = 0x00000004, // object IDed with known ICRF quasar (may have ICRF position measurement)
    178   ID_OBJ_OTHEF_QSO       = 0x00000008, // identified as likely QSO (Hernitschek et al 2015), without ICRF reference data
    179   ID_OBJ_TRANSIENT       = 0x00000010, // identified as a non-periodic (stationary) transient
    180   ID_OBJ_VARIABLE        = 0x00000020, // identified as a periodic variable
    181   ID_OBJ_RRLYRA          = 0x00000040, // identified as likely RR Lyra (Hernitschek et al 2015)
    182   ID_OBJ_HAS_SOLSYS_DET  = 0x00000080, // identified with a known solar-system object (asteroid or other)
    183   ID_OBJ_ALL_SOLSYS_DET  = 0x00000100, // identified with a known solar-system object (asteroid or other)
    184   // bits 0x00000200 - 0x00000400 are currently unused
     179  ID_OBJ_HERN_QSO_P60    = 0x00000008, // identified as likely QSO (Hernitschek et al 2015), P_QSO = 0.60
     180  ID_OBJ_HERN_QSO_P05    = 0x00000010, // identified as possible QSO (Hernitschek et al 2015), P_QSO = 0.05
     181  ID_OBJ_HERN_RRL_P60    = 0x00000020, // identified as likely  RR Lyra (Hernitschek et al 2015), P_RRLyra = 0.60
     182  ID_OBJ_HERN_RRL_P05    = 0x00000040, // identified as possible RR Lyra (Hernitschek et al 2015), P_RRLyra = 0.05
     183  ID_OBJ_HERN_VARIABLE   = 0x00000080, // identified as a variable based on ChiSq (Hernitschek et al 2015)
     184  ID_OBJ_TRANSIENT       = 0x00000100, // identified as a non-periodic (stationary) transient
     185  ID_OBJ_HAS_SOLSYS_DET  = 0x00000200, // identified with a known solar-system object (asteroid or other)
     186  ID_OBJ_MOST_SOLSYS_DET = 0x00000400, // most detections from a known solar-system object
     187
    185188  // NOTE: bits used for astrometry analysis
    186189  ID_OBJ_LARGE_PM        = 0x00000800, // star with large proper motion
     
    196199  ID_OBJ_MEAN_FOR_STACK  = 0x00200000, // mean astrometry could not be measured
    197200  ID_OBJ_BAD_PM          = 0x00400000, // failure to measure proper-motion model
     201
    198202  // NOTE: bits used for photometry analysis
    199203  ID_OBJ_EXT             = 0x00800000, // extended in our data (eg, PS)
  • trunk/Ohana/src/libdvo/include/dvodb.h

    r39462 r39521  
    491491int           GetTimeSelection      PROTO((time_t *tz, time_t *te));
    492492int           GetTimeFormat         PROTO((time_t *TimeReference, int *TimeFormat));
    493 double        TimeValue (time_t time, time_t TimeReference, int TimeFormat);
     493double        TimeValue             PROTO((time_t time, time_t TimeReference, int TimeFormat));
     494double        TimeRange             PROTO((time_t time, int TimeFormat));
    494495
    495496void          image_subset          PROTO((Image *image, off_t Nimage, off_t **Subset, off_t *Nsubset, SkyRegionSelection *selection, e_time tzero, double trange, int TimeSelect));
  • trunk/Ohana/src/libdvo/src/convert.c

    r38553 r39521  
    261261}
    262262 
     263/* convert UNIX time (sec) range to a time range in the given unit */
     264double TimeRange (time_t dt, int TimeFormat) {
     265
     266  double value;
     267
     268  switch (TimeFormat) {
     269  case TIME_JD:
     270  case TIME_MJD:
     271  case TIME_DAYS:
     272    value = dt / 86400.0;
     273    break;
     274  case TIME_HOURS:
     275    value = dt / 3600.0;
     276    break;
     277  case TIME_MINUTES:
     278    value = dt / 60.0;
     279    break;
     280  case TIME_SECONDS:
     281  default:
     282    value = dt;
     283    break;
     284  }
     285  return (value);
     286}
     287 
    263288/* convert time value referenced to the TimeReference in the given unit to UNIX time */
    264289time_t TimeRef (double value, time_t TimeReference, int TimeFormat) {
  • trunk/Ohana/src/libdvo/src/dbExtractAverages.c

    r39462 r39521  
    165165      break;
    166166    case AVE_TRANGE:
    167       value.Flt = TimeValue (average[0].Trange, 0, TimeFormat);
     167      value.Flt = TimeRange (average[0].Trange, TimeFormat);
    168168      break;
    169169
  • trunk/Ohana/src/libdvo/src/dbExtractMeasures.c

    r39269 r39521  
    411411      break;
    412412    case MEAS_TMEAN: /* OK */
    413       value.Flt = TimeValue (average[0].Tmean, TimeReference, TimeFormat);
     413      value.Flt = TimeRange (average[0].Trange, TimeFormat);
    414414      break;
    415415    case MEAS_TRANGE: /* OK */
Note: See TracChangeset for help on using the changeset viewer.