IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31091


Ignore:
Timestamp:
Mar 30, 2011, 9:42:02 AM (15 years ago)
Author:
eugene
Message:

merging changes from trunk

Location:
branches/eam_branches/ipp-20110213/psModules/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/psModules/src/config/pmConfigRecipeValue.c

    r26893 r31091  
    3232        return NULL;
    3333    }
    34 
    35     psMetadataItem *fpaItem = psMetadataLookup(recipe, valueName); // Value for FPA or menu of chips
     34    psMetadata *format = config->format;
     35   
     36    psMetadataItem *fpaItem;
     37    fpaItem = psMetadataLookup(format, valueName);
     38    if (!fpaItem) {
     39      fpaItem = psMetadataLookup(recipe, valueName); // Value for FPA or menu of chips
     40    }
     41   
    3642    if (!fpaItem) {
    3743        psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find value %s in recipe %s", valueName, recipeName);
  • branches/eam_branches/ipp-20110213/psModules/src/detrend/pmDetrendDB.c

    r29833 r31091  
    77#include <pslib.h>
    88
     9#include "pmErrorCodes.h"
    910#include "pmConfig.h"
    1011#include "pmConfigCommand.h"
     
    120121    PS_ASSERT_PTR_NON_NULL(config, NULL);
    121122
     123    psIOBuffer *buffer = NULL;
     124    psPipe *pipe = NULL;
     125    psMetadata *answer = NULL;
     126
    122127    int status, exit_status;
    123128    psString line = NULL;
     
    137142    psFree (realCamera);
    138143
     144    // require a filter for certain types of detrends:
     145    if ((options->type == PM_DETREND_TYPE_FLAT) && !options->filter) {
     146        psError (PM_ERR_CONFIG, false, "requesting a FLAT-class of detrend without a filter");
     147        goto failure;
     148    }
     149    if ((options->type == PM_DETREND_TYPE_FLATCORR) && !options->filter) {
     150        psError (PM_ERR_CONFIG, false, "requesting a FLATCORR-class of detrend without a filter");
     151        goto failure;
     152    }
     153    if ((options->type == PM_DETREND_TYPE_FRINGE) && !options->filter) {
     154        psError (PM_ERR_CONFIG, false, "requesting a FRINGE-class of detrend without a filter");
     155        goto failure;
     156    }
     157
     158    // add the restrictions
    139159    if (options->filter) {
    140160        psStringAppend(&line, " -filter %s", options->filter);
     
    155175        psStringAppend(&line, " -airmass %f", options->twilight);
    156176    }
    157 
    158     psIOBuffer *buffer = NULL;
    159     psPipe *pipe = NULL;
    160     psMetadata *answer = NULL;
    161177
    162178    if (!pmConfigDatabaseCommand(&line, config)) {
  • branches/eam_branches/ipp-20110213/psModules/src/detrend/pmFringeStats.c

    r30550 r31091  
    10291029    psVector *science_values   = psVectorAllocEmpty(4000,PS_TYPE_F32);
    10301030    psVector *science_errors   = psVectorAllocEmpty(4000,PS_TYPE_F32);
    1031 
    1032     psStats *binStats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
     1031    psVector *science_counts   = psVectorAllocEmpty(4000,PS_TYPE_S32);
     1032
     1033    psStats *binStats = psStatsAlloc(PS_STAT_CLIPPED_MEAN | PS_STAT_CLIPPED_STDEV);
    10331034    for (int i = 0; i < 4000; i++) {
    10341035      psVector *bin = bins->data[i];
    1035       if (bin->n > 2) {
     1036      if (bin->n > 10) {
    10361037        psStatsInit(binStats);
    10371038
    10381039        psVectorStats(binStats,bin,NULL,NULL,1);
    10391040       
    1040         if (isfinite(binStats->robustStdev) &&
    1041             isfinite(binStats->robustMedian) &&
    1042             binStats->robustStdev > 0) {
     1041        if (isfinite(binStats->clippedStdev) &&
     1042            isfinite(binStats->clippedMean) &&
     1043            (binStats->clippedStdev > 0) &&
     1044            (binStats->clippedNvalues > 10) &&
     1045            (binStats->clippedNvalues > 0.5 * bin->n)
     1046            ) {
    10431047          psVectorAppend(fringe_positions,-0.1 + i * 5e-5);
    1044           psVectorAppend(science_values, binStats->robustMedian);
    1045           psVectorAppend(science_errors, binStats->robustStdev);
     1048          psVectorAppend(science_values, binStats->clippedMean);
     1049          psVectorAppend(science_errors, binStats->clippedStdev);
     1050          psVectorAppend(science_counts, bin->n);
    10461051        }
    10471052      }
     
    10521057
    10531058    for (int i = 0; i < fringe_positions->n; i++) {
    1054       psTrace("psModules.detrend",7,"FITDATA: %f %f %f\n",
     1059      psTrace("psModules.detrend",7,"FITDATA: %f %f %f %d\n",
    10551060              fringe_positions->data.F32[i],
    10561061              science_values->data.F32[i],
    1057               science_errors->data.F32[i]);
     1062              science_errors->data.F32[i],
     1063              science_counts->data.S32[i]);
    10581064    }
    10591065/*     // Begin switch from old outlier removal and fitting code. */
     
    10711077    psFree(science_values);
    10721078    psFree(science_errors);
     1079    psFree(science_counts);
    10731080   
    10741081    for (int i = 0; i <= poly->nX; i++) {
  • branches/eam_branches/ipp-20110213/psModules/src/imcombine/pmSubtractionMatch.c

    r30813 r31091  
    684684                    // if we failed, it might be due to the desired normWindow being larger than the current footprint.
    685685                    // in this case, just adjust the footprint and try again.
    686                     if (tryAgain && (nTries >= 2)) {
     686                    if (tryAgain && (nTries >= 5)) {
    687687                        // unrecoverable error
    688688                        psError(PM_ERR_STAMPS, true, "Unable to get stamp window (failure to converge).");
  • branches/eam_branches/ipp-20110213/psModules/src/imcombine/pmSubtractionStamps.c

    r30813 r31091  
    926926
    927927    // this is an unrecoverable error : something really bogus in the data
    928     if (stamps->normWindow1 == 0) {
     928    if (stamps->normWindow1 <= 0) {
    929929        psError(PM_ERR_STAMPS, true, "Unable to determine normalisation window size (1).");
    930930        psFree (stats);
     
    935935        return false;
    936936    }
    937     if (stamps->normWindow2 == 0) {
     937    if (stamps->normWindow2 <= 0) {
    938938        psError(PM_ERR_STAMPS, true, "Unable to determine normalisation window size (2).");
    939939        psFree (stats);
Note: See TracChangeset for help on using the changeset viewer.