IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14892


Ignore:
Timestamp:
Sep 19, 2007, 12:04:37 PM (19 years ago)
Author:
Paul Price
Message:

Using newly defined functions that define files based on other files, rather than on an FPA. The FPA doesn't carry the format, while the file does. This was required in order to get psphot to work on a warped image in pswarp --- it didn't know the format, so was attempting to set it to the default which was for the detector camera, not the skycell camera.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotDefineFiles.c

    r14212 r14892  
    1616
    1717    // the output sources are carried on the input->fpa structures
    18     pmFPAfile *outsources = pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT");
     18    pmFPAfile *outsources = pmFPAfileDefineOutputFromFile (config, input, "PSPHOT.OUTPUT");
    1919    if (!outsources) {
    2020        psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.OUTPUT");
     
    2727    if (!psMetadataLookupBool (NULL, recipe, "SAVE.OUTPUT")) {
    2828        pmFPAfileActivate (config->files, false, "PSPHOT.OUTPUT");
    29         outsources->save = false;
     29        outsources->save = false;
    3030    }
    3131
    3232    // optionally save the residual image
    3333    if (psMetadataLookupBool(NULL, recipe, "SAVE.RESID")) {
    34         pmFPAfile *output = pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.RESID");
    35         if (!output) {
     34        pmFPAfile *output = pmFPAfileDefineOutputFromFile (config, input, "PSPHOT.RESID");
     35        if (!output) {
    3636            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.RESID");
    3737            return false;
    3838        }
    39         output->save = true;
     39        output->save = true;
    4040    }
    4141    // optionally save the background model (small FITS image)
     
    4343        int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN");
    4444        int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN");
    45         pmFPAfile *output = pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL");
    46         if (!output) {
     45        pmFPAfile *output = pmFPAfileDefineFromFile (config, input, DX, DY, "PSPHOT.BACKMDL");
     46        if (!output) {
    4747            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL");
    4848            return false;
    4949        }
    50         output->save = true;
     50        output->save = true;
    5151    }
    5252    // optionally save the background model's standard deviation (small FITS image)
     
    5454        int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN");
    5555        int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN");
    56         pmFPAfile *output = pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL.STDEV");
    57         if (!output) {
     56        pmFPAfile *output = pmFPAfileDefineFromFile (config, input, DX, DY, "PSPHOT.BACKMDL.STDEV");
     57        if (!output) {
    5858            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL.STDEV");
    5959            return false;
    6060        }
    61         output->save = true;
     61        output->save = true;
    6262    }
    6363    // optionally save the full background image
    6464    if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKGND")) {
    65         pmFPAfile *output = pmFPAfileDefineFromFPA (config, input->fpa,  1,  1, "PSPHOT.BACKGND");
    66         if (!output) {
     65        pmFPAfile *output = pmFPAfileDefineFromFile (config, input,  1,  1, "PSPHOT.BACKGND");
     66        if (!output) {
    6767            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKGND");
    6868            return false;
    6969        }
    70         output->save = true;
     70        output->save = true;
    7171    }
    7272    // optionally save the background-subtracted image
    7373    if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKSUB")) {
    74         pmFPAfile *output = pmFPAfileDefineFromFPA (config, input->fpa,  1,  1, "PSPHOT.BACKSUB");
    75         if (!output) {
     74        pmFPAfile *output = pmFPAfileDefineFromFile (config, input,  1,  1, "PSPHOT.BACKSUB");
     75        if (!output) {
    7676            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.");
    7777            return false;
    7878        }
    79         output->save = true;
     79        output->save = true;
    8080    }
    8181    // optionally save the PSF Model
    8282    if (psMetadataLookupBool(NULL, recipe, "SAVE.PSF")) {
    83         pmFPAfile *output = pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.PSF.SAVE");
    84         if (!output) {
     83        pmFPAfile *output = pmFPAfileDefineOutputFromFile (config, input, "PSPHOT.PSF.SAVE");
     84        if (!output) {
    8585            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.PSF.SAVE");
    8686            return false;
    8787        }
    88         output->save = true;
     88        output->save = true;
    8989    }
    9090
     
    9292    // allow specific plots only
    9393    if (psMetadataLookupBool(NULL, recipe, "SAVE.PLOTS")) {
    94         pmFPAfile *output = NULL;
    95         output = pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.MOMENTS");
    96         if (!output) {
     94        pmFPAfile *output = NULL;
     95        output = pmFPAfileDefineOutputFromFile (config, input, "SOURCE.PLOT.MOMENTS");
     96        if (!output) {
    9797            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for SOURCE.PLOT.MOMENTS");
    9898            return false;
    9999        }
    100         output->save = true;
    101         output = pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.PSFMODEL");
    102         if (!output) {
     100        output->save = true;
     101        output = pmFPAfileDefineOutputFromFile (config, input, "SOURCE.PLOT.PSFMODEL");
     102        if (!output) {
    103103            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for SOURCE.PLOT.PSFMODEL");
    104104            return false;
    105105        }
    106         output->save = true;
    107         output = pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.APRESID");
    108         if (!output) {
     106        output->save = true;
     107        output = pmFPAfileDefineOutputFromFile (config, input, "SOURCE.PLOT.APRESID");
     108        if (!output) {
    109109            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for SOURCE.PLOT.APRESID");
    110110            return false;
    111111        }
    112         output->save = true;
     112        output->save = true;
    113113    }
    114114
Note: See TracChangeset for help on using the changeset viewer.