- Timestamp:
- Jun 19, 2012, 5:24:19 PM (14 years ago)
- Location:
- branches/meh_branches/ppstack_test
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
Ohana/src/libdvo/include/dvo.h (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppstack_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/Ohana/src/libdvo/include/dvo.h
r31663 r34041 26 26 DVO_FORMAT_PS1_V1, 27 27 DVO_FORMAT_PS1_V2, 28 DVO_FORMAT_PS1_V3, 28 29 } DVOTableFormat; 29 30 … … 69 70 } DVO_INT_NAN; 70 71 72 // max path length 73 # define DVO_MAX_PATH 1024 74 71 75 /* RegImage.flag values */ 72 76 # define IMREG_DIST 0x01 /* image distributed, only imregister-3.0 */ … … 95 99 /* Image.code values -- these values are 32 bit (as of PS1_V1) */ 96 100 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 */ 101 ID_IMAGE_NEW = 0x00000000, /* no calibrations yet attempted */ 102 ID_IMAGE_PHOTOM_NOCAL = 0x00000001, /* user-set value used within relphot: ignore */ 103 ID_IMAGE_PHOTOM_POOR = 0x00000002, /* relphot says image is bad (dMcal > limit) */ 104 ID_IMAGE_PHOTOM_SKIP = 0x00000004, /* user-set value: assert that this image has bad photometry */ 105 ID_IMAGE_PHOTOM_FEW = 0x00000008, /* currently too few measurements for photometry */ 106 ID_IMAGE_ASTROM_NOCAL = 0x00000010, /* user-set value used within relastro: ignore */ 107 ID_IMAGE_ASTROM_POOR = 0x00000020, /* relastro says image is bad (dR,dD > limit) */ 108 ID_IMAGE_ASTROM_FAIL = 0x00000040, /* relastro fit diverged, fit not applied */ 109 ID_IMAGE_ASTROM_SKIP = 0x00000080, /* user-set value: assert that this image has bad astrometry */ 110 ID_IMAGE_ASTROM_FEW = 0x00000100, /* currently too few measurements for astrometry */ 111 ID_IMAGE_PHOTOM_UBERCAL = 0x00000200, /* externally-supplied photometry zero point from ubercal analysis */ 107 112 } DVOImageFlags; 108 113 109 114 /* Measure.flags values -- these values are 32 bit (as of PS1_V1) */ 110 115 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, // unused116 ID_MEAS_NOCAL = 0x00000001, // detection ignored for this analysis (photcode, time range) -- internal only 117 ID_MEAS_POOR_PHOTOM = 0x00000002, // detection is photometry outlier 118 ID_MEAS_SKIP_PHOTOM = 0x00000004, // detection was ignored for photometry measurement 119 ID_MEAS_AREA = 0x00000008, // detection near image edge 120 ID_MEAS_POOR_ASTROM = 0x00000010, // detection is astrometry outlier 121 ID_MEAS_SKIP_ASTROM = 0x00000020, // detection was ignored for astrometry measurement 122 ID_MEAS_USED_OBJ = 0x00000040, // detection was used during update objects 123 ID_MEAS_USED_CHIP = 0x00000080, // detection was used during update chips (XXX this probably does not make it into the db) 124 ID_MEAS_BLEND_MEAS = 0x00000100, // detection is within radius of multiple objects 125 ID_MEAS_BLEND_OBJ = 0x00000200, // multiple detections within radius of object 126 ID_MEAS_UNDEF_3 = 0x00000400, // unused 127 ID_MEAS_UNDEF_4 = 0x00000800, // unused 128 ID_MEAS_BLEND_MEAS_X = 0x00001000, // detection is within radius of multiple objects across catalogs 129 ID_MEAS_ARTIFACT = 0x00002000, // detection is thought to be non-astronomical 130 ID_MEAS_UNDEF_5 = 0x00004000, // unused 131 ID_MEAS_PHOTOM_UBERCAL = 0x00008000, // externally-supplied zero point from ubercal analysis 127 132 } DVOMeasureFlags; 128 133 … … 141 146 */ 142 147 143 /* Average. codevalues -- these values are 32 bit (as of PS1_V1) */148 /* Average.flags values -- these values are 32 bit (as of PS1_V1) */ 144 149 typedef enum { 145 150 ID_STAR_FEW = 0x00000001, // used within relphot: skip star … … 168 173 } DVOAverageFlags; 169 174 175 /* Secfilt.flags values -- these values are 32 bit (as of PS1_V1) */ 176 typedef enum { 177 ID_SECF_STAR_FEW = 0x00000001, // used within relphot: skip star 178 ID_SECF_STAR_POOR = 0x00000002, // used within relphot: skip star 179 ID_SECF_USE_SYNTH = 0x00000004, // synthetic photometry used in average measurement 180 ID_SECF_USE_UBERCAL = 0x00000008, // synthetic photometry used in average measurement 181 ID_PHOTOM_PASS_0 = 0x00000100, // average magnitude calculated in 0th pass 182 ID_PHOTOM_PASS_1 = 0x00000200, // average magnitude calculated in 1th pass 183 ID_PHOTOM_PASS_2 = 0x00000400, // average magnitude calculated in 2th pass 184 ID_PHOTOM_PASS_3 = 0x00000800, // average magnitude calculated in 3th pass 185 ID_PHOTOM_PASS_4 = 0x00001000, // average magnitude calculated in 4th pass 186 ID_SECF_OBJ_EXT = 0x01000000, // extended in this band 187 } DVOSecfiltFlags; 188 170 189 /*** general dvo structures (internal use only / not IO) ***/ 171 190 … … 196 215 char **filename; 197 216 SkyRegion *regions; 217 char hosts[80]; 198 218 } SkyTable; 199 219 … … 203 223 char **filename; 204 224 SkyRegion **regions; 225 char hosts[80]; 205 226 } SkyList; 227 228 typedef struct { 229 off_t Nimage; 230 FlatCorrectionImage *image; 231 off_t Ncorr; 232 int *IDtoSeq; 233 FlatCorrection *corr; 234 float ***offset; // the correction images represented as a set of arrays (same sequence as *image) 235 int Nseason; 236 e_time *tstart; 237 e_time *tstop; 238 } FlatCorrectionTable; 239 240 /* definitions for parallel dvo host information 241 XXX : need better names (safer namespace) 242 */ 243 244 typedef enum { 245 DATA_ON_TGT = 0x01, 246 DATA_ON_BCK = 0x02, 247 DATA_USE_BCK = 0x04, 248 249 DATA_COPY_FAILURE = 0x80, 250 } SkyTableDataFlags; 251 252 typedef enum { 253 HOST_STDIN = 0, 254 HOST_STDOUT = 1, 255 HOST_STDERR = 2, 256 } HostInfoIOfd; 257 258 typedef struct { 259 char *hostname; // name of remote machine 260 char *pathname; // name of directory for this machine's data 261 char *results; // name of file machine's result data 262 int hostID; // remove machine ID in SkyTable 263 int stdio[3]; // fd's for communication with the remote host 264 int pid; // remote process ID 265 int status; // job exit status 266 IOBuffer stdout; 267 IOBuffer stderr; 268 } HostInfo; 269 270 typedef struct { 271 int Nhosts; 272 HostInfo *hosts; 273 short *index; 274 } HostTable; 206 275 207 276 // special-case function: … … 218 287 } PhotCodeData; 219 288 289 typedef enum { 290 DVO_TV_MEASURE = 0x01, 291 DVO_TV_AVERAGE = 0x02, 292 } DVOTinyValueMode; 293 294 // XXX DROP? // a reduced-subset structure for relastro 295 // XXX DROP? typedef struct { 296 // XXX DROP? double R; 297 // XXX DROP? double D; 298 // XXX DROP? unsigned short Nmeasure; 299 // XXX DROP? int measureOffset; 300 // XXX DROP? uint32_t flags; 301 // XXX DROP? int catID; 302 // XXX DROP? } AverageTinyAstro; 303 220 304 // a reduced-subset structure for relphot 221 305 typedef struct { … … 225 309 int measureOffset; 226 310 uint32_t flags; 311 int catID; 227 312 } AverageTiny; 228 313 229 // a reduced-subset structure for relphot 314 // a reduced-subset structure for relphot & relastro 230 315 typedef struct { 231 316 float dR; … … 242 327 unsigned int imageID; 243 328 unsigned int dbFlags; 329 unsigned int photFlags; 330 int catID; // unsigned int? 244 331 unsigned short photcode; 332 short dXccd; 333 short dYccd; 334 short dRsys; 245 335 } MeasureTiny; 246 336 … … 366 456 float PhotdM (PhotCode *code, Average *average, SecFilt *secfilt); 367 457 458 float PhotMstdev (PhotCode *code, Average *average, SecFilt *secfilt); 459 float PhotM20 (PhotCode *code, Average *average, SecFilt *secfilt); 460 float PhotM80 (PhotCode *code, Average *average, SecFilt *secfilt); 461 float PhotUCdist (PhotCode *code, Average *average, SecFilt *secfilt); 462 368 463 float PhotColorForCode (Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code); 369 464 int PhotColor (Average *average, SecFilt *secfilt, Measure *measure, int c1, int c2, double *color); … … 383 478 int PhotColorTiny (AverageTiny *average, SecFilt *secfilt, MeasureTiny *measure, int c1, int c2, double *color); 384 479 385 386 480 PhotCodeData *GetPhotcodeTable (void); 387 481 void SetPhotcodeTable (PhotCodeData *); 388 482 389 483 int *GetSecFiltMap(PhotCodeData *ouput, PhotCodeData* input); 484 PhotCode **ParsePhotcodeList (char *rawlist, int *nphotcodes, int needAve); 390 485 391 486 int LoadPhotcodes (char *catdir_file, char *master_file, int readwrite); … … 429 524 void dvo_catalog_test (Catalog *catalog, int halt); 430 525 526 int dvo_catalog_backup (Catalog *catalog, int primary); 527 int dvo_catalog_unlink_backup (Catalog *catalog, int primary); 528 431 529 /* catmode-specific APIs */ 432 530 int dvo_catalog_load_raw (Catalog *catalog, int VERBOSE); … … 450 548 int WriteRawSecFilt (FILE *f, SecFilt *secfilt, off_t Nsecfilt, char format); 451 549 550 DVOTableFormat FtableGetFormat (FTable *ftable); 551 452 552 Average *FtableToAverage (FTable *ftable, off_t *Naverage, char *format, SecFilt **primary); 453 553 Measure *FtableToMeasure (FTable *ftable, off_t *Nmeasure, char *format); … … 470 570 # include "ps1_v1_defs.h" 471 571 # include "ps1_v2_defs.h" 572 # include "ps1_v3_defs.h" 472 573 # include "ps1_ref_defs.h" 473 574 … … 484 585 void dvo_image_create (FITS_DB *db, double ZeroPoint); 485 586 587 /* flatcorr APIs */ 588 FlatCorrectionTable *FlatCorrectionLoad (char *filename, int VERBOSE); 589 int FlatCorrectionInternal(FlatCorrectionTable *flatcorrTable); 590 int FlatCorrectionSave (FlatCorrectionTable *flatcorrTable, char *filename); 591 float FlatCorrectionOffset (FlatCorrectionTable *flatcorr, int ID, int X, int Y); 592 486 593 /* skyregion APIs */ 487 594 int SkyTableSave PROTO((SkyTable *table, char *filename)); 488 595 SkyTable *SkyTableLoad PROTO((char *filename, int VERBOSE)); 596 char *SkyTableFilename PROTO((char *catdir)); 489 597 SkyTable *SkyTableFromGSC PROTO((char *filename, int depth, int VERBOSE)); 490 598 SkyTable *SkyTableLoadOptimal PROTO((char *catdir, char *SKYFILE, char *GSCFILE, int readwrite, int depth, int VERBOSE)); … … 528 636 #endif 529 637 530 # endif 638 // functions for parallel DVO 639 HostTable *HostTableLoad (char *catdir, char *rootname); 640 int HostTableWaitJobs (HostTable *table, char *file, int lineno); 641 int HostTableWaitJobsGetIO (HostTable *table, char *file, int lineno, int VERBOSE); 642 int HostTableTestHost (SkyRegion *region, int hostID); 643 644 // functions to support tiny versions of Average and Measure 645 void CopyAverageToTiny (AverageTiny *averageT, Average *average); 646 void CopyMeasureToTiny (MeasureTiny *measureT, Measure *measure); 647 int populate_tiny_values (Catalog *catalog, DVOTinyValueMode mode); 648 int free_tiny_values (Catalog *catalog); 649 650 # endif // DVO_H 651
Note:
See TracChangeset
for help on using the changeset viewer.
