IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 9, 2009, 11:25:34 AM (17 years ago)
Author:
Paul Price
Message:

Merging cnb_branch_20090113. No major conflicts. Compiles, but not tested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/astrom/pmAstrometryVisual.h

    r20801 r21422  
     1/*
     2 * @file pmAstrometryVisual.h
     3 * @author Chris Beaumont, IfA
     4 * @brief A set of functions to display visual diagnostics from psastro
     5 * Copyright 2009 Institute for Astronomy, University of Hawaii
     6 */
     7
     8#ifndef PM_ASTROM_VISUAL_H
     9#define PM_ASTROM_VISUAL_H
     10
     11
     12/** A fit to the logN / logS curve for a set of stars
     13 * logN = offset + slope * logS
     14 */
     15typedef struct {
     16    double mMin;                        ///< minimum magnitude bin with data
     17    double mMax;                        ///< maximum magnitude bin with data
     18    double offset;                      ///< fitted line offset
     19    double slope;                       ///< fitted line slope
     20    double mPeak;                       ///< mag of peak bin
     21    int nPeak;                          ///< # of stars in peak bin
     22    int sPeak;                          ///< sum of stars to peak bin
     23} pmLumFunc;
     24
     25
     26/** Enable or disable visual plotting for psastro routines
     27 * @param mode true/false to enable/disable plotting
     28 * @return true for success */
    129bool pmAstromSetVisual(bool mode);
    2 bool pmAstromVisualInitWindow (int *kapid, char *name);
    3 bool pmAstromVisualAskUser (bool *plotflag);
     30
     31
     32/** Close plotting windows at the end of a run
     33 * @return true for success */
    434bool pmAstromVisualClose();
    5 bool pmAstromVisualPlotGridMatch (const psArray *raw, const psArray *ref, psImage *gridNP, double offsetX, double offsetY, double maxOffpix, double Scale, double Offset);
    6 bool pmAstromVisualPlotTweak (psVector *xHist, psVector *yHist, int xBin, int yBin);
     35
     36
     37/**
     38 * Plot the offset between every pair of reference and raw source locations. The peak of this
     39 * distribution nominally gives the offset, scale difference, and rotation of the two catalogs.
     40 * Overplots the location of this peak as determined by pmAstromGridAngle, as well as some profiles
     41 * along horizontal and vertical cuts through this peak.
     42 */
     43bool pmAstromVisualPlotGridMatch (const psArray *raw, ///< raw stars
     44                                  const psArray *ref, ///< reference stars
     45                                  psImage *gridNP,    ///< a 2D histogram of raw-ref star distances
     46                                  double offsetX,     ///< The X location (FP coordinates) of the peak of gridNP
     47                                  double offsetY,     ///< the Y location (FP coordinates) of the peak of gridNP
     48                                  double maxOffpix,   ///< The half-width of gridNP in FP coordinates
     49                                  double Scale,       ///< The pixel size of gridNP in histogram-bin-coordinates
     50                                  double Offset       ///< The (x,y) location (histogram-bin coordinates) of the FP point (0,0) in gridNP
     51                                  );
     52
     53
     54/**
     55 * Plot the refinements made within pmAstromGridTweak.
     56 * After pmAstromGridMatch finds the best rotaion/scale/offset between raw and reference stars
     57 * within a coarse grid of rotations/scales, pmAstromGridTweak computes a higher precision
     58 * estimate of the offset. It computes the 2 point correlation function between raw and ref
     59 * stars along horizontal and vertical cuts through the first-guess offset. It finds the peak
     60 * of these two profiles and adjusts the offset accordingly. This procedure plots the profiles.
     61 */
     62bool pmAstromVisualPlotTweak (psVector *xHist, ///< Smoothed Horizontal cut through the histogram
     63                              psVector *yHist, ///< Smoothed Vertical cut throug the histogram
     64                              int xBin,        ///< X Bin index of the histogram peak
     65                              int yBin         ///< Y bin index of the histogram peak
     66                              );
     67
     68
     69/**
     70 * Plot the two luminosity functions created within psastroRefStarSubset
     71 * The luminosity functions are used to select a subset of reference stars,
     72 * so we plot the cutoff that defines this subset
     73 */
     74bool pmAstromVisualPlotLuminosityFunction (psVector *lnMag,   ///< Log(n) for each magnitude bin
     75                                          psVector *Mag,     ///< magnitude bins
     76                                          pmLumFunc *lumFunc,///< Fit to the reference star luminosity function
     77                                          pmLumFunc *rawFunc ///< Fit to the raw star luminoisty function
     78                                           );
     79
     80
     81/**
     82 * Plot raw stars as determined from first pass astrometry fit
     83 * Called within psastroAstromGeuss
     84 */
     85bool pmAstromVisualPlotRawStars (psArray *rawstars, ///< Stars detected in the fpa
     86                                 pmFPA *fpa,  ///< structure describing the focal plane array
     87                                 pmChip *chip,  ///< structure describing the chip
     88                                 psMetadata *recipe ///< the recipe used in psastro
     89                                 );
     90
     91
     92/**
     93 * plot the location of references stars over the entire fpa
     94 * invoked during psastroChooseRefStars
     95 */
     96bool pmAstromVisualPlotRefStars (psArray *refstars, psMetadata *recipe);
     97
     98
     99/**
     100 * Plot the stars in a region, and indicate which stars are part of 'clumps'
     101 * These stars are flagged during astrometric fitting, since dense regions are
     102 * harder to cross-match than sparse ones. Called during psastroRemoveClumps.
     103 */
     104bool pmAstromVisualPlotRemoveClumps (psArray *input, ///< Array containing the field stars
     105                                    psImage *count, ///< A 2D histogram of the field star distribution
     106                                    int scale,      ///< The pixel size of the histogram
     107                                    float limit     ///< The minimum numuber of stars in a bin flagged as a clump
     108                                     );
     109
     110/**
     111 * Plots the chip corners in the FP before and after chips with inconsistent solutions have been fixed.
     112 * Invoked during psastroFixChips
     113 */
     114bool pmAstromVisualPlotFixChips (pmFPAfile *input, ///< focal plane array file
     115                                 psVector *xOld, ///< old X location of chip cornerss
     116                                 psVector *yOld ///< old Y location of chip corners
     117                                 );
     118
     119
     120/**
     121 * Assess the goodness of fit for a signle chip by
     122 * plotting the fit residuals
     123 * invoked during psastroOneChipFit
     124 */
     125bool pmAstromVisualPlotOneChipFit (psArray *rawstars, ///< stars detected in the image
     126                                  psArray *refstars, ///< reference stars over the same region
     127                                  psArray *match,    ///< contains which rawstars match to which refstars
     128                                  psMetadata *recipe ///< data reduction recipe
     129                                   );
     130
     131/**
     132 *  Plots the fpa chip corners projected on to the tangential plane before and after
     133 *  the astrometry solution has been applied. In psastroAstromGuessCheck, the old corners
     134 *  are then fit to the new corners to get a sense at how far off the initial WCS info was
     135 *  in offset, rotation, and scale. This procedure also plots the residuals of the fit from
     136 *  old to new coordinates
     137 */
     138bool pmAstromVisualPlotAstromGuessCheck (psVector *cornerPo, ///< P coordinates of chip corners before fitting
     139                                        psVector *cornerQo, ///< Q coordinates of chip corners before fitting
     140                                        psVector *cornerPn, ///< P coordinates of chip corners after fitting
     141                                        psVector *cornerQn, ///< Q coordinates of chip corners after fitting
     142                                        psVector *cornerPd, ///< P coordinate residuals of fit from old to new coordinates
     143                                        psVector *cornerQd  ///< Q coordinate residuals of fit from old to new coordinates
     144                                         );
     145
     146
     147/**
     148 *   plot the residuals between raw stars and ref stars after
     149 *   fitting in psastroMosaicOneChip
     150 */
     151bool pmAstromVisualPlotMosaicOneChip (psArray *rawstars, psArray *refstars, psArray *match, psMetadata *recipe) ;
     152
     153
     154/**
     155 * Plots the pixel scales of the fpa before they are
     156 * equalized in psastroMosaicCommonScale
     157 */
     158bool pmAstromVisualPlotCommonScale (pmFPA *fpa,         ///< the fpa
     159                                   psVector *oldScale  ///< the old pixel scale of each chip in the fpa
     160                                    );
     161
     162
     163/** pmAstromVisualPlotMosaicMatches
     164 * Plot the matches between raw and reference stars during pmAstromVisualMosaicSetMatch
     165 */
     166bool pmAstromVisualPlotMosaicMatches (psArray *rawstars, psArray *refstars, psArray *match, int iteration, psMetadata *recipe);
     167
     168
     169#endif
Note: See TracChangeset for help on using the changeset viewer.