IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20800


Ignore:
Timestamp:
Nov 19, 2008, 10:08:24 AM (17 years ago)
Author:
Paul Price
Message:

Removing dump for when tracing is off (e.g., when compiled optimised).
There's a SEGV in the dump somewhere.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroMosaicAstrom.c

    r20269 r20800  
    1313    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE);
    1414    if (!recipe) {
    15         psError(PSASTRO_ERR_CONFIG, false, "Can't find PSASTRO recipe!\n");
    16         return false;
     15        psError(PSASTRO_ERR_CONFIG, false, "Can't find PSASTRO recipe!\n");
     16        return false;
    1717    }
    1818
     
    2020    pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT");
    2121    if (!input) {
    22         psError(PSASTRO_ERR_CONFIG, false, "Can't find input data!\n");
    23         return false;
     22        psError(PSASTRO_ERR_CONFIG, false, "Can't find input data!\n");
     23        return false;
    2424    }
    2525
     
    2727
    2828    // before we do object matches, we need to (optionally) fix failed chips.  We compare chips with
    29     // the supplied mosaic model.  Adjust significant outliers to match model. 
     29    // the supplied mosaic model.  Adjust significant outliers to match model.
    3030    # if (0)
    3131    if (!psastroFixChips (config, recipe)) {
    32         psError(PSASTRO_ERR_UNKNOWN, false, "failed to align problematic chips");
    33         return false;
     32        psError(PSASTRO_ERR_UNKNOWN, false, "failed to align problematic chips");
     33        return false;
    3434    }
    3535    if (!psastroFixChipsTest (config, recipe)) {
    36         psError(PSASTRO_ERR_UNKNOWN, false, "failed to align problematic chips");
    37         return false;
     36        psError(PSASTRO_ERR_UNKNOWN, false, "failed to align problematic chips");
     37        return false;
    3838    }
    3939    # endif
     
    5050    // first, re-perform the match with a slightly tighter circle
    5151    if (!psastroMosaicSetMatch (fpa, recipe, 4)) {
    52         psError(PSASTRO_ERR_UNKNOWN, false, "failed to match raw and ref stars for mosaic (4th pass)");
    53         return false;
     52        psError(PSASTRO_ERR_UNKNOWN, false, "failed to match raw and ref stars for mosaic (4th pass)");
     53        return false;
    5454    }
    5555    if (!psastroMosaicChipAstrom (fpa, recipe, 4)) {
    56         psError(PSASTRO_ERR_UNKNOWN, false, "failed to measure chip astrometry in mosaic mode (4th pass)");
    57         return false;
     56        psError(PSASTRO_ERR_UNKNOWN, false, "failed to measure chip astrometry in mosaic mode (4th pass)");
     57        return false;
    5858    }
    59     if (psTraceGetLevel("psastro.dump") > 0) { 
    60         snprintf (filename, 256, "%s.10.dat", outroot);
    61         psastroDumpMatches (fpa, filename);
     59    if (psTraceGetLevel("psastro.dump") > 0) {
     60        snprintf (filename, 256, "%s.10.dat", outroot);
     61        psastroDumpMatches (fpa, filename);
    6262    }
    6363
     
    6666    psMetadata *updates = psMetadataLookupMetadata (&status, fpa->analysis, "PSASTRO.HEADER");
    6767    if (!updates) {
    68         updates = psMetadataAlloc ();
    69         psMetadataAddMetadata (fpa->analysis, PS_LIST_TAIL, "PSASTRO.HEADER",  PS_META_REPLACE, "psastro header stats", updates);
    70         psFree (updates);
     68        updates = psMetadataAlloc ();
     69        psMetadataAddMetadata (fpa->analysis, PS_LIST_TAIL, "PSASTRO.HEADER",  PS_META_REPLACE, "psastro header stats", updates);
     70        psFree (updates);
    7171    }
    7272    if (!pmAstromWriteBilevelMosaic (updates, fpa, NONLIN_TOL)) {
    73         psAbort ("failed to save header terms");
     73        psAbort ("failed to save header terms");
    7474    }
    7575
     
    103103    // is this needed? yes, if we didn't do SingleChip astrometry first
    104104    if (!psastroMosaicSetMatch (fpa, recipe, pass)) {
    105         psError(PSASTRO_ERR_UNKNOWN, false, "failed to match raw and ref stars for mosaic (pass %d)", pass);
    106         return false;
     105        psError(PSASTRO_ERR_UNKNOWN, false, "failed to match raw and ref stars for mosaic (pass %d)", pass);
     106        return false;
    107107    }
    108108
    109     if ((pass == 0) && (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 1)) { 
    110         snprintf (filename, 256, "%s.0.dat", rootname);
    111         psastroDumpMatches (fpa, filename);
     109    if ((pass == 0) && (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 1)) {
     110        snprintf (filename, 256, "%s.0.dat", rootname);
     111        psastroDumpMatches (fpa, filename);
    112112    }
    113113
     
    116116    // then recalculate raw and ref positions
    117117    if (!psastroMosaicCommonScale (fpa, recipe)) {
    118         psError(PSASTRO_ERR_UNKNOWN, false, "failed to set a common scale for the chips (pass %d)", pass);
    119         return false;
     118        psError(PSASTRO_ERR_UNKNOWN, false, "failed to set a common scale for the chips (pass %d)", pass);
     119        return false;
    120120    }
    121121
    122     if ((pass == 0) && (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 1)) { 
    123         snprintf (filename, 256, "%s.1.dat", rootname);
    124         psastroDumpMatches (fpa, filename);
     122    if ((pass == 0) && (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 1)) {
     123        snprintf (filename, 256, "%s.1.dat", rootname);
     124        psastroDumpMatches (fpa, filename);
    125125    }
    126126
     
    129129    // refit the per-chip terms with linear fits only
    130130    if (!psastroMosaicDistortion (fpa, recipe, pass)) {
    131         psError(PSASTRO_ERR_UNKNOWN, false, "failed to measure mosaic gradients (pass %d)", pass);
    132         return false;
     131        psError(PSASTRO_ERR_UNKNOWN, false, "failed to measure mosaic gradients (pass %d)", pass);
     132        return false;
    133133    }
    134134
    135135    snprintf (filename, 256, "%s.%d.dat", rootname, 2*pass + 2);
    136136    if (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 1) { psastroDumpMatches (fpa, filename); }
    137    
     137
    138138    // measure the astrometry for the chips under the distortion term
    139139    if (!psastroMosaicChipAstrom (fpa, recipe, pass)) {
    140         psError(PSASTRO_ERR_UNKNOWN, false, "failed to measure chip astrometry in mosaic mode (pass %d)", pass);
    141         return false;
     140        psError(PSASTRO_ERR_UNKNOWN, false, "failed to measure chip astrometry in mosaic mode (pass %d)", pass);
     141        return false;
    142142    }
    143143
    144     int traceLevel = psTraceGetLevel("psastro.dump.psastroMosaicAstrom");
    145     if (traceLevel > 1) {
    146         snprintf (filename, 256, "%s.%d.dat", rootname, 2*pass + 3);
    147         psastroDumpMatches (fpa, filename);
    148     } else {
    149         snprintf (filename, 256, "%s.dat", rootname);
    150         psastroDumpMatches (fpa, filename);
     144    if (psTraceGetLevel("psastro.dump.psastroMosaicAstrom") > 1) {
     145        snprintf (filename, 256, "%s.%d.dat", rootname, 2*pass + 3);
     146        psastroDumpMatches (fpa, filename);
    151147    }
    152148
Note: See TracChangeset for help on using the changeset viewer.