IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 27, 2007, 5:02:24 PM (19 years ago)
Author:
eugene
Message:

update psphot and psastro in ppImage

File:
1 edited

Legend:

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

    r10439 r11352  
    55# include "ppImage.h"
    66
     7// this function is mostly equivalent to the top-level of psastro, with some
     8// modifications since the data has already been loaded.
    79bool ppImageAstrom (pmConfig *config) {
    810
     
    1618    pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSASTRO.INPUT");
    1719    if (!status) {
    18 
    1920        // psphotReadout requires a pmFPAfile supplied with the name PSASTRO.INPUT
    2021        // create a pmFPAfile which points at PSPHOT.OUTPUT
     
    2728    }
    2829
    29     psastroConvertFPA (input->fpa, recipe);
     30    // convert the output sources created by psphot into astrometry objects
     31    if (!psastroConvertFPA (input->fpa, recipe)) {
     32        psErrorStackPrint(stderr, "error loading input data\n");
     33        exit (1);
     34    }
    3035
    3136    // interpret the available initial astrometric information
    3237    // apply the initial guess
    33     psastroAstromGuess (config);
     38    if (!psastroAstromGuess (config)) {
     39        psErrorStackPrint(stderr, "failed to determine initial astrometry guess\n");
     40        exit (1);
     41    }
    3442
    3543    // load the reference stars overlapping the data stars
    3644    psArray *refs = psastroLoadRefstars(config);
    37 
    38     psastroChooseRefstars(config, refs);
    39 
    40     if (psMetadataLookupBool (NULL, recipe, "ASTROM.CHIP")) {
    41         psastroChipAstrom (config, refs);
    42     }
    43     if (psMetadataLookupBool (NULL, recipe, "ASTROM.MOSAIC")) {
    44         psastroMosaicAstrom (config, refs);
     45    if (!refs) {
     46        psErrorStackPrint(stderr, "failed to load reference data\n");
     47        exit (1);
    4548    }
    4649
     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?
    4777    psastroDataSave (config);
    4878
Note: See TracChangeset for help on using the changeset viewer.