IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36764


Ignore:
Timestamp:
May 23, 2014, 9:27:29 AM (12 years ago)
Author:
eugene
Message:

slightly better options for the grid plotting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140423/psModules/src/astrom/pmAstrometryVisual.c

    r35768 r36764  
    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.