Changeset 41647 for trunk/Ohana/src/relphot/include/relphot.h
- Timestamp:
- Jun 7, 2021, 4:14:19 PM (5 years ago)
- Location:
- trunk/Ohana/src/relphot
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
include/relphot.h (modified) (28 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relphot
- Property svn:mergeinfo changed
/branches/eam_branches/relphot.20210521 (added) merged: 41602-41608,41610-41612,41615,41620,41623-41627,41631-41632,41637,41644-41646
- Property svn:mergeinfo changed
-
trunk/Ohana/src/relphot/include/relphot.h
r41557 r41647 5 5 # include <pthread.h> 6 6 7 /* # define GRID_V1 */8 # define GRID_V29 # define NO_IMAGE -10010 11 7 # define ID_SECF_STACK_PRIMARY 0x00004000 12 8 13 9 # define NBOOTSTRAP 100 10 11 // MEAS_BAD is used in ImageOps.c, MosaicOps.c, TGroupOps.c to skip specific measurements. 12 // ID_MEAS_AREA is raised for measurements outside the user-specified region of the chips 13 // ID_MEAS_NOCAL is raised for measurements outside the valid time range or for inactive photcodes 14 // Note: these bits are only raised on the temporary MeasureTiny elements and are not saved 15 // to the database files. 16 # define MEAS_BAD (ID_MEAS_AREA | ID_MEAS_NOCAL) 14 17 15 18 # ifndef MAX_INT … … 53 56 54 57 typedef enum { 55 MODE_NONE = 0,56 MODE_LOAD = 1,57 MODE_UPDATE = 2,58 MODE_NONE = 0, 59 MODE_LOAD = 1, 60 MODE_UPDATE = 2, 58 61 MODE_UPDATE_OBJECTS = 3, 59 MODE_SYNTH_PHOT = 4,62 MODE_SYNTH_PHOT = 4, 60 63 } ModeType; 61 64 … … 70 73 PS1_w = 6, 71 74 } PS1filters; 75 76 typedef enum { 77 GRID_MEAN = 0, 78 GRID_STDEV = 1, 79 GRID_NPTS = 2, 80 } GridOutputMode; 72 81 73 82 typedef struct { … … 99 108 char skipCal; // if TRUE, this mosaic is incomplete and should not be calibrated 100 109 char inTGroup; 101 Coords coords; 110 Coords coords; // this is only used to set the mosaic center for assign_images used by region hosts 102 111 } Mosaic; 103 112 … … 140 149 int nCode; 141 150 } TGTimes; 151 152 typedef struct { 153 unsigned short photcode; 154 float **Mgrid; // grid of average corrections 155 float **dMgrid; // grid of stdev of corrections 156 int **nMgrid; // grid of number of stars for corrections 157 int Nx; // bin = int(Xchip * (Nx / NxChip)) 158 int Ny; // bin = int(Ychip * (Ny / NyChip)) 159 float dX; // bin = int(Xchip * dX), dX = Nx / NxChip 160 float dY; // bin = int(Ychip * dY), dY = Ny / NyChip 161 // NxChip, NyChip = 4900,4900 for now 162 } GridCorrectionType; 142 163 143 164 typedef enum { … … 366 387 int SKY_DEPTH; /** XXX EAM : depth of catalog tables, fix usage */ 367 388 char *SYNTH_ZERO_POINTS; 389 char *GRID_MEANFILE; 368 390 369 391 // globals for parallel region operations … … 389 411 double IMAGE_OFFSET; 390 412 double NIGHT_SCATTER; 391 double NIGHT_OFFSET; 413 double NIGHT_CHISQ; 414 double MOSAIC_SCATTER; 415 double MOSAIC_CHISQ; 392 416 double STAR_SCATTER; 393 417 double STAR_CHISQ; … … 413 437 int MOSAIC_ZEROPT; 414 438 int TGROUP_ZEROPT; 439 int GRID_ZEROPT; 440 441 int GRID_BIN_HSC; 442 int GRID_BIN_CFH; 443 int GRID_BIN_GPC1; 444 int GRID_BIN_GPC2; 415 445 416 446 int FREEZE_IMAGES; … … 424 454 int MANUAL_ITERATION; 425 455 int NLOOP; 426 int NGRID;427 456 int RESET; 428 457 int RESET_ZEROPTS; 458 int RESET_FLATCORR; 429 459 int REPAIR_WARPS; 430 460 int PRESERVE_PS1; 461 int REQUIRE_PSFFIT; 431 462 int UPDATE; 432 463 int SAVE_IMAGE_UPDATES; … … 436 467 char MOSAICNAME[256]; 437 468 char STATMODE[32]; 438 int STAR_BAD;439 int MEAS_BAD;440 469 int STAR_TOOFEW; 441 470 int GRID_TOOFEW; 442 471 int IMAGE_TOOFEW; 443 472 double IMAGE_GOOD_FRACTION; 444 int IMAGE_BAD;445 473 int CALIBRATE_STACKS_AND_WARPS; 446 int USE_GRID; 474 447 475 int KEEP_UBERCAL; 448 476 char *OUTROOT; … … 457 485 char *PhotcodeList; 458 486 459 int RELPHOT_GRID_X;460 int RELPHOT_GRID_Y;461 int RELPHOT_GRID_BINNING;462 463 487 int *photseclist; 464 488 int Nphotcodes; … … 490 514 char *UserCatalog; 491 515 516 enum {GRID_ZPT_MODE_NONE, GRID_ZPT_MODE_ALL, }; 517 int GRID_ZPT_MODE; 518 492 519 enum {TGROUP_ZPT_MODE_NONE, TGROUP_ZPT_MODE_GOOD_NIGHT, TGROUP_ZPT_MODE_ALL, }; 493 520 int TGROUP_ZPT_MODE; … … 504 531 505 532 RelphotStages STAGES; 506 507 # ifdef GRID_V1508 int setGridMeasure (off_t meas, int cat, double X, double Y);509 # endif510 511 # ifdef GRID_V2512 int setGridMeasure (off_t meas, int cat, double X, double Y, int ccdnum);513 # endif514 533 515 534 /*** relphot prototypes ***/ … … 523 542 int bcatalog PROTO((Catalog *subcatalog, Catalog *catalog, int Ncat)); 524 543 void clean_images PROTO((void)); 525 void clean_measures PROTO((Catalog *catalog, int Ncatalog, int final , FlatCorrectionTable *flatcorr));544 void clean_measures PROTO((Catalog *catalog, int Ncatalog, int final)); 526 545 void clean_mosaics PROTO((void)); 527 546 void clean_tgroups PROTO((void)); … … 549 568 int SetSignals (void); 550 569 551 void freeGridBins PROTO(( int Ncatalog));570 void freeGridBins PROTO((void)); 552 571 void freeImageBins PROTO((int Ncatalog, int doImageList)); 553 572 void freeMosaicBins PROTO((int Ncatalog, int doMosaicList)); … … 560 579 561 580 float getMcal PROTO((off_t meas, int cat, dvoMagClassType class)); 562 float getMflat PROTO((off_t meas, int cat, FlatCorrectionTable *flatcorr, Catalog *catalog)); 563 float getMgrid PROTO((off_t meas, int cat)); 581 float getMflat PROTO((off_t meas, int cat, Catalog *catalog)); 582 float getMgridTiny PROTO((MeasureTiny *measure)); 583 float getMgrid PROTO((Measure *measure)); 564 584 float getMmos PROTO((off_t meas, int cat)); 565 585 float getMgrp PROTO((off_t meas, int cat, float airmass, float *dZpt)); … … 570 590 Image *getimages PROTO((off_t *N, off_t **LineNumber)); 571 591 ImageSubset *getimages_subset PROTO((off_t *N)); 572 void global_stats PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr, int nloop)); 573 void initGrid PROTO((int dX, int dY)); 574 void initGridBins PROTO((Catalog *catalog, int Ncatalog)); 592 void global_stats PROTO((Catalog *catalog, int Ncatalog, int nloop)); 593 void initGrid PROTO((void)); 594 void setMflatFromGrid PROTO((Catalog *catalog)); 595 void initGridBins PROTO((void)); 596 GridCorrectionType *getGridCorrByCode PROTO((int code)); 597 GridCorrectionType *getGridCorrNext PROTO((int *Nlast)); 598 int GridCorrectionSave PROTO((void)); 599 int GridCorrectionSaveFile PROTO((char *filename, GridOutputMode mode)); 600 void GridCorrectionLoad PROTO((char *filename)); 575 601 void initImageBins PROTO((Catalog *catalog, int Ncatalog, int doImageList)); 576 602 void initImagesSubset PROTO((ImageSubset *input, off_t *line_number, off_t N)); 577 603 void initImages PROTO((Image *input, off_t *LineNumber, off_t N)); 578 604 void initMosaicBins PROTO((Catalog *catalog, int Ncatalog, int doMosaicList)); 579 void initMosaic GridPROTO((Image *image, off_t Nimage));605 void initMosaicMcal PROTO((Image *image, off_t Nimage)); 580 606 void initMosaics PROTO((Image *subset, off_t Nsubset, Image *image, char *inSubset, off_t Nimage)); 581 607 void initTGroups PROTO((Image *subset, off_t Nsubset)); … … 621 647 void plot_chisq PROTO((Catalog *catalog, int Ncatalog)); 622 648 void plot_defaults PROTO((Graphdata *graphdata)); 623 void plot_grid PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr));624 649 void plot_images PROTO((void)); 625 650 void plot_list PROTO((Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *format, ...) OHANA_FORMAT(printf, 6, 7) ); 626 651 void plot_mosaic_fields PROTO((Catalog *catalog)); 627 652 void plot_mosaics PROTO((void)); 628 void plot_scatter PROTO((Catalog *catalog, int Ncatalog , FlatCorrectionTable *flatcorr));653 void plot_scatter PROTO((Catalog *catalog, int Ncatalog)); 629 654 void plot_star_coords PROTO((Catalog *catalog, int Ncatalog)); 630 655 void plot_stars PROTO((Catalog *catalog, int Ncatalog)); … … 635 660 int open_graph PROTO((int N)); 636 661 637 void reload_catalogs PROTO((SkyList *skylist, FlatCorrectionTable *flatcorr,int hostID, char *hostpath));662 void reload_catalogs PROTO((SkyList *skylist, int hostID, char *hostpath)); 638 663 int reload_catalogs_parallel PROTO((SkyList *sky)); 639 664 int reload_images PROTO((FITS_DB *db)); 640 665 int setExclusions PROTO((Catalog *catalog, int Ncatalog, int verbose)); 641 void setMgrid PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 666 void setMgrid PROTO((Catalog *catalog, int Ncatalog)); 667 void resetMgrid PROTO((void)); 668 642 669 void setMcalFromMosaics PROTO((void)); 643 670 void setMcalFromTGroups PROTO((void)); 644 int setMcalOutput PROTO((Catalog *catalog, int Ncatalog , FlatCorrectionTable *flatcorr));645 646 void setMcal PROTO((Catalog *catalog , FlatCorrectionTable *flatcorr));647 int setMmos PROTO((Catalog *catalog , FlatCorrectionTable *flatcorr));648 int setMgrp PROTO((Catalog *catalog , FlatCorrectionTable *flatcorr));649 650 int setMrel PROTO((Catalog *catalog, int Ncatalog , FlatCorrectionTable *flatcorr));651 void setMrelFinal PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr,int simpleAverage));652 int setMrelOutput PROTO((Catalog *catalog, int Ncatalog , FlatCorrectionTable *flatcorr));653 654 void setMcalTest PROTO((Catalog *catalog , FlatCorrectionTable *flatcorr));671 int setMcalOutput PROTO((Catalog *catalog, int Ncatalog)); 672 673 void setMcal PROTO((Catalog *catalog)); 674 int setMmos PROTO((Catalog *catalog)); 675 int setMgrp PROTO((Catalog *catalog)); 676 677 int setMrel PROTO((Catalog *catalog, int Ncatalog)); 678 void setMrelFinal PROTO((Catalog *catalog, int simpleAverage)); 679 int setMrelOutput PROTO((Catalog *catalog, int Ncatalog)); 680 681 void setMcalTest PROTO((Catalog *catalog)); 655 682 656 683 int setMave PROTO((Catalog *catalog, int Ncatalog)); 657 684 void set_ZP PROTO((double ZERO)); 658 685 int setrefcode PROTO((Image *image, off_t Nimage)); 659 void skip_measurements PROTO((Catalog *catalog, int pass , FlatCorrectionTable *flatcorr));686 void skip_measurements PROTO((Catalog *catalog, int pass)); 660 687 void sortA PROTO((double *X, int N)); 661 688 void sortB PROTO((double *X, double *Y, int N)); … … 663 690 void sortD PROTO((double *X, double *Y, double *Z, int N)); 664 691 StatType statsImageM PROTO((Catalog *catalog)); 665 StatType statsImageN PROTO((Catalog *catalog , FlatCorrectionTable *flatcorr));692 StatType statsImageN PROTO((Catalog *catalog)); 666 693 StatType statsImageX PROTO((Catalog *catalog)); 667 694 StatType statsImagedM PROTO((Catalog *catalog)); 668 695 StatType statsMosaicM PROTO((Catalog *catalog)); 669 StatType statsMosaicN PROTO((Catalog *catalog , FlatCorrectionTable *flatcorr));696 StatType statsMosaicN PROTO((Catalog *catalog)); 670 697 StatType statsMosaicX PROTO((Catalog *catalog)); 671 698 StatType statsMosaicdM PROTO((Catalog *catalog)); … … 674 701 StatType statsTGroupdM PROTO((Catalog *catalog)); 675 702 676 StatType statsStarN PROTO((Catalog *catalog, int Ncatalog, int Nsec, int seccode , FlatCorrectionTable *flatcorr));703 StatType statsStarN PROTO((Catalog *catalog, int Ncatalog, int Nsec, int seccode)); 677 704 StatType statsStarS PROTO((Catalog *catalog, int Ncatalog, int Nsec)); 678 705 StatType statsStarX PROTO((Catalog *catalog, int Ncatalog, int Nsec)); … … 720 747 721 748 int print_measure_set_alt (Average *average, SecFilt *secfilt, Measure *measure); 722 int setMrel_catalog_alt (Catalog *catalog, int Nc, int isSetMrelFinal, FlatCorrectionTable *flatcorr, SetMrelInfo *results, int Nsecfilt); 723 int setMrelAverageExposure (Catalog *catalog, int cat, off_t ave, int Nsecfilt, int isSetMrelFinal, FlatCorrectionTable *flatcorr, SetMrelInfo *results); 724 int setMrelAverageStack (Catalog *catalog, int cat, off_t ave, int Nsecfilt, FlatCorrectionTable *flatcorr); 725 int setMrelAverageForcedWarp (Catalog *catalog, int cat, off_t ave, int Nsecfilt, FlatCorrectionTable *flatcorr, SetMrelInfo *results); 749 750 // in setMrelCatalog.c: 751 int setMrelCatalog (Catalog *catalog, int Nc, int isSetMrelFinal, SetMrelInfo *results, int Nsecfilt); 752 int setMrelAverageExposure (Catalog *catalog, int cat, off_t ave, int Nsecfilt, int isSetMrelFinal, SetMrelInfo *results); 753 int setMrelAverageStack (Catalog *catalog, int cat, off_t ave, int Nsecfilt); 754 int setMrelAverageForcedWarp (Catalog *catalog, int cat, off_t ave, int Nsecfilt, SetMrelInfo *results); 726 755 727 756 int setGlobalObjStats (Average *average, Measure *measure); … … 735 764 StatDataSet *StatDataSetAlloc (int Nsecfilt, int Nmax); 736 765 737 int init_synthetic_mags ( );766 int init_synthetic_mags (void); 738 767 int add_synthetic_mags (AverageTiny *average, SecFilt *secfilt, MeasureTiny *measure, off_t *Nmeasure, off_t *Nm); 739 768 … … 796 825 797 826 int SynthZeroPointsLoad (char *filename); 798 SynthZeroPoints *SynthZeroPointsGet ( );827 SynthZeroPoints *SynthZeroPointsGet (void); 799 828 800 829 int relphot_synthphot (SkyList *sky, int hostID, char *hostpath); … … 815 844 816 845 void put_astrom_table (AstromOffsetTable *myTable); 817 void free_astrom_table (); 818 819 int RepairWarpMeasures (Catalog *catalog); 820 821 int FindWarpGroups (void); 822 int GetWarpSeq (Image *image, int obstime, unsigned short photcode, double Rave, double Dave, float X, float Y); 823 void FreeWarpGroups (void); 824 825 myIndexType *myIndexInit (); 826 int myIndexFree (myIndexType *myIndex); 827 int myIndexUpdateLimits (myIndexType *myIndex, int value); 828 int myIndexSetRange (myIndexType *myIndex); 829 int myIndexSetEntry (myIndexType *myIndex, int value, int entry); 830 int myIndexGetEntry (myIndexType *myIndex, int value); 846 void free_astrom_table (void); 831 847 832 848 uint64_t CreatePSPSObjectID(double ra, double dec); … … 834 850 uint64_t CreatePSPSDetectionID(double tobs, int ccdid, int detID); 835 851 836 int MakeStackIndex (void);837 void FreeStackGroups (void);838 int GetStackSeq (Image *image, double Rstk, double Dstk, unsigned short photcode, float X, float Y);839 852 void sort_by_ra (double *R, double *D, int *I, int *S, int N); 840 841 void RepairWarpMeasuresOpenLogfile ();842 void RepairWarpMeasuresCloseLogfile ();843 853 844 854 void dump_tgroups (Catalog *catalog, int Npass); … … 849 859 int GetZptIteration (void); 850 860 851 void SetZeroPointModes ( void);861 void SetZeroPointModes (Catalog *catalog, int Ncatalog); 852 862 int UseStandardOLS (ZptFitModeType mode); 853 863 int GetActivePhotcodeIndex (int photcode); … … 857 867 858 868 int MagResidSave(char *filename, Catalog *catalog); 869 870 void ResetAverageAndMeasure (Catalog *catalog); 871 void ResetAverageObjects (Catalog *catalog); 872 void ResetImages (Image *subset, off_t Nsubset); 873 void ResetMeasureZeroPoints (MeasureTiny *measure, off_t Nmeasure, off_t Ncat); 874 void ResetAverageActivePhotcodes (SecFilt *secfilt); 875 876
Note:
See TracChangeset
for help on using the changeset viewer.
