IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 11, 2007, 2:01:11 PM (19 years ago)
Author:
eugene
Message:

moved psphot and psastro file defines to ppImageParseCamera, using new
psphotDefineFiles,psastroDefineFiles funcions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageAstrom.c

    r11352 r12807  
    1717    // find or define a pmFPAfile PSPHOT.INPUT
    1818    pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSASTRO.INPUT");
    19     if (!status) {
    20         // psphotReadout requires a pmFPAfile supplied with the name PSASTRO.INPUT
    21         // create a pmFPAfile which points at PSPHOT.OUTPUT
    22         // mode is 'REFERENCE' to prevent double frees of the fpa
    23         pmFPAfile *output = psMetadataLookupPtr (&status, config->files, "PSPHOT.OUTPUT");
    24         input = pmFPAfileDefineInput (config, output->fpa, "PSASTRO.INPUT");
    25         input->mode = PM_FPA_MODE_REFERENCE;
    26 
    27         pmFPAfileDefineOutput (config, input->fpa, "PSASTRO.OUTPUT");
    28     }
     19    PS_ASSERT (input, false);
    2920
    3021    // convert the output sources created by psphot into astrometry objects
    3122    if (!psastroConvertFPA (input->fpa, recipe)) {
    32         psErrorStackPrint(stderr, "error loading input data\n");
    33         exit (1);
     23        psError (PSASTRO_ERR_UNKNOWN, false, "error reading input data\n");
     24        return false;
    3425    }
    3526
    36     // interpret the available initial astrometric information
    37     // apply the initial guess
    38     if (!psastroAstromGuess (config)) {
    39         psErrorStackPrint(stderr, "failed to determine initial astrometry guess\n");
    40         exit (1);
     27    if (!psastroAnalysis (config)) {
     28        psError (PSASTRO_ERR_UNKNOWN, false, "failure in psastro analysis\n");
     29        return false;
    4130    }
    4231
    43     // load the reference stars overlapping the data stars
    44     psArray *refs = psastroLoadRefstars(config);
    45     if (!refs) {
    46         psErrorStackPrint(stderr, "failed to load reference data\n");
    47         exit (1);
    48     }
    49 
    50     if (!psastroChooseRefstars (config, refs)) {
    51         psErrorStackPrint(stderr, "failed to select reference data for chips\n");
    52         exit (1);
    53     }
    54 
    55     // XXX does this check the recipe??
    56     bool chipastro = psMetadataLookupBool (NULL, config->arguments, "PSASTRO.CHIP.MODE");
    57     bool mosastro  = psMetadataLookupBool (NULL, config->arguments, "PSASTRO.MOSAIC.MODE");
    58     if (!chipastro && !mosastro) {
    59         psLogMsg ("psastro", 3, "no astrometry mode selected, assuming chip mode\n");
    60         chipastro= true;
    61     }
    62 
    63     if (chipastro) {
    64       if (!psastroChipAstrom (config, refs)) {
    65             psErrorStackPrint(stderr, "failed to perform single chip astrometry\n");
    66             exit (1);
    67         }
    68     }
    69     if (mosastro) {
    70         if (!psastroMosaicAstrom (config, refs)) {
    71             psErrorStackPrint(stderr, "failed to perform mosaic camera astrometry\n");
    72             exit (1);
    73         }
    74     }
    75 
    76     // XXX should this be left to the ppImageLoop?
    77     psastroDataSave (config);
    78 
    79     psFree (refs);
    8032    return true;
    8133}
Note: See TracChangeset for help on using the changeset viewer.