IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 7, 2014, 6:37:32 AM (12 years ago)
Author:
eugene
Message:

add Koppenhoefer correction; move pmConceptsChipNumberFromName & pmConceptsChipFromName to pmConcepts; clean up some visuals; change pmSourceIO_MatchedRefs to use PSASTRO.RAWSTARS.SUBSET, PSASTRO.REFSTARS.SUBSET instead of PSASTRO.RAWSTARS, PSASTRO.REFSTARS; modify the output fields in MATCHED_REFS; clip e0 outliers from psf model construction

Location:
trunk/psModules/src/astrom
Files:
6 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/astrom/Makefile.am

    r20801 r36834  
    1111        pmAstrometryRefstars.c \
    1212        pmAstrometryWCS.c \
    13         pmAstrometryVisual.c
     13        pmAstrometryVisual.c \
     14        pmKHcorrect.c
    1415
    1516pkginclude_HEADERS = \
     
    2122        pmAstrometryRefstars.h \
    2223        pmAstrometryWCS.h \
    23         pmAstrometryVisual.h
     24        pmAstrometryVisual.h \
     25        pmKHcorrect.h
    2426
    2527CLEANFILES = *~
  • trunk/psModules/src/astrom/pmAstrometryModel.c

    r26260 r36834  
    3939#include "pmFPAExtent.h"
    4040#include "pmFPAfileFitsIO.h"
     41#include "pmConcepts.h"
    4142#include "pmAstrometryWCS.h"
    4243#include "pmAstrometryUtils.h"
     
    452453}
    453454
    454 int pmConceptsChipNumberFromName (pmFPA *fpa, char *name) {
    455 
    456     for (int i = 0; i < fpa->chips->n; i++) {
    457         pmChip *chip = fpa->chips->data[i];
    458         if (!chip) continue;
    459         char *thisone = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME");
    460         if (!thisone) continue;
    461         if (!strcmp (name, thisone)) return (i);
    462     }
    463     return -1;
    464 }
    465 
    466 pmChip *pmConceptsChipFromName (pmFPA *fpa, char *name) {
    467 
    468     for (int i = 0; i < fpa->chips->n; i++) {
    469         pmChip *chip = fpa->chips->data[i];
    470         if (!chip) continue;
    471         char *thisone = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME");
    472         if (!thisone) continue;
    473         if (!strcmp (name, thisone)) return (chip);
    474     }
    475     return NULL;
    476 }
    477 
    478455// first layer converts Chip to Focal Plane
    479456bool pmAstromModelReadChips (pmFPAfile *file) {
  • trunk/psModules/src/astrom/pmAstrometryModel.h

    r18601 r36834  
    2727bool pmAstromModelWriteChips (pmFPAfile *file);
    2828
    29 int pmConceptsChipNumberFromName (pmFPA *fpa, char *name);
    30 pmChip *pmConceptsChipFromName (pmFPA *fpa, char *name);
    31 
    3229bool pmAstromModelReadForView (const pmFPAview *view, pmFPAfile *file, const pmConfig *config);
    3330bool pmAstromModelReadFPA (pmFPAfile *file);
  • trunk/psModules/src/astrom/pmAstrometryObjects.c

    r31671 r36834  
    571571    psMemSetDeallocator (stats, (psFreeFunc)pmAstromStatsFree);
    572572
    573     //    stats->center = {0, 0, 0, 0};
    574     //    stats->offset = {0, 0, 0, 0};
    575     stats->angle     = 0.0;
    576     stats->scale     = 1.0;
    577     stats->minMetric = 0.0;
    578     stats->minVar    = 0.0;
    579     stats->nMatch    = 0;
    580     stats->nTest     = 0;
    581     stats->nSigma    = 0;
     573    stats->center.x    = 0;
     574    stats->center.y    = 0;
     575    stats->center.xErr = 0;
     576    stats->center.yErr = 0;
     577
     578    stats->offset.x    = 0;
     579    stats->offset.y    = 0;
     580    stats->offset.xErr = 0;
     581    stats->offset.yErr = 0;
     582
     583    stats->angle       = 0.0;
     584    stats->scale       = 1.0;
     585    stats->minMetric   = 0.0;
     586    stats->minVar      = 0.0;
     587    stats->nMatch      = 0;
     588    stats->nTest       = 0;
     589    stats->nSigma      = 0;
    582590
    583591    return (stats);
     
    914922    // fprintf (stderr, "sigma: nMatch: %d, nTest: %d, nTen: %d\n", stats->nMatch, stats->nTest, sort->data.U32[sort->n - 10]);
    915923
    916 
    917   psFree (sort);
     924    psFree (sort);
    918925    psFree (listNP);
    919926    psFree (gridNP);
  • trunk/psModules/src/astrom/pmAstrometryObjects.h

    r26260 r36834  
    4242    float Color;                        ///< object color
    4343    float dMag;                         ///< error on object magnitude
     44    float SBinst;                       ///< surface brightness, used for Koppenhoefer correction
    4445}
    4546pmAstromObj;
  • trunk/psModules/src/astrom/pmAstrometryVisual.c

    r35768 r36834  
    946946    KapaSendLabel (kapa2, "X (FP)", KAPA_LABEL_XM);
    947947    KapaSendLabel (kapa2, "Y (FP)", KAPA_LABEL_YM);
    948     KapaSendLabel (kapa2, "pmAstromGridAngle residuals. Box: Correlation Peak.", KAPA_LABEL_XP);
     948    KapaSendLabel (kapa2, "pmAstromGridAngle red: raw, black: ref.", KAPA_LABEL_XP);
    949949
    950950    // plot the REF data.  (also calculate the plot ranges, accumulate the plot vectors)
     
    966966    KapaSetLimits(kapa2, &graphdata);
    967967
    968     psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN);
     968    psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN | PS_STAT_MIN  | PS_STAT_MAX );
    969969    psVectorStats (stats, zPlot, NULL, NULL, 0);
    970     float zero = stats->sampleMedian + 3.0;
    971     float range = 6.0;
    972 
     970    float range = stats->max - stats->min;
     971    range = PS_MAX (0.5, PS_MIN (6.0, range));
     972    float zero = stats->sampleMedian + 0.25*range;
     973
     974    float maxZ = zPlot->data.F32[0], minZ = zPlot->data.F32[0];
    973975    for (int i = 0; i < zPlot->n; i++) {
     976        maxZ = PS_MAX (maxZ, zPlot->data.F32[i]);
     977        minZ = PS_MIN (minZ, zPlot->data.F32[i]);
    974978        float value = (zero - zPlot->data.F32[i]) / range;
    975979        zPlot->data.F32[i] = PS_MAX(0.0, PS_MIN(1.0, value));
    976980    }
     981    fprintf (stderr, "ref mags: %f to %f (%f median)\n", minZ, maxZ, stats->sampleMedian);
    977982
    978983    // the point size will be scaled from the z vector
     
    9981003    psStatsInit(stats);
    9991004    psVectorStats (stats, zPlot, NULL, NULL, 0);
    1000     zero = stats->sampleMedian + 3.0;
    1001     range = 6.0;
    1002 
     1005    range = stats->max - stats->min;
     1006    range = PS_MAX (0.5, PS_MIN (6.0, range));
     1007    zero = stats->sampleMedian + 0.25*range;
     1008    // zero = stats->sampleMedian + 1.0;
     1009    // range = 6.0;
     1010
     1011    maxZ = zPlot->data.F32[0], minZ = zPlot->data.F32[0];
    10031012    for (int i = 0; i < zPlot->n; i++) {
     1013        maxZ = PS_MAX (maxZ, zPlot->data.F32[i]);
     1014        minZ = PS_MIN (minZ, zPlot->data.F32[i]);
    10041015        float value = (zero - zPlot->data.F32[i]) / range;
    10051016        zPlot->data.F32[i] = PS_MAX(0.0, PS_MIN(1.0, value));
    10061017    }
     1018    fprintf (stderr, "raw mags: %f to %f (%f median)\n", minZ, maxZ, stats->sampleMedian);
    10071019
    10081020    // the point size will be scaled from the z vector
Note: See TracChangeset for help on using the changeset viewer.