Changeset 33649 for trunk/Ohana/src/libdvo/include/dvo.h
- Timestamp:
- Apr 1, 2012, 2:28:17 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libdvo/include/dvo.h (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/include/dvo.h
r31663 r33649 26 26 DVO_FORMAT_PS1_V1, 27 27 DVO_FORMAT_PS1_V2, 28 DVO_FORMAT_PS1_V3, 28 29 } DVOTableFormat; 29 30 … … 95 96 /* Image.code values -- these values are 32 bit (as of PS1_V1) */ 96 97 typedef enum { 97 ID_IMAGE_NEW = 0x00000000, /* no calibrations yet attempted */ 98 ID_IMAGE_PHOTOM_NOCAL = 0x00000001, /* user-set value used within relphot: ignore */ 99 ID_IMAGE_PHOTOM_POOR = 0x00000002, /* relphot says image is bad (dMcal > limit) */ 100 ID_IMAGE_PHOTOM_SKIP = 0x00000004, /* user-set value: assert that this image has bad photometry */ 101 ID_IMAGE_PHOTOM_FEW = 0x00000008, /* currently too few measurements for photometry */ 102 ID_IMAGE_ASTROM_NOCAL = 0x00000010, /* user-set value used within relastro: ignore */ 103 ID_IMAGE_ASTROM_POOR = 0x00000020, /* relastro says image is bad (dR,dD > limit) */ 104 ID_IMAGE_ASTROM_FAIL = 0x00000040, /* relastro fit diverged, fit not applied */ 105 ID_IMAGE_ASTROM_SKIP = 0x00000080, /* user-set value: assert that this image has bad astrometry */ 106 ID_IMAGE_ASTROM_FEW = 0x00000100, /* currently too few measurements for astrometry */ 98 ID_IMAGE_NEW = 0x00000000, /* no calibrations yet attempted */ 99 ID_IMAGE_PHOTOM_NOCAL = 0x00000001, /* user-set value used within relphot: ignore */ 100 ID_IMAGE_PHOTOM_POOR = 0x00000002, /* relphot says image is bad (dMcal > limit) */ 101 ID_IMAGE_PHOTOM_SKIP = 0x00000004, /* user-set value: assert that this image has bad photometry */ 102 ID_IMAGE_PHOTOM_FEW = 0x00000008, /* currently too few measurements for photometry */ 103 ID_IMAGE_ASTROM_NOCAL = 0x00000010, /* user-set value used within relastro: ignore */ 104 ID_IMAGE_ASTROM_POOR = 0x00000020, /* relastro says image is bad (dR,dD > limit) */ 105 ID_IMAGE_ASTROM_FAIL = 0x00000040, /* relastro fit diverged, fit not applied */ 106 ID_IMAGE_ASTROM_SKIP = 0x00000080, /* user-set value: assert that this image has bad astrometry */ 107 ID_IMAGE_ASTROM_FEW = 0x00000100, /* currently too few measurements for astrometry */ 108 ID_IMAGE_PHOTOM_UBERCAL = 0x00000200, /* externally-supplied photometry zero point from ubercal analysis */ 107 109 } DVOImageFlags; 108 110 109 111 /* Measure.flags values -- these values are 32 bit (as of PS1_V1) */ 110 112 typedef enum { 111 ID_MEAS_NOCAL = 0x00000001, // detection ignored for this analysis (photcode, time range) -- internal only112 ID_MEAS_POOR_PHOTOM = 0x00000002, // detection is photometry outlier113 ID_MEAS_SKIP_PHOTOM = 0x00000004, // detection was ignored for photometry measurement114 ID_MEAS_AREA = 0x00000008, // detection near image edge115 ID_MEAS_POOR_ASTROM = 0x00000010, // detection is astrometry outlier116 ID_MEAS_SKIP_ASTROM = 0x00000020, // detection was ignored for astrometry measurement117 ID_MEAS_USED_OBJ = 0x00000040, // detection was used during opdate objects118 ID_MEAS_USED_CHIP = 0x00000080, // detection was used during update chips119 ID_MEAS_BLEND_MEAS = 0x00000100, // detection is within radius of multiple objects120 ID_MEAS_BLEND_OBJ = 0x00000200, // multiple detections within radius of object121 ID_MEAS_UNDEF_3 = 0x00000400, // unused122 ID_MEAS_UNDEF_4 = 0x00000800, // unused123 ID_MEAS_BLEND_MEAS_X = 0x00001000, // detection is within radius of multiple objects across catalogs124 ID_MEAS_ARTIFACT = 0x00002000, // detection is thought to be non-astronomical125 ID_MEAS_UNDEF_5 = 0x00004000, // unused126 ID_MEAS_ UNDEF_6 = 0x00008000, // unused113 ID_MEAS_NOCAL = 0x00000001, // detection ignored for this analysis (photcode, time range) -- internal only 114 ID_MEAS_POOR_PHOTOM = 0x00000002, // detection is photometry outlier 115 ID_MEAS_SKIP_PHOTOM = 0x00000004, // detection was ignored for photometry measurement 116 ID_MEAS_AREA = 0x00000008, // detection near image edge 117 ID_MEAS_POOR_ASTROM = 0x00000010, // detection is astrometry outlier 118 ID_MEAS_SKIP_ASTROM = 0x00000020, // detection was ignored for astrometry measurement 119 ID_MEAS_USED_OBJ = 0x00000040, // detection was used during update objects 120 ID_MEAS_USED_CHIP = 0x00000080, // detection was used during update chips (XXX this probably does not make it into the db) 121 ID_MEAS_BLEND_MEAS = 0x00000100, // detection is within radius of multiple objects 122 ID_MEAS_BLEND_OBJ = 0x00000200, // multiple detections within radius of object 123 ID_MEAS_UNDEF_3 = 0x00000400, // unused 124 ID_MEAS_UNDEF_4 = 0x00000800, // unused 125 ID_MEAS_BLEND_MEAS_X = 0x00001000, // detection is within radius of multiple objects across catalogs 126 ID_MEAS_ARTIFACT = 0x00002000, // detection is thought to be non-astronomical 127 ID_MEAS_UNDEF_5 = 0x00004000, // unused 128 ID_MEAS_PHOTOM_UBERCAL = 0x00008000, // externally-supplied zero point from ubercal analysis 127 129 } DVOMeasureFlags; 128 130 … … 141 143 */ 142 144 143 /* Average. codevalues -- these values are 32 bit (as of PS1_V1) */145 /* Average.flags values -- these values are 32 bit (as of PS1_V1) */ 144 146 typedef enum { 145 147 ID_STAR_FEW = 0x00000001, // used within relphot: skip star … … 168 170 } DVOAverageFlags; 169 171 172 /* Secfilt.flags values -- these values are 32 bit (as of PS1_V1) */ 173 typedef enum { 174 ID_SECF_STAR_FEW = 0x00000001, // used within relphot: skip star 175 ID_SECF_STAR_POOR = 0x00000002, // used within relphot: skip star 176 ID_SECF_USE_SYNTH = 0x00000004, // synthetic photometry used in average measurement 177 ID_SECF_USE_UBERCAL = 0x00000008, // synthetic photometry used in average measurement 178 ID_PHOTOM_PASS_0 = 0x00000100, // average magnitude calculated in 0th pass 179 ID_PHOTOM_PASS_1 = 0x00000200, // average magnitude calculated in 1th pass 180 ID_PHOTOM_PASS_2 = 0x00000400, // average magnitude calculated in 2th pass 181 ID_PHOTOM_PASS_3 = 0x00000800, // average magnitude calculated in 3th pass 182 ID_PHOTOM_PASS_4 = 0x00001000, // average magnitude calculated in 4th pass 183 ID_SECF_OBJ_EXT = 0x01000000, // extended in this band 184 } DVOSecfiltFlags; 185 170 186 /*** general dvo structures (internal use only / not IO) ***/ 171 187 … … 196 212 char **filename; 197 213 SkyRegion *regions; 214 char hosts[80]; 198 215 } SkyTable; 199 216 … … 203 220 char **filename; 204 221 SkyRegion **regions; 222 char hosts[80]; 205 223 } SkyList; 224 225 typedef struct { 226 off_t Nimage; 227 FlatCorrectionImage *image; 228 off_t Ncorr; 229 int *IDtoSeq; 230 FlatCorrection *corr; 231 float ***offset; // the correction images represented as a set of arrays (same sequence as *image) 232 int Nseason; 233 e_time *tstart; 234 e_time *tstop; 235 } FlatCorrectionTable; 236 237 /* definitions for parallel dvo host information 238 XXX : need better names (safer namespace) 239 */ 240 241 typedef enum { 242 DATA_ON_TGT = 0x01, 243 DATA_ON_BCK = 0x02, 244 DATA_USE_BCK = 0x04, 245 246 DATA_COPY_FAILURE = 0x80, 247 } SkyTableDataFlags; 248 249 typedef enum { 250 HOST_STDIN = 0, 251 HOST_STDOUT = 1, 252 HOST_STDERR = 2, 253 } HostInfoIOfd; 254 255 typedef struct { 256 char *hostname; // name of remote machine 257 char *pathname; // name of directory for this machine's data 258 char *results; // name of file machine's result data 259 int hostID; // remove machine ID in SkyTable 260 int stdio[3]; // fd's for communication with the remote host 261 int pid; // remote process ID 262 int status; // job exit status 263 IOBuffer stdout; 264 IOBuffer stderr; 265 } HostInfo; 266 267 typedef struct { 268 int Nhosts; 269 HostInfo *hosts; 270 unsigned short *index; 271 } HostTable; 206 272 207 273 // special-case function: … … 218 284 } PhotCodeData; 219 285 286 typedef enum { 287 DVO_TV_MEASURE = 0x01, 288 DVO_TV_AVERAGE = 0x02, 289 } DVOTinyValueMode; 290 291 // XXX DROP? // a reduced-subset structure for relastro 292 // XXX DROP? typedef struct { 293 // XXX DROP? double R; 294 // XXX DROP? double D; 295 // XXX DROP? unsigned short Nmeasure; 296 // XXX DROP? int measureOffset; 297 // XXX DROP? uint32_t flags; 298 // XXX DROP? int catID; 299 // XXX DROP? } AverageTinyAstro; 300 220 301 // a reduced-subset structure for relphot 221 302 typedef struct { … … 225 306 int measureOffset; 226 307 uint32_t flags; 308 int catID; 227 309 } AverageTiny; 228 310 229 // a reduced-subset structure for relphot 311 // a reduced-subset structure for relphot & relastro 230 312 typedef struct { 231 313 float dR; … … 242 324 unsigned int imageID; 243 325 unsigned int dbFlags; 326 unsigned int photFlags; 327 int catID; // unsigned int? 244 328 unsigned short photcode; 329 short dXccd; 330 short dYccd; 331 short dRsys; 245 332 } MeasureTiny; 246 333 … … 383 470 int PhotColorTiny (AverageTiny *average, SecFilt *secfilt, MeasureTiny *measure, int c1, int c2, double *color); 384 471 385 386 472 PhotCodeData *GetPhotcodeTable (void); 387 473 void SetPhotcodeTable (PhotCodeData *); 388 474 389 475 int *GetSecFiltMap(PhotCodeData *ouput, PhotCodeData* input); 476 PhotCode **ParsePhotcodeList (char *rawlist, int *nphotcodes, int needAve); 390 477 391 478 int LoadPhotcodes (char *catdir_file, char *master_file, int readwrite); … … 450 537 int WriteRawSecFilt (FILE *f, SecFilt *secfilt, off_t Nsecfilt, char format); 451 538 539 DVOTableFormat FtableGetFormat (FTable *ftable); 540 452 541 Average *FtableToAverage (FTable *ftable, off_t *Naverage, char *format, SecFilt **primary); 453 542 Measure *FtableToMeasure (FTable *ftable, off_t *Nmeasure, char *format); … … 470 559 # include "ps1_v1_defs.h" 471 560 # include "ps1_v2_defs.h" 561 # include "ps1_v3_defs.h" 472 562 # include "ps1_ref_defs.h" 473 563 … … 484 574 void dvo_image_create (FITS_DB *db, double ZeroPoint); 485 575 576 /* flatcorr APIs */ 577 FlatCorrectionTable *FlatCorrectionLoad (char *filename, int VERBOSE); 578 int FlatCorrectionInternal(FlatCorrectionTable *flatcorrTable); 579 int FlatCorrectionSave (FlatCorrectionTable *flatcorrTable, char *filename); 580 float FlatCorrectionOffset (FlatCorrectionTable *flatcorr, int ID, int X, int Y); 581 486 582 /* skyregion APIs */ 487 583 int SkyTableSave PROTO((SkyTable *table, char *filename)); 488 584 SkyTable *SkyTableLoad PROTO((char *filename, int VERBOSE)); 585 char *SkyTableFilename PROTO((char *catdir)); 489 586 SkyTable *SkyTableFromGSC PROTO((char *filename, int depth, int VERBOSE)); 490 587 SkyTable *SkyTableLoadOptimal PROTO((char *catdir, char *SKYFILE, char *GSCFILE, int readwrite, int depth, int VERBOSE)); … … 528 625 #endif 529 626 530 # endif 627 // functions for parallel DVO 628 HostTable *HostTableLoad (char *catdir, char *rootname); 629 int HostTableWaitJobs (HostTable *table, char *file, int lineno); 630 int HostTableWaitJobsGetIO (HostTable *table, char *file, int lineno, int VERBOSE); 631 int HostTableTestHost (SkyRegion *region, int hostID); 632 633 // functions to support tiny versions of Average and Measure 634 void CopyAverageToTiny (AverageTiny *averageT, Average *average); 635 void CopyMeasureToTiny (MeasureTiny *measureT, Measure *measure); 636 int populate_tiny_values (Catalog *catalog, DVOTinyValueMode mode); 637 int free_tiny_values (Catalog *catalog); 638 639 # endif // DVO_H 640
Note:
See TracChangeset
for help on using the changeset viewer.
