IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 11, 2015, 2:14:39 PM (12 years ago)
Author:
eugene
Message:

merge changes from eam branch ipp-20140904

Location:
trunk/Ohana
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/libdvo/include/dvo.h

    r37729 r37807  
    2424  DVO_FORMAT_PS1_DEV_3,
    2525  DVO_FORMAT_PS1_REF,
     26  DVO_FORMAT_PS1_SIM,
    2627  DVO_FORMAT_PS1_V1,
    2728  DVO_FORMAT_PS1_V2,
     
    3637
    3738typedef enum {DVO_CAT_OPEN_FAIL, DVO_CAT_OPEN_OK, DVO_CAT_OPEN_EMPTY} DVOCatalogOpenModes;
    38 
    39 typedef enum {
    40   PROJ_NONE, // undefined
    41   PROJ_ZEA, // zenithal
    42   PROJ_ZPL, // zenithal
    43   PROJ_ARC, // zenithal
    44   PROJ_STG, // zenithal
    45   PROJ_SIN, // zenithal
    46   PROJ_TAN, // zenithal
    47   PROJ_TNX, // zenithal
    48   PROJ_DIS, // zenithal (TAN + polyterms)
    49   PROJ_LIN, // cartesian
    50   PROJ_PLY, // cartesian
    51   PROJ_WRP, // cartesian
    52   PROJ_AIT, // pseudocyl
    53   PROJ_GLS, // pseudocyl
    54   PROJ_PAR, // pseudocyl
    55 } OhanaProjection;
    56 
    57 typedef enum {
    58   PROJ_MODE_NONE,
    59   PROJ_MODE_CARTESIAN,
    60   PROJ_MODE_ZENITHAL,
    61   PROJ_MODE_PSEUDOCYL,
    62 } OhanaProjectionMode;
    6339
    6440// these are used as NAN for types of int values
     
    7955
    8056/* catalog values to be loaded */
    81 # define LOAD_NONE      0x000
    82 # define LOAD_AVES      0x001
    83 # define LOAD_MEAS      0x002
    84 # define LOAD_MISS      0x004
    85 # define LOAD_SECF      0x008
    86 # define SKIP_AVES      0x010
    87 # define SKIP_MEAS      0x020
    88 # define SKIP_MISS      0x040
    89 # define SKIP_SECF      0x080
    90 # define LOAD_LENSING   0x100
    91 # define LOAD_LENSOBJ   0x200
    92 # define SKIP_LENSING   0x400
    93 # define SKIP_LENSOBJ   0x800
     57# define LOAD_NONE      0x0000
     58# define LOAD_AVES      0x0001
     59# define LOAD_MEAS      0x0002
     60# define LOAD_MISS      0x0004
     61# define LOAD_SECF      0x0008
     62# define SKIP_AVES      0x0010
     63# define SKIP_MEAS      0x0020
     64# define SKIP_MISS      0x0040
     65# define SKIP_SECF      0x0080
     66# define LOAD_LENSING   0x0100
     67# define LOAD_LENSOBJ   0x0200
     68# define SKIP_LENSING   0x0400
     69# define SKIP_LENSOBJ   0x0800
     70# define LOAD_STARPAR   0x1000
     71# define SKIP_STARPAR   0x2000
    9472
    9573/* photometry code types */
     
    11492  ID_IMAGE_ASTROM_FEW     = 0x00000100,  /* currently too few measurements for astrometry */
    11593  ID_IMAGE_PHOTOM_UBERCAL = 0x00000200,  /* externally-supplied photometry zero point from ubercal analysis */
     94  ID_IMAGE_ASTROM_GMM     = 0x00000400,  /* image was fitted to positions corrected by the galaxy motion model */
    11695} DVOImageFlags;
    11796
     
    136115  ID_MEAS_STACK_PRIMARY  = 0x00010000,  // this stack measurement is in the primary skycell
    137116  ID_MEAS_STACK_PHOT_SRC = 0x00020000,  // this measurement supplied the stack photometry
     117  ID_MEAS_ICRF_QSO       = 0x00040000,  // this measurement is an ICRF reference position
     118  ID_MEAS_IMAGE_EPOCH    = 0x00080000,  // this measurement is registered to the image epoch (not tied to ref catalog epoch)
    138119} DVOMeasureFlags;
    139120
     
    152133*/
    153134
     135/** these names were previously used for Average flags in old (LONEOS-era) dvo versions
     136  ID_BAD_OBJECT        = 0x00004000, // if all measurements are bad, set this bit
     137  ID_MOVING            = 0x00008000, // is a moving object
     138  ID_ROCK              = 0x0000a000, // 0x8000 + 0x2000
     139  ID_GHOST             = 0x0000c001, // 0x8000 + 0x4000 + 0x0001
     140  ID_TRAIL             = 0x0000c002, // 0x8000 + 0x4000 + 0x0002
     141  ID_BLEED             = 0x0000c003, // 0x8000 + 0x4000 + 0x0003
     142  ID_COSMIC            = 0x0000c004, // 0x8000 + 0x4000 + 0x0004
     143**/
     144
    154145/* Average.flags values -- these values are 32 bit (as of PS1_V1) */
    155146typedef enum {
    156   ID_STAR_FEW       = 0x00000001, // used within relphot: skip star
    157   ID_STAR_POOR      = 0x00000002, // used within relphot: skip star
    158   ID_PROPER         = 0x00000400, // star with large proper motion
    159   ID_TRANSIENT      = 0x00001000, // is this mutually exclusive with USNO?
    160   ID_VARIABLE       = 0x00002000, // not currently set?
    161   ID_ASTEROID       = 0x00002000, // identified with an asteroid
    162   ID_BAD_OBJECT     = 0x00004000, // if all measurements are bad, set this bit
    163   ID_MOVING         = 0x00008000, // is a moving object
    164   ID_ROCK           = 0x0000a000, // 0x8000 + 0x2000
    165   ID_GHOST          = 0x0000c001, // 0x8000 + 0x4000 + 0x0001
    166   ID_TRAIL          = 0x0000c002, // 0x8000 + 0x4000 + 0x0002
    167   ID_BLEED          = 0x0000c003, // 0x8000 + 0x4000 + 0x0003
    168   ID_COSMIC         = 0x0000c004, // 0x8000 + 0x4000 + 0x0004
    169   ID_STAR_FIT_AVE   = 0x00010000, // average position fitted
    170   ID_STAR_FIT_PM    = 0x00020000, // proper motion fitted
    171   ID_STAR_FIT_PAR   = 0x00040000, // parallax fitted
    172   ID_STAR_USE_AVE   = 0x00080000, // average position used (not PM or PAR)
    173   ID_STAR_USE_PM    = 0x00100000, // proper motion used (not AVE or PAR)
    174   ID_STAR_USE_PAR   = 0x00200000, // parallax used (not AVE or PM)
    175   ID_STAR_NO_ASTROM = 0x00400000, // mean astrometry could not be measured
    176   ID_STAR_BAD_PM    = 0x00800000, // mean astrometry could not be measured
    177   ID_OBJ_EXT        = 0x01000000, // extended in our data (eg, PS)
    178   ID_OBJ_EXT_ALT    = 0x02000000, // extended in external data (eg, 2MASS)
    179   ID_OBJ_GOOD       = 0x04000000, // good-quality measurement in our data (eg,PS)
    180   ID_OBJ_GOOD_ALT   = 0x08000000, // good-quality measurement in  external data (eg, 2MASS)
    181   ID_OBJ_GOOD_STACK = 0x10000000, // good-quality object in the stack (> 1 good stack)
     147  ID_STAR_FEW          = 0x00000001, // used within relphot: skip star
     148  ID_STAR_POOR         = 0x00000002, // used within relphot: skip star
     149  ID_ICRF_QSO          = 0x00000004, // object IDed with known ICRF quasar (may have ICRF position measurement)
     150  ID_OTHEF_QSO         = 0x00000008, // object IDed with known or suspected quasar, without ICRF reference data
     151  ID_PROPER            = 0x00000010, // star with large proper motion
     152  ID_TRANSIENT         = 0x00000020, // identified as a non-periodic (stationary) transient
     153  ID_VARIABLE          = 0x00000040, // identified as a period variable
     154  ID_ASTEROID          = 0x00000080, // identified with a known solar-system object (asteroid or other)
     155  // bits 0x00000100 - 0x00008000 are currently unused
     156  ID_STAR_FIT_AVE      = 0x00010000, // average position fitted
     157  ID_STAR_FIT_PM       = 0x00020000, // proper motion fitted
     158  ID_STAR_FIT_PAR      = 0x00040000, // parallax fitted
     159  ID_STAR_USE_AVE      = 0x00080000, // average position used (not PM or PAR)
     160  ID_STAR_USE_PM       = 0x00100000, // proper motion used (not AVE or PAR)
     161  ID_STAR_USE_PAR      = 0x00200000, // parallax used (not AVE or PM)
     162  ID_STAR_NO_ASTROM    = 0x00400000, // mean astrometry could not be measured
     163  ID_STAR_BAD_PM       = 0x00800000, // mean astrometry could not be measured
     164  ID_OBJ_EXT           = 0x01000000, // extended in our data (eg, PS)
     165  ID_OBJ_EXT_ALT       = 0x02000000, // extended in external data (eg, 2MASS)
     166  ID_OBJ_GOOD          = 0x04000000, // good-quality measurement in our data (eg,PS)
     167  ID_OBJ_GOOD_ALT      = 0x08000000, // good-quality measurement in  external data (eg, 2MASS)
     168  ID_OBJ_GOOD_STACK    = 0x10000000, // good-quality object in the stack (> 1 good stack)
    182169  ID_OBJ_SUSPECT_STACK = 0x20000000, // suspect object in the stack (> 1 good or suspect stack, < 2 good)
    183   ID_OBJ_BAD_STACK  = 0x40000000, // good-quality object in the stack (> 1 good stack)
     170  ID_OBJ_BAD_STACK     = 0x40000000, // good-quality object in the stack (> 1 good stack)
    184171} DVOAverageFlags;
    185172
     
    202189} DVOSecfiltFlags;
    203190
     191/* definitions for parallel dvo host information
     192   XXX : need better names (safer namespace)
     193*/
     194
     195typedef enum {
     196  DATA_ON_TGT  = 0x01,
     197  DATA_ON_BCK  = 0x02,
     198  DATA_USE_BCK = 0x04,
     199
     200  DATA_COPY_FAILURE = 0x80,
     201} SkyTableDataFlags;
     202
     203typedef enum {
     204  HOST_STDIN = 0,
     205  HOST_STDOUT = 1,
     206  HOST_STDERR = 2,
     207} HostInfoIOfd;
     208
    204209/*** general dvo structures (internal use only / not IO) ***/
    205210
     
    253258} FlatCorrectionTable;
    254259
    255 /* definitions for parallel dvo host information
    256    XXX : need better names (safer namespace)
    257 */
    258 
    259 typedef enum {
    260   DATA_ON_TGT  = 0x01,
    261   DATA_ON_BCK  = 0x02,
    262   DATA_USE_BCK = 0x04,
    263 
    264   DATA_COPY_FAILURE = 0x80,
    265 } SkyTableDataFlags;
    266 
    267 typedef enum {
    268   HOST_STDIN = 0,
    269   HOST_STDOUT = 1,
    270   HOST_STDERR = 2,
    271 } HostInfoIOfd;
    272 
    273260typedef struct {
    274261  char *hostname;             // name of remote machine
     
    289276} HostTable;
    290277
     278typedef struct {
     279  int Nhosts;
     280  HostInfo **hosts;
     281} HostTableGroup;
     282
    291283// A RegionHost processes data for some region in parallel with other regions
    292284typedef struct RegionHostInfo {
     
    314306  Image *image;
    315307  off_t *imseq;
     308
     309  AstromOffsetTable *astromTable;
    316310
    317311  int *neighbors;             // list of neighbor index values
     
    444438  double         R;
    445439  double         D;
     440  float          RoffGAL;
     441  float          DoffGAL;
    446442  float          M;
    447443  float          Mcal;
     
    645641  int              lensobjOffset;        // offset to mean lensing data
    646642  int              extendOffset;         // offset to extended object entry
    647   int              paramsOffset;         // offset to stellar parameter data
     643  int              starparOffset;        // offset to stellar parameter data
    648644  float            refColorBlue;         // color of astrometry ref stars
    649645  float            refColorRed;          // color of astrometry ref stars
     
    679675  Lensing *lensing;
    680676  Lensobj *lensobj;
     677  StarPar *starpar;
    681678
    682679  int Nsecfilt;  /* number of secfilt entries for each average entry */
    683   off_t Naverage,   Nmeasure,   Nmissing,   Nlensing,      Nlensobj,      Nsecf_mem;  /* current number of each component in memory */
    684   off_t Naves_disk, Nmeas_disk, Nmiss_disk, Nlensing_disk, Nlensobj_disk, Nsecf_disk; /* current number of each component on disk */
    685   off_t Naves_off,  Nmeas_off,  Nmiss_off,  Nlensing_off,  Nlensobj_off,  Nsecf_off;  /* index of first loaded data value */
     680  off_t Naverage,   Nmeasure,   Nmissing,   Nlensing,      Nlensobj,      Nstarpar,      Nsecf_mem;  /* current number of each component in memory */
     681  off_t Naves_disk, Nmeas_disk, Nmiss_disk, Nlensing_disk, Nlensobj_disk, Nstarpar_disk, Nsecf_disk; /* current number of each component on disk */
     682  off_t Naves_off,  Nmeas_off,  Nmiss_off,  Nlensing_off,  Nlensobj_off,  Nstarpar_off,  Nsecf_off;  /* index of first loaded data value */
    686683
    687684  // note that we use these for the full-sky relphot analysis
     
    704701  struct Catalog *lensing_catalog;              /* lensing catalog data (split) */
    705702  struct Catalog *lensobj_catalog;              /* lensobj catalog data (split) */
     703  struct Catalog *starpar_catalog;              /* starpar catalog data (split) */
    706704
    707705  unsigned int objID;
     
    739737int   gfits_db_close               PROTO((FITS_DB *db));
    740738int   gfits_db_free                PROTO((FITS_DB *db));
    741 
    742 /* in coords.c, using libautocode/def/coords.d */
    743 int  XY_to_LM (double *L, double *M, double x,  double y,   Coords *coords);
    744 int  LM_to_XY (double *x,  double *y,   double L, double M, Coords *coords);
    745 int  RD_to_LM (double *L, double *M, double ra,  double dec,   Coords *coords);
    746 int  LM_to_RD (double *ra, double *dec,   double L, double M, Coords *coords);
    747 int  XY_to_RD (double *ra, double *dec, double x,  double y,   Coords *coords);
    748 int  RD_to_XY (double *x,  double *y,   double ra, double dec, Coords *coords);
    749 int  fXY_to_RD (float *ra, float *dec, double x,  double y,   Coords *coords);
    750 int  fRD_to_XY (float *x,  float *y,   double ra, double dec, Coords *coords);
    751 int  GetCoords (Coords *coords, Header *header);
    752 int  PutCoords (Coords *coords, Header *header);
    753 void RegisterMosaic (Coords *coords);
    754 void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch);
    755 OhanaProjection GetProjection (char *ctype);
    756 int SetProjection (char *ctype, OhanaProjection proj);
    757 OhanaProjectionMode GetProjectionMode (OhanaProjection proj);
    758739
    759740char *libdvo_version (void);
     
    913894Lensing *FtableToLensing (FTable *ftable, off_t *Nlensing, char *format);
    914895Lensobj *FtableToLensobj (FTable *ftable, off_t *Nlensobj, char *format);
     896StarPar *FtableToStarPar (FTable *ftable, off_t *Nstarpar, char *format);
    915897int      FtableToImage   (FTable *ftable, Header *theader, char *format);
    916898
     
    920902int LensingToFtable (FTable *ftable, Lensing *lensing, off_t Nlensing, char format);
    921903int LensobjToFtable (FTable *ftable, Lensobj *lensobj, off_t Nlensobj, char format);
     904int StarParToFtable (FTable *ftable, StarPar *starpar, off_t Nstarpar, char format);
    922905int ImageToFtable (FTable *ftable, Header *theader, char format);
    923906int ImageToVtable (VTable *vtable, Header *theader, char format);
     
    936919# include "ps1_v5_defs.h"
    937920# include "ps1_ref_defs.h"
     921# include "ps1_sim_defs.h"
    938922
    939923/*** DVO image db I/O Functions ***/
     
    950934void dvo_image_create (FITS_DB *db, double ZeroPoint);
    951935
     936int gfits_table_set_Image (FTable *ftable);
     937int gfits_table_mkheader_Image (Header *header);
     938Image *gfits_table_get_Image (FTable *ftable, off_t *Ndata, char *swapped);
     939
    952940/* flatcorr APIs */
    953941FlatCorrectionTable *FlatCorrectionLoad (char *filename, int VERBOSE);
     
    963951SkyTable  *SkyTableLoadOptimal     PROTO((char *catdir, char *SKYFILE, char *GSCFILE, int readwrite, int depth, int VERBOSE));
    964952int        SkyTableSetDepth        PROTO((SkyTable *sky, int depth));
     953SkyList   *SkyRegionByIndex        PROTO((SkyTable *table, int index));
    965954SkyList   *SkyRegionByCPT          PROTO((SkyTable *table, char *filename));
    966955SkyList   *SkyRegionByPoint        PROTO((SkyTable *table, int depth, double ra, double dec));
     
    1009998int HostTableTestHost (SkyRegion *region, int hostID);
    1010999
     1000void InitHost (HostInfo *host);
     1001
     1002HostTableGroup *HostTableGroups (HostTable *table, int *ngroups);
     1003int HostTableGroupWaitJobsGetIO (HostTableGroup *table, char *file, int lineno, int VERBOSE);
     1004
    10111005// functions to support tiny versions of Average and Measure
    10121006void CopyAverageToTiny (AverageTiny *averageT, Average *average);
     
    10421036void dvo_lensing_init (Lensing *lensing);
    10431037void dvo_lensobj_init (Lensobj *lensobj, int toZero);
     1038void dvo_starpar_init (StarPar *starpar);
    10441039
    10451040void InitRegionHosts (RegionHostInfo *hosts, int Nhosts, int NHOSTS);
     
    10511046int RegionHostFindNeighbors (RegionHostTable *table, int Nhost);
    10521047
     1048// galaxy_model:
     1049int TransformProperMotion_radians (double *uR, double *uD, double uL, double uB, double Rrad, double Drad, CoordTransform *transform);
     1050int TransformProperMotion (double *uR, double *uD, double uL, double uB, double R, double D, CoordTransform *transform);
     1051int SolarMotionModel_radians (double *uL_sol, double *uB_sol, double Lrad, double Brad, double distance);
     1052int SolarMotionModel (double *uL_sol, double *uB_sol, double L, double B, double distance);
     1053int GalaxyMotionModel_radians (double *uL_gal, double *uB_gal, double Lrad, double Brad);
     1054int GalaxyMotionModel (double *uL_gal, double *uB_gal, double L, double B);
     1055int InitGalaxyModel (char *version);
     1056
     1057# define LENSFIELD(NAME) float LensValue_##NAME (PhotCode *code, Lensobj *lensobj);
     1058
     1059LENSFIELD(X11_sm_obj)
     1060LENSFIELD(X12_sm_obj)
     1061LENSFIELD(X22_sm_obj)
     1062LENSFIELD(E1_sm_obj)
     1063LENSFIELD(E2_sm_obj)
     1064
     1065LENSFIELD(X11_sh_obj)
     1066LENSFIELD(X12_sh_obj)
     1067LENSFIELD(X22_sh_obj)
     1068LENSFIELD(E1_sh_obj)
     1069LENSFIELD(E2_sh_obj)
     1070
     1071LENSFIELD(X11_sm_psf)
     1072LENSFIELD(X12_sm_psf)
     1073LENSFIELD(X22_sm_psf)
     1074LENSFIELD(E1_sm_psf)
     1075LENSFIELD(E2_sm_psf)
     1076
     1077LENSFIELD(X11_sh_psf)
     1078LENSFIELD(X12_sh_psf)
     1079LENSFIELD(X22_sh_psf)
     1080LENSFIELD(E1_sh_psf)
     1081LENSFIELD(E2_sh_psf)
     1082
     1083# undef LENSFIELD
     1084
    10531085# endif // DVO_H
Note: See TracChangeset for help on using the changeset viewer.