- Timestamp:
- Apr 21, 2014, 5:42:34 AM (12 years ago)
- Location:
- branches/eam_branches/ps2-tc3-20130727
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ps2-tc3-20130727
- Property svn:mergeinfo changed
-
branches/eam_branches/ps2-tc3-20130727/Ohana
- Property svn:mergeinfo deleted
-
branches/eam_branches/ps2-tc3-20130727/Ohana/src/libdvo/include/dvo.h
r35755 r36680 285 285 } HostTable; 286 286 287 // A RegionHost processes data for some region in parallel with other regions 288 typedef struct RegionHostInfo { 289 double Rmin; // (Rmin,Rmax),(Dmin,Dmax) arehard RA,DEC boundaries of the 290 double Rmax; // region for which each host is responsible. A given host 291 double Dmin; // calibrates the images for which the fiducial point (center) 292 double Dmax; // lands in the region, and all objects in the region 293 294 double RminCat; // (RminCat,RmaxCat),(DminCat,DmaxCat) are the region for which 295 double RmaxCat; // the catalogs need to be loaded : this is the outer bounds 296 double DminCat; // of the region containing all images completely 297 double DmaxCat; 298 299 char *hostname; 300 301 int hostID; // remove machine ID in SkyTable 302 int stdio[3]; // fd's for communication with the remote host 303 int pid; // remote process ID 304 int status; 305 IOBuffer stdout; 306 IOBuffer stderr; 307 308 off_t Nimage; 309 off_t NIMAGE; 310 Image *image; 311 off_t *imseq; 312 313 int *neighbors; // list of neighbor index values 314 int Nneighbors; // number of neighbors 315 char isNeighbor; // TRUE if I am a neighbor to the current region host 316 } RegionHostInfo; 317 318 typedef struct { 319 double Rmin; 320 double Rmax; 321 double Dmin; 322 double Dmax; 323 324 int Nhosts; 325 RegionHostInfo *hosts; 326 short *index; 327 } RegionHostTable; 328 287 329 // special-case function: 288 330 CMF_PS1_V2 *gfits_table_get_CMF_PS1_V1_Alt (FTable *ftable, off_t *Ndata, char *swapped); … … 308 350 # define BOUNDARY_TREE_NAME_LENGTH 128 309 351 352 // BoundaryTree is a structure to describe the 3pi RINGS skycell boundaries in terms of lines of constant (RA,DEC) 353 // the structure is flexible for a variety of RINGS-like tessellations, but is not appropriate for the LOCAL style tess 310 354 typedef struct { 311 355 int FixedGridDEC; // is the DEC sequence linear? … … 342 386 } BoundaryTree; 343 387 344 // XXX DROP? // a reduced-subset structure for relastro 345 // XXX DROP? typedef struct { 346 // XXX DROP? double R; 347 // XXX DROP? double D; 348 // XXX DROP? unsigned short Nmeasure; 349 // XXX DROP? int measureOffset; 350 // XXX DROP? uint32_t flags; 351 // XXX DROP? int catID; 352 // XXX DROP? } AverageTinyAstro; 388 typedef enum { TESS_NONE, TESS_LOCAL, TESS_RINGS } TessType; 389 390 // TessellationTable is a structure to describe the parameters of a set of "tessellations" 391 // (these are not strictly tessellations but projection sets as only the non-local 392 // versions can cover the full sky). For LOCAL projection cells, the structure describes 393 // the boundaries of a SINGLE projection cell with Nx * Ny skycells and includes some 394 // basic parameters (not used by the fullsky, eg RINGS, tessellations) 395 typedef struct { 396 double Rmin; // this tessellation is valid only for RA >= Rmin 397 double Rmax; // this tessellation is valid only for RA < Rmax 398 double Dmin; // this tessellation is valid only for DEC >= Dmin 399 double Dmax; // this tessellation is valid only for DEC < Dmax 400 401 double Xo; 402 double Yo; 403 double Ro; 404 double Do; 405 double dPix; 406 int dX; 407 int dY; 408 409 int NX_SUB; 410 int NY_SUB; 411 412 char *basename; 413 int Nbasename; 414 int projectIDoff; 415 int skycellIDoff; 416 417 TessType type; // 418 BoundaryTree *tree; 419 } TessellationTable; 353 420 354 421 // a reduced-subset structure for relphot … … 360 427 uint32_t flags; 361 428 int catID; 429 int objID; 430 int nOwn; 362 431 } AverageTiny; 363 432 … … 385 454 short dYccd; 386 455 short dRsys; 456 char myDet; 387 457 } MeasureTiny; 458 459 /** STRUCT DEFINITION **/ 460 typedef struct { 461 double R; // RA (decimal degrees ) 462 double D; // DEC (decimal degrees ) 463 float dR; // RA error (arcsec) 464 float dD; // DEC error (arcsec) 465 float uR; // RA*cos(D) proper-motion (arcsec/year) 466 float uD; // DEC proper-motion (arcsec/year) 467 float duR; // RA*cos(D) p-m error (arcsec/year) 468 float duD; // DEC p-m error (arcsec/year) 469 float P; // parallax (arcsec) 470 float dP; // parallax error (arcsec) 471 float ChiSqAve; // astrometry analysis chisq 472 float ChiSqPM; // astrometry analysis chisq 473 float ChiSqPar; // astrometry analysis chisq 474 int Tmean; // mean epoch (PM,PAR ref) (unix time seconds) 475 int Trange; // mean epoch (PM,PAR ref) (unix time seconds) 476 float Xp; // unused 477 unsigned short Npos; // number of detections used for astrometry 478 unsigned short Nmeasure; // number of psf measurements 479 unsigned short Nmissing; // number of missings 480 unsigned short Nextend; // number of extended measurements 481 uint32_t measureOffset; // offset to first psf measurement 482 uint32_t missingOffset; // offset to first missing obs 483 uint32_t extendOffset; // offset to first extended measurement 484 uint32_t flags; // average object flags (star; ghost; etc) 485 uint32_t photFlagsUpper; // upper bit of 2 bit summary of per-measure photflags 486 uint32_t photFlagsLower; // lower bit of 2 bit summary of per-measure photflags 487 unsigned int objID; // unique ID for object in table 488 unsigned int catID; // unique ID for table in which object was first realized 489 uint64_t extID; // external ID for object (eg PSPS objID) 490 } Average_PS1_V4alt; 491 492 Average_PS1_V4alt *gfits_table_get_Average_PS1_V4alt (FTable *table, off_t *Ndata, char *swapped); 493 Average *Average_PS1_V4alt_ToInternal (Average_PS1_V4alt *in, off_t Nvalues); 494 495 /** STRUCT DEFINITION **/ 496 typedef struct { 497 float dR; // RA offset (arcsec) 498 float dD; // DEC offset (arcsec) 499 float M; // catalog mag (mag) 500 float Mcal; // image cal mag (mag) 501 float Map; // aperture mag (mag) 502 float Mkron; // kron magnitude (mag) 503 float dMkron; // kron magnitude error (mag) 504 float dM; // mag error (mag) 505 float dMcal; // systematic calibration error (mag) 506 float dt; // exposure time (2.5*log(exptime)) 507 float FluxPSF; // flux from psf fit (counts/sec?) 508 float dFluxPSF; // error on psf flux (counts/sec?) 509 float FluxKron; // flux from kron ap (counts/sec?) 510 float dFluxKron; // error on kron flux (counts/sec?) 511 float airmass; // (airmass - 1) (airmass) 512 float az; // telescope azimuth 513 float Xccd; // X coord on chip (raw value) (pixels) 514 float Yccd; // Y coord on chip (raw value) (pixels) 515 float Sky; // local estimate of sky flux (counts/sec) 516 float dSky; // local estimate of sky flux (counts/sec) 517 int t; // time in seconds (UNIX) 518 unsigned int averef; // reference to average entry 519 unsigned int detID; // detection ID 520 unsigned int imageID; // reference to DVO image ID 521 unsigned int objID; // unique ID for object in table 522 unsigned int catID; // unique ID for table in which object was first realized 523 uint64_t extID; // external ID (eg PSPS detID) 524 float psfQF; // psf coverage/quality factor 525 float psfQFperf; // psf coverage / quality factor (all mask bits) 526 float psfChisq; // psf fit chisq 527 int psfNdof; // psf degrees of freedom 528 int psfNpix; // psf number of pixels 529 float crNsigma; // Nsigma deviation towards CR 530 float extNsigma; // Nsigma deviation towards EXT 531 short FWx; // object fwhm major axis (1/100 of pixels) 532 short FWy; // object fwhm minor axis (1/100 of pixels ) 533 short theta; // angle wrt ccd X dir ((0xffff/360) deg) 534 short Mxx; // second moments in pixel coords (1/100 of pixels) 535 short Mxy; // second moments in pixel coords (1/100 of pixels) 536 short Myy; // second moments in pixel coords (1/100 of pixels) 537 unsigned short t_msec; // time fraction of second (milliseconds) 538 unsigned short photcode; // photcode 539 short dXccd; // X coord error on chip (1/100 of pixels) 540 short dYccd; // Y coord error on chip (1/100 of pixels) 541 short dRsys; // systematic error from astrom (1/100 of pixels) 542 short posangle; // position angle sky to chip ((0xffff/360) deg) 543 float pltscale; // plate scale (arcsec/pixel) 544 unsigned int dbFlags; // flags supplied by analysis in database 545 unsigned int photFlags; // flags supplied by photometry program 546 } Measure_PS1_V4alt; 547 548 Measure_PS1_V4alt *gfits_table_get_Measure_PS1_V4alt (FTable *table, off_t *Ndata, char *swapped); 549 Measure *Measure_PS1_V4alt_ToInternal (Measure_PS1_V4alt *in, off_t Nvalues); 388 550 389 551 /* a catalog contains this data */ … … 438 600 float *X; 439 601 float *Y; 602 int *nOwn; // relastro uses this to count owned detections per object 440 603 441 604 } Catalog; … … 499 662 float PhotInst (Measure *measure); 500 663 float PhotCat (Measure *measure); 501 float PhotAper (Measure *measure);502 float PhotKron (Measure *measure);503 664 float PhotSys (Measure *measure, Average *average, SecFilt *secfilt); 504 665 float PhotRel (Measure *measure, Average *average, SecFilt *secfilt); … … 506 667 float PhotAve (PhotCode *code, Average *average, SecFilt *secfilt); 507 668 float PhotRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure); 669 float PhotAveErr (PhotCode *code, Average *average, SecFilt *secfilt); 670 671 float PhotAperInst (Measure *measure); 672 float PhotAperCat (Measure *measure); 673 float PhotAperSys (Measure *measure, Average *average, SecFilt *secfilt); 674 float PhotAperRel (Measure *measure, Average *average, SecFilt *secfilt); 675 float PhotAperCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code); 676 float PhotAperAve (PhotCode *code, Average *average, SecFilt *secfilt); 677 float PhotAperRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure); 678 679 float PhotKronInst (Measure *measure); 680 float PhotKronCat (Measure *measure); 681 float PhotKronSys (Measure *measure, Average *average, SecFilt *secfilt); 682 float PhotKronRel (Measure *measure, Average *average, SecFilt *secfilt); 683 float PhotKronCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code); 684 float PhotKronAve (PhotCode *code, Average *average, SecFilt *secfilt); 685 float PhotKronRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure); 686 float PhotKronAveErr (PhotCode *code, Average *average, SecFilt *secfilt); 687 508 688 float PhotXm (PhotCode *code, Average *average, SecFilt *secfilt); 509 float PhotdM (PhotCode *code, Average *average, SecFilt *secfilt);510 511 float PhotAperInst (Measure *measure);512 float PhotKronInst (Measure *measure);513 float PhotKronAve (PhotCode *code, Average *average, SecFilt *secfilt);514 float PhotKronAveErr (PhotCode *code, Average *average, SecFilt *secfilt);515 689 516 690 float PhotZeroPoint (Measure *measure, Average *average, SecFilt *secfilt); … … 696 870 void sort_coords_index (double *X, double *Y, off_t *S, off_t N); 697 871 void sort_coords_indexonly (double *X, double *Y, off_t *S, off_t N); 872 void sort_IDs_indexonly (opihi_int *X, off_t *S, off_t N); 698 873 void sort_regions (SkyRegion *region, off_t N); 699 874 … … 716 891 int free_tiny_values (Catalog *catalog); 717 892 893 BoundaryTree *BoundaryTreeLoad(char *filename); 894 BoundaryTree *BoundaryTreeRead(Header *headerPHU, Header *headerZone, FILE *f); 895 896 int BoundaryTreeSave(char *filename, BoundaryTree *tree); 897 int BoundaryTreeWrite(FILE *f, BoundaryTree *tree); 898 718 899 int BoundaryTreeCellCoords (BoundaryTree *tree, int *zone, int *band, double ra, double dec); 719 int BoundaryTreeSave(char *filename, BoundaryTree *tree);720 BoundaryTree *BoundaryTreeLoad(char *filename);721 900 int BoundaryTreeProjection (double *x, double *y, double r, double d, BoundaryTree *tree, int zone, int band); 901 902 TessellationTable *TessellationTableLoad(char *filename, int *Ntess); 903 int TessellationTableSave(char *filename, TessellationTable *tess, int Ntess); 904 int TessellationPrimaryCellIDs (TessellationTable *tess, int Ntess, int *tessID, int *projID, int *skycellID, double ra, double dec); 905 void TessellationTableInit (TessellationTable *tess, int Ntess); 722 906 723 907 void dvo_average_init (Average *average); … … 727 911 void dvo_measureT_init (MeasureTiny *measure); 728 912 913 void InitRegionHosts (RegionHostInfo *hosts, int Nhosts, int NHOSTS); 914 void FreeRegionHosts (RegionHostInfo *hosts, int Nhosts); 915 void FreeRegionHostTable (RegionHostTable *table); 916 RegionHostTable *RegionHostTableLoad (char *catdir, char *rootname); 917 int RegionHostTableWaitJobs (RegionHostTable *regionHosts, char *file, int lineno); 918 int RegionHostTableWaitJobsGetIO (RegionHostTable *regionHosts, char *file, int lineno, int VERBOSE); 919 int RegionHostFindNeighbors (RegionHostTable *table, int Nhost); 920 729 921 # endif // DVO_H
Note:
See TracChangeset
for help on using the changeset viewer.
