IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6713


Ignore:
Timestamp:
Mar 27, 2006, 4:16:26 PM (20 years ago)
Author:
magnier
Message:

added HDU weights, masks; substantial work on the pmFPAfile,view concepts

Location:
branches/rel10_ifa/psModules/src
Files:
2 deleted
21 edited

Legend:

Unmodified
Added
Removed
  • branches/rel10_ifa/psModules/src/astrom/Makefile.am

    r6673 r6713  
    3535        pmHDUUtils.h \
    3636        pmReadout.h \
    37         psAdditionals.h \
    3837        pmConcepts.h \
    3938        pmConceptsRead.h \
     
    4544#       pmFPAAstrometry.h
    4645#       pmAstrometryObjects.h
    47 #
    4846#       pmChipMosaic.h
  • branches/rel10_ifa/psModules/src/astrom/pmFPA.c

    r6673 r6713  
    1212* XXX: Should we implement non-linear cell->chip transforms?
    1313*
    14 *  @version $Revision: 1.1.4.4 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2006-03-23 03:09:57 $
     14*  @version $Revision: 1.1.4.5 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2006-03-28 02:16:26 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    255255        cell->readouts = psArrayAdd(cell->readouts, 1, (psPtr) tmpReadout);
    256256    }
     257
     258    tmpReadout->process = true;            // All cells are processed by default
     259    tmpReadout->file_exists = false;       // file not yet identified
     260    tmpReadout->data_exists = false;       // data yet read in
     261
    257262    psMemSetDeallocator(tmpReadout, (psFreeFunc) readoutFree);
    258263    return(tmpReadout);
     
    287292    }
    288293    tmpCell->process = true;            // All cells are processed by default
    289     tmpCell->exists = false;            // Not yet read in
     294    tmpCell->file_exists = false;       // Not yet identified
     295    tmpCell->data_exists = false;       // Not yet read in
    290296    tmpCell->hdu = NULL;
    291297
     
    331337    }
    332338    tmpChip->process = true;            // Work on all chips, by default
    333     tmpChip->exists = false;            // Not read in yet
     339    tmpChip->file_exists = false;       // Not yet identified
     340    tmpChip->data_exists = false;       // Not yet read in
    334341    tmpChip->hdu = NULL;
    335342
     
    421428}
    422429
    423 
     430/** functions to turn on/off the file_exists flag **/
     431bool pmFPASetFileStatus (pmFPA *fpa, bool status)
     432{
     433
     434    for (int i = 0; i < fpa->chips->n; i++) {
     435        pmChip *chip = fpa->chips->data[i];
     436        pmChipSetFileStatus (chip, status);
     437    }
     438    return true;
     439}
     440
     441bool pmChipSetFileStatus (pmChip *chip, bool status)
     442{
     443
     444    chip->file_exists = status;
     445    for (int i = 0; i < chip->cells->n; i++) {
     446        pmCell *cell = chip->cells->data[i];
     447        pmCellSetFileStatus (cell, status);
     448    }
     449    return true;
     450}
     451
     452bool pmCellSetFileStatus (pmCell *cell, bool status)
     453{
     454
     455    cell->file_exists = status;
     456    for (int i = 0; i < cell->readouts->n; i++) {
     457        pmReadout *readout = cell->readouts->data[i];
     458        readout->file_exists = status;
     459    }
     460    return true;
     461}
     462
     463/** functions to turn on/off the data_exists flag **/
     464bool pmFPASetDataStatus (pmFPA *fpa, bool status)
     465{
     466
     467    for (int i = 0; i < fpa->chips->n; i++) {
     468        pmChip *chip = fpa->chips->data[i];
     469        pmChipSetDataStatus (chip, status);
     470    }
     471    return true;
     472}
     473
     474bool pmChipSetDataStatus (pmChip *chip, bool status)
     475{
     476
     477    chip->data_exists = status;
     478    for (int i = 0; i < chip->cells->n; i++) {
     479        pmCell *cell = chip->cells->data[i];
     480        pmCellSetDataStatus (cell, status);
     481    }
     482    return true;
     483}
     484
     485bool pmCellSetDataStatus (pmCell *cell, bool status)
     486{
     487
     488    cell->data_exists = status;
     489    for (int i = 0; i < cell->readouts->n; i++) {
     490        pmReadout *readout = cell->readouts->data[i];
     491        readout->data_exists = status;
     492    }
     493    return true;
     494}
    424495
    425496/*****************************************************************************
  • branches/rel10_ifa/psModules/src/astrom/pmFPA.h

    r6673 r6713  
    77*  @author GLG, MHPCC
    88*
    9 *  @version $Revision: 1.1.4.4 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2006-03-23 03:09:57 $
     9*  @version $Revision: 1.1.4.5 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2006-03-28 02:16:26 $
    1111*
    1212*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    8888    pmFPA *parent;                      ///< Parent FPA
    8989    bool process;                       ///< Do we bother about reading and working with this chip?
    90     bool exists;                        ///< Does the chip exist --- has it been read in?
     90    bool file_exists;                   ///< Does the file for this chip exist (read case only)?
     91    bool data_exists;                   ///< Does the data for this chip exist (read case only)?
    9192    pmHDU *hdu;                         ///< FITS data
    9293}
     
    110111    pmChip *parent;                     ///< Parent chip
    111112    bool process;                       ///< Do we bother about reading and working with this cell?
    112     bool exists;                        ///< Does the cell exist --- has it been read in?
     113    bool file_exists;                   ///< Does the file for this cell exist (read case only)?
     114    bool data_exists;                   ///< Does the data for this cell exist (read case only)?
    113115    pmHDU *hdu;                         ///< FITS data
    114116}
     
    133135    psMetadata *analysis;               ///< Readout-level analysis metadata
    134136    pmCell *parent;                     ///< Parent cell
     137    bool process;                       ///< Do we bother about reading and working with this readout?
     138    bool file_exists;                   ///< Does the file for this readout exist (read case only)?
     139    bool data_exists;                   ///< Does the data for this readout exist (read case only)?
    135140}
    136141pmReadout;
     
    207212);
    208213
    209 
     214/* functions to turn on/off the file_exists flags */
     215bool pmFPASetFileStatus (pmFPA *fpa, bool status);
     216bool pmChipSetFileStatus (pmChip *chip, bool status);
     217bool pmCellSetFileStatus (pmCell *cell, bool status);
     218
     219/* functions to turn on/off the data_exists flags */
     220bool pmFPASetDataStatus (pmFPA *fpa, bool status);
     221bool pmChipSetDataStatus (pmChip *chip, bool status);
     222bool pmCellSetDataStatus (pmCell *cell, bool status);
    210223
    211224/** FUNC DESC
  • branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c

    r6673 r6713  
    184184    view->cell = -1;
    185185    view->readout = -1;
    186     view->fpa = psMemIncrRefCounter(fpa);
    187186    if (strcasecmp(phuType, "FPA") == 0) {
    188187        if (fpa->hdu) {
     
    194193        fpa->hdu = phdu;
    195194        pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_HEADER, NULL);
     195        pmFPASetFileStatus (fpa, true);
    196196    } else {
    197197        // Get the chip
     
    215215            chip->hdu = phdu;
    216216            pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_HEADER, true, NULL);
     217            pmChipSetFileStatus (chip, true);
    217218        } else if (strcasecmp(phuType, "CELL") == 0) {
    218219            psError(PS_ERR_IO, true, "Not yet sure how to handle PHU=CELL.\n");
     
    239240            cell->hdu = phdu;
    240241            pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER, true, NULL);
     242            pmCellSetFileStatus (cell, true);
    241243            #endif
    242244
  • branches/rel10_ifa/psModules/src/astrom/pmFPARead.c

    r6671 r6713  
    88#include "pmConcepts.h"
    99#include "psRegionIsBad.h"
     10#include "pmHDUUtils.h"
    1011
    1112//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    107108    }
    108109
     110    pmCellSetDataStatus (cell, true);
    109111    return true;
    110112}
     
    124126    if (success) {
    125127        pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_HEADER, false, NULL);
     128        // XXX probably could just use chip->data_exists
     129        pmChipSetDataStatus (chip, true);
    126130    }
    127131
     
    379383    for (int chipNum = 0; chipNum < chips->n; chipNum++) {
    380384        pmChip *chip = chips->data[chipNum]; // The current chip of interest
    381         if (chip->process && !chip->exists) {
     385        if (chip->process && !chip->data_exists) {
    382386            if (chip->hdu) {
    383387                hdu = chip->hdu;
     
    386390            for (int cellNum = 0; cellNum < cells->n; cellNum++) {
    387391                pmCell *cell = cells->data[cellNum]; // The current cell of interest
    388                 if (cell->process && !cell->exists) {
     392                if (cell->process && !cell->data_exists) {
    389393                    if (cell->hdu) {
    390394                        hdu = cell->hdu;
     
    517521    for (int chipNum = 0; chipNum < chips->n; chipNum++) {
    518522        pmChip *chip = chips->data[chipNum]; // The current chip of interest
    519         if (chip->process && !chip->exists) {
     523        if (chip->process && !chip->data_exists) {
    520524            if (chip->hdu) {
    521525                hdu = chip->hdu;
     
    524528            for (int cellNum = 0; cellNum < cells->n; cellNum++) {
    525529                pmCell *cell = cells->data[cellNum]; // The current cell of interest
    526                 if (cell->process && !cell->exists) {
     530                if (cell->process && !cell->data_exists) {
    527531                    if (cell->hdu) {
    528532                        hdu = cell->hdu;
  • branches/rel10_ifa/psModules/src/astrom/pmFPAfile.c

    r6573 r6713  
    1616        return;
    1717
    18     psFree (file->fits);
     18    psFree (file->fpa);
     19    psFree (file->names);
     20
     21    psFitsClose (file->fits);
     22
    1923    psFree (file->filerule);
    2024    psFree (file->filextra);
    2125    psFree (file->extrule);
    2226    psFree (file->extxtra);
    23     psFree (file->filename);
    24     psFree (file->extname);
     27
     28    // these are just views:
     29    // psFree (file->filename);
     30    // psFree (file->extname);
     31    // psFree (file->phu);
     32    // psFree (file->header);
     33
    2534    return;
    2635}
     
    3241    psMemSetDeallocator (file, (psFreeFunc) pmFPAfileFree);
    3342
     43    file->phu = NULL;
     44    file->header = NULL;
     45
     46    file->fpa = NULL;
    3447    file->fits = NULL;
     48    file->names = psMetadataAlloc();
     49
    3550    file->filerule = NULL;
    3651    file->filextra = NULL;
    3752    file->extrule  = NULL;
    3853    file->extxtra  = NULL;
     54
    3955    file->filename = NULL;
    4056    file->extname  = NULL;
     57
     58    file->type = PM_FPA_FILE_NONE;
     59    file->mode = PM_FPA_MODE_NONE;
     60    file->state = PM_FPA_STATE_CLOSED;
     61
    4162    return (file);
    4263}
    4364
    4465// XXX is a file allowed to be both READ and WRITE?
    45 pmFPAfile *pmFPAfileDefine (psMetadata *files, psMetadata *camera, pmFPA *fpa, char *name)
     66pmFPAfile *pmFPAfileDefine (psMetadata *files, psMetadata *format, pmFPA *fpa, char *name)
    4667{
    4768
    4869    bool status;
    4970    char *depth;
    50 
    51     // select the name from the camera config data
    52     psMetadata *data = psMetadataLookupPtr (&status, camera, name);
     71    char *type;
     72
     73    // select the FILERULES from the camera format
     74    psMetadata *filerules = psMetadataLookupPtr (&status, format, "FILERULES");
     75    if (filerules == NULL) {
     76        psErrorStackPrint(stderr, "Can't find FILERULES in the FORMAT configuration!\n");
     77        return NULL;
     78    }
     79
     80    // select the name from the FILERULES
     81    // check for indirect name (type == STR, name is aliased name)
     82    char *realname = psMetadataLookupStr (&status, filerules, name);
     83    if (realname == NULL)
     84        realname = name;
     85
     86    psMetadata *data = psMetadataLookupPtr (&status, filerules, realname);
    5387    if (data == NULL) {
     88        psErrorStackPrint(stderr, "Can't find file concept %s!\n", name);
    5489        return NULL;
    5590    }
    5691
    5792    pmFPAfile *file = pmFPAfileAlloc ();
    58     file->filerule = psMetadataLookupStr (&status, data, "FILENAME.RULE");
    59     file->filextra = psMetadataLookupStr (&status, data, "FILENAME.XTRA");
    60     file->extrule  = psMetadataLookupStr (&status, data, "EXTNAME.RULE");
    61     file->extxtra  = psMetadataLookupStr (&status, data, "EXTNAME.XTRA");
    62 
    63     file->openDepth = PM_FPA_DEPTH_NONE;
    64     depth = psMetadataLookupStr (&status, data, "OPEN.DEPTH");
     93    file->filerule = psMemIncrRefCounter(psMetadataLookupStr (&status, data, "FILENAME.RULE"));
     94    file->filextra = psMemIncrRefCounter(psMetadataLookupStr (&status, data, "FILENAME.XTRA"));
     95    file->extrule  = psMemIncrRefCounter(psMetadataLookupStr (&status, data, "EXTNAME.RULE"));
     96    file->extxtra  = psMemIncrRefCounter(psMetadataLookupStr (&status, data, "EXTNAME.XTRA"));
     97
     98    file->fileDepth = PM_FPA_DEPTH_NONE;
     99    depth = psMetadataLookupStr (&status, data, "FILE.DEPTH");
    65100    if (depth != NULL) {
    66101        if (!strcasecmp (depth, "FPA"))     {
    67             file->openDepth = PM_FPA_DEPTH_FPA;
     102            file->fileDepth = PM_FPA_DEPTH_FPA;
    68103        }
    69104        if (!strcasecmp (depth, "CHIP"))    {
    70             file->openDepth = PM_FPA_DEPTH_CHIP;
     105            file->fileDepth = PM_FPA_DEPTH_CHIP;
    71106        }
    72107        if (!strcasecmp (depth, "CELL"))    {
    73             file->openDepth = PM_FPA_DEPTH_CELL;
     108            file->fileDepth = PM_FPA_DEPTH_CELL;
    74109        }
    75110        if (!strcasecmp (depth, "READOUT")) {
    76             file->openDepth = PM_FPA_DEPTH_READOUT;
    77         }
    78     }
    79 
    80     file->readDepth = PM_FPA_DEPTH_NONE;
    81     depth = psMetadataLookupStr (&status, data, "READ.DEPTH");
     111            file->fileDepth = PM_FPA_DEPTH_READOUT;
     112        }
     113    }
     114    if (file->fileDepth == PM_FPA_DEPTH_NONE) {
     115        psLogMsg (__func__, 3, "warning: FILE.DEPTH is not set for %s\n", name);
     116    }
     117
     118    file->dataDepth = PM_FPA_DEPTH_NONE;
     119    depth = psMetadataLookupStr (&status, data, "DATA.DEPTH");
    82120    if (depth != NULL) {
    83121        if (!strcasecmp (depth, "FPA"))     {
    84             file->readDepth = PM_FPA_DEPTH_FPA;
     122            file->dataDepth = PM_FPA_DEPTH_FPA;
    85123        }
    86124        if (!strcasecmp (depth, "CHIP"))    {
    87             file->readDepth = PM_FPA_DEPTH_CHIP;
     125            file->dataDepth = PM_FPA_DEPTH_CHIP;
    88126        }
    89127        if (!strcasecmp (depth, "CELL"))    {
    90             file->readDepth = PM_FPA_DEPTH_CELL;
     128            file->dataDepth = PM_FPA_DEPTH_CELL;
    91129        }
    92130        if (!strcasecmp (depth, "READOUT")) {
    93             file->readDepth = PM_FPA_DEPTH_READOUT;
    94         }
    95     }
    96 
    97     file->writeDepth = PM_FPA_DEPTH_NONE;
    98     depth = psMetadataLookupStr (&status, data, "WRITE.DEPTH");
    99     if (depth != NULL) {
    100         if (!strcasecmp (depth, "FPA"))     {
    101             file->writeDepth = PM_FPA_DEPTH_FPA;
    102         }
    103         if (!strcasecmp (depth, "CHIP"))    {
    104             file->writeDepth = PM_FPA_DEPTH_CHIP;
    105         }
    106         if (!strcasecmp (depth, "CELL"))    {
    107             file->writeDepth = PM_FPA_DEPTH_CELL;
    108         }
    109         if (!strcasecmp (depth, "READOUT")) {
    110             file->writeDepth = PM_FPA_DEPTH_READOUT;
    111         }
    112     }
    113 
    114     if ((file->readDepth != PM_FPA_DEPTH_NONE) && (file->writeDepth != PM_FPA_DEPTH_NONE)) {
    115         psLogMsg (__func__, 3, "warning: file %s is set to both read and write; write is ignored\n", name);
    116         file->writeDepth = PM_FPA_DEPTH_NONE;
    117     }
    118 
    119     if (fpa == NULL) {
    120         fpa = pmFPAConstruct (camera);
    121     }
    122     file->fpa = fpa;
    123 
    124     psMetadataAddPtr (files, PS_LIST_TAIL, name, PS_META_REPLACE, "", file);
     131            file->dataDepth = PM_FPA_DEPTH_READOUT;
     132        }
     133    }
     134    if (file->dataDepth == PM_FPA_DEPTH_NONE) {
     135        psLogMsg (__func__, 3, "warning: DATA.DEPTH is not set for %s\n", name);
     136    }
     137
     138    file->type = PM_FPA_FILE_NONE;
     139    type = psMetadataLookupStr (&status, data, "FILE.TYPE");
     140    if (type != NULL) {
     141        if (!strcasecmp (type, "SX"))     {
     142            file->type = PM_FPA_FILE_SX;
     143        }
     144        if (!strcasecmp (type, "OBJ"))     {
     145            file->type = PM_FPA_FILE_OBJ;
     146        }
     147        if (!strcasecmp (type, "CMP"))     {
     148            file->type = PM_FPA_FILE_CMP;
     149        }
     150        if (!strcasecmp (type, "CMF"))     {
     151            file->type = PM_FPA_FILE_CMF;
     152        }
     153        if (!strcasecmp (type, "RAW"))     {
     154            file->type = PM_FPA_FILE_RAW;
     155        }
     156        if (!strcasecmp (type, "IMAGE"))     {
     157            file->type = PM_FPA_FILE_IMAGE;
     158        }
     159    }
     160    if (file->type == PM_FPA_FILE_NONE) {
     161        psLogMsg (__func__, 3, "warning: FILE.TYPE is not defined for %s\n", name);
     162    }
     163
     164    file->mode = PM_FPA_MODE_NONE;
     165    type = psMetadataLookupStr (&status, data, "FILE.MODE");
     166    if (type != NULL) {
     167        if (!strcasecmp (type, "READ"))     {
     168            file->mode = PM_FPA_MODE_READ;
     169        }
     170        if (!strcasecmp (type, "WRITE"))     {
     171            file->mode = PM_FPA_MODE_WRITE;
     172        }
     173    }
     174    if (file->mode == PM_FPA_MODE_NONE) {
     175        psLogMsg (__func__, 3, "warning: FILE.MODE is not defined for %s\n", name);
     176    }
     177
     178    file->fpa = psMemIncrRefCounter(fpa);
     179
     180    psMetadataAddPtr (files, PS_LIST_TAIL, name, PS_DATA_UNKNOWN, "", file);
     181
     182    // we free this copy of file, but 'files' still has a copy
     183    psFree (file);
     184
     185    // the returned value is a view into the version on 'files'
    125186    return (file);
    126187}
    127188
     189pmFPAfile *pmFPAfileConstruct (psMetadata *files, psMetadata *format, psMetadata *camera, char *name)
     190{
     191    pmFPA *fpa = pmFPAConstruct (camera);
     192    pmFPAfile *file = pmFPAfileDefine (files, format, fpa, name);
     193    psFree (fpa);
     194    return file;
     195}
     196
     197// open file (if not already opened XXX : better tracking of open state?
    128198bool pmFPAfileOpen (pmFPAfile *file, pmFPAview *view)
    129199{
     
    131201    bool status;
    132202    char *extra;
    133 
    134     // is current depth == open depth?
    135     pmFPAdepth depth = pmFPAviewDepth (view);
    136     if (file->openDepth != depth) {
    137         return false;
     203    char *mode;
     204    char *readMode = "r";
     205    char *writeMode = "w";
     206
     207    if (file->mode == PM_FPA_MODE_NONE) {
     208        return false;
     209    }
     210    if (file->mode == PM_FPA_MODE_READ) {
     211        mode = readMode;
     212    }
     213    if (file->mode == PM_FPA_MODE_WRITE) {
     214        mode = writeMode;
     215    }
     216
     217    if (file->state == PM_FPA_STATE_OPEN) {
     218        return true;
    138219    }
    139220
    140221    // determine the file name
    141     file->filename = pmFPAviewNameFromRule (file->filerule, view, file->fpa);
     222    // XXX file->filename needs to be a copy, and freed in places like this...
     223    file->filename = pmFPAfileNameFromRule (file->filerule, file, view);
     224    if (file->filename == NULL)
     225        return false;
    142226
    143227    // indirect filenames
    144228    if (!strcasecmp (file->filename, "@FPAIO")) {
    145         extra = pmFPAviewNameFromRule (file->filextra, view, file->fpa);
     229        extra = pmFPAfileNameFromRule (file->filextra, file, view);
    146230        file->filename = psMetadataLookupStr (&status, file->names, extra);
     231        if (file->filename == NULL)
     232            return false;
    147233    }
    148234    if (!strcasecmp (file->filename, "@DETDB")) {
    149         extra = pmFPAviewNameFromRule (file->filextra, view, file->fpa);
     235        extra = pmFPAfileNameFromRule (file->filextra, file, view);
    150236        // file->filename = pmDetrendSelect (extra);
    151     }
    152 
    153     if (file->readDepth != PM_FPA_DEPTH_NONE) {
    154         file->fits = psFitsOpen (file->filename, "r");
    155     } else if (file->writeDepth != PM_FPA_DEPTH_NONE) {
    156         file->fits = psFitsOpen (file->filename, "w");
     237        if (file->filename == NULL)
     238            return false;
     239    }
     240
     241    switch (file->type) {
     242        // open the FITS types:
     243    case PM_FPA_FILE_IMAGE:
     244    case PM_FPA_FILE_CMF:
     245        file->fits = psFitsOpen (file->filename, mode);
     246        psTrace ("pmFPAfile", 5, "opening %s (type: %d)\n", file->filename, file->type);
     247        file->state = PM_FPA_STATE_OPEN;
     248        break;
     249
     250        // defer opening TEXT types:
     251    case PM_FPA_FILE_SX:
     252    case PM_FPA_FILE_OBJ:
     253    case PM_FPA_FILE_CMP:
     254    case PM_FPA_FILE_RAW:
     255        psTrace ("pmFPAfile", 5, "not opening %s (type: %d)\n", file->filename, file->type);
     256        break;
     257
     258    default:
     259        fprintf (stderr, "warning: type mismatch for %s : %d\n", file->filename, file->type);
     260        return false;
    157261    }
    158262    return true;
     
    161265bool pmFPAfileRead (pmFPAfile *file, pmFPAview *view)
    162266{
    163 
    164     // is current depth == open depth?
     267    if (file->mode != PM_FPA_MODE_READ)
     268        return false;
     269
     270    // get the current depth
    165271    pmFPAdepth depth = pmFPAviewDepth (view);
    166     if (file->readDepth != depth) {
    167         return false;
    168     }
    169 
    170     if (file->readDepth == PM_FPA_DEPTH_NONE) {
    171         return false;
    172     }
     272
     273    // do we need to open this file?
     274    if (depth == file->fileDepth) {
     275        pmFPAfileOpen (file, view);
     276    }
     277
     278    // do we need to read this file?
     279    if (depth != file->dataDepth)
     280        return false;
    173281
    174282    switch (file->type) {
    175283    case PM_FPA_FILE_IMAGE:
    176         pmFPAviewReadFitsImage (view, file);
     284        if (pmFPAviewReadFitsImage (view, file)) {
     285            psTrace ("pmFPAfile", 5, "reading %s (type: %d)\n", file->filename, file->type);
     286        } else {
     287            psTrace ("pmFPAfile", 5, "skipping %s (type: %d)\n", file->filename, file->type);
     288        }
    177289        break;
    178290
    179291    case PM_FPA_FILE_SX:
     292    case PM_FPA_FILE_RAW:
    180293    case PM_FPA_FILE_OBJ:
    181294    case PM_FPA_FILE_CMP:
    182295    case PM_FPA_FILE_CMF:
    183296        pmFPAviewReadObjects (view, file);
     297        psTrace ("pmFPAfile", 5, "reading %s (type: %d)\n", file->filename, file->type);
    184298        break;
    185299
     
    193307bool pmFPAfileWrite (pmFPAfile *file, pmFPAview *view)
    194308{
    195 
    196     // is current depth == open depth?
     309    if (file->mode != PM_FPA_MODE_WRITE)
     310        return false;
     311
     312    // get the current depth
    197313    pmFPAdepth depth = pmFPAviewDepth (view);
    198     if (file->writeDepth != depth) {
    199         return false;
    200     }
    201 
    202     if (file->writeDepth == PM_FPA_DEPTH_NONE) {
    203         return false;
     314
     315    // do we need to write this file?
     316    if (depth != file->dataDepth)
     317        return false;
     318
     319    // do we need to open this file?
     320    if (depth >= file->fileDepth) {
     321        pmFPAfileOpen (file, view);
    204322    }
    205323
     
    212330
    213331    case PM_FPA_FILE_SX:
     332    case PM_FPA_FILE_RAW:
    214333    case PM_FPA_FILE_OBJ:
    215334    case PM_FPA_FILE_CMP:
    216335    case PM_FPA_FILE_CMF:
    217336        pmFPAviewWriteObjects (view, file);
     337        psTrace ("pmFPAfile", 5, "wrote %s (type: %d)\n", file->filename, file->type);
    218338        break;
    219339
     
    227347bool pmFPAfileClose (pmFPAfile *file, pmFPAview *view)
    228348{
     349    if (file->state == PM_FPA_STATE_CLOSED) {
     350        return true;
     351    }
     352
    229353    // is current depth == open depth?
    230354    pmFPAdepth depth = pmFPAviewDepth (view);
    231     if (file->openDepth != depth) {
     355    if (file->fileDepth != depth) {
    232356        return false;
    233357    }
    234358
    235359    // check if we are actually open
    236     psFitsClose (file->fits);
    237     return true;
    238 }
    239 
    240 // attempt open and read for all pmFPAfiles in view->IO
    241 bool pmFPAfileReadChecks (psMetadata *files, pmFPAview *view)
     360    switch (file->type) {
     361        // check the FITS types
     362    case PM_FPA_FILE_IMAGE:
     363    case PM_FPA_FILE_CMF:
     364        psFitsClose (file->fits);
     365        psTrace ("pmFPAfile", 5, "closing %s (type: %d)\n", file->filename, file->type);
     366        file->fits = NULL;
     367        file->phu = NULL;
     368        file->header = NULL;
     369        file->state = PM_FPA_STATE_CLOSED;
     370        break;
     371
     372        // ignore the TEXT types
     373    case PM_FPA_FILE_SX:
     374    case PM_FPA_FILE_RAW:
     375    case PM_FPA_FILE_OBJ:
     376    case PM_FPA_FILE_CMP:
     377        break;
     378
     379    default:
     380        fprintf (stderr, "warning: type mismatch\n");
     381        return false;
     382    }
     383    return true;
     384}
     385
     386// attempt open, read, write, or close pmFPAfiles in files
     387bool pmFPAfileIOChecks (psMetadata *files, pmFPAview *view, pmFPAfilePlace place)
    242388{
    243389    // recipe override values (command-line options):
     
    247393        pmFPAfile *file = item->data.V;
    248394
    249         pmFPAfileOpen (file, view);
    250         pmFPAfileRead (file, view);
     395        if (place == PM_FPA_BEFORE) {
     396            pmFPAfileRead (file, view);
     397        } else {
     398            pmFPAfileWrite (file, view);
     399            pmFPAfileClose (file, view);
     400        }
    251401    }
    252402    psFree (iter);
     
    254404}
    255405
    256 // attempt open and read for all pmFPAfiles in view->IO
    257 bool pmFPAfileWriteChecks (psMetadata *files, pmFPAview *view)
    258 {
    259     // recipe override values (command-line options):
    260     psMetadataItem *item = NULL;
    261     psMetadataIterator *iter = psMetadataIteratorAlloc (files, PS_LIST_HEAD, NULL);
    262     while ((item = psMetadataGetAndIncrement (iter)) != NULL) {
    263         pmFPAfile *file = item->data.V;
    264 
    265         pmFPAfileWrite (file, view);
    266         pmFPAfileClose (file, view);
    267     }
    268     psFree (iter);
    269     return true;
     406// select the rule from the camera configuration, perform substitutions as needed
     407char *pmFPAfileNameFromRule (char *rule, pmFPAfile *file, pmFPAview *view)
     408{
     409
     410    char *newName = NULL;     // destination for resulting name
     411
     412    newName = psStringCopy (rule);
     413
     414    if (strstr (newName, "{CHIP.NAME}") != NULL) {
     415        pmChip *chip = pmFPAviewThisChip (view, file->fpa);
     416        if (chip != NULL) {
     417            char *name = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME");
     418            if (name != NULL) {
     419                newName = psStringSubstitute (newName, name, "{CHIP.NAME}");
     420            }
     421        }
     422    }
     423    if (strstr (newName, "{CELL.NAME}") != NULL) {
     424        pmCell *cell = pmFPAviewThisCell (view, file->fpa);
     425        if (cell != NULL) {
     426            char *name = psMetadataLookupStr (NULL, cell->concepts, "CELL.NAME");
     427            if (name != NULL) {
     428                newName = psStringSubstitute (newName, name, "{CELL.NAME}");
     429            }
     430        }
     431    }
     432    if (strstr (newName, "{EXTNAME}") != NULL) {
     433        pmHDU *hdu = pmFPAviewThisHDU (view, file->fpa);
     434        if (hdu->extname != NULL) {
     435            newName = psStringSubstitute (newName, hdu->extname, "{EXTNAME}");
     436        }
     437    }
     438    if (strstr (newName, "{OUTPUT}") != NULL) {
     439        char *name = psMetadataLookupStr (NULL, file->names, "OUTPUT");
     440        if (name != NULL) {
     441            newName = psStringSubstitute (newName, name, "{OUTPUT}");
     442        }
     443    }
     444    return newName;
    270445}
    271446
     
    299474}
    300475
    301 # if (0)
    302     // return the named pmFPAfile
    303     pmFPAfile *pmFPAfileSelect (pmFPAview *view, char *name)
    304 {
    305 
    306     // select the name from the camera config data
    307     pmFPAfile *file = psMetadataLookupPtr (&status, view->IO, name);
    308     if (file == NULL) {
    309         return NULL;
    310     }
    311     return file;
    312 }
    313 
    314 bool pmFPAfileWriteChecks (pmFPAview *view, char *name)
    315 {
    316 
    317     pmFPAfile *file = pmFPAfileSelect (view, name);
    318     pmFPAfileWrite (file, view);
    319     return true;
    320 }
    321 #endif
    322 
    323476// given an already-opened fits file, read the components corresponding
    324477// to the specified view
    325478bool pmFPAviewReadFitsImage (pmFPAview *view, pmFPAfile *file)
    326479{
     480    bool status;
    327481    pmFPA *fpa = file->fpa;
    328482    psFits *fits = file->fits;
    329483
    330484    if (view->chip == -1) {
    331         pmFPARead (fpa, fits, NULL);
    332         return true;
     485        status = pmFPARead (fpa, fits, NULL);
     486        return status;
    333487    }
    334488
     
    339493
    340494    if (view->cell == -1) {
    341         pmChipRead (chip, fits, NULL);
    342         return true;
     495        status = pmChipRead (chip, fits, NULL);
     496        return status;
    343497    }
    344498
     
    349503
    350504    if (view->readout == -1) {
    351         pmCellRead (cell, fits, NULL);
    352         return true;
     505        status = pmCellRead (cell, fits, NULL);
     506        return status;
    353507    }
    354508
  • branches/rel10_ifa/psModules/src/astrom/pmFPAfile.h

    r6580 r6713  
    77*  @author EAM, IfA
    88*
    9 *  @version $Revision: 1.1.2.6 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2006-03-14 04:40:37 $
     9*  @version $Revision: 1.1.2.7 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2006-03-28 02:16:26 $
    1111*
    1212*  Copyright 2004-2005 Institute for Astronomy, University of Hawaii
     
    2121
    2222typedef enum {
     23    PM_FPA_BEFORE,
     24    PM_FPA_AFTER,
     25} pmFPAfilePlace;
     26
     27typedef enum {
     28    PM_FPA_FILE_NONE,
    2329    PM_FPA_FILE_SX,
    2430    PM_FPA_FILE_OBJ,
     
    2935} pmFPAfileType;
    3036
     37typedef enum {
     38    PM_FPA_MODE_NONE,
     39    PM_FPA_MODE_READ,
     40    PM_FPA_MODE_WRITE,
     41} pmFPAfileMode;
     42
     43typedef enum {
     44    PM_FPA_STATE_OPEN,
     45    PM_FPA_STATE_CLOSED,
     46} pmFPAfileState;
     47
    3148typedef struct
    3249{
    33     pmFPAdepth openDepth;
    34     pmFPAdepth readDepth;
    35     pmFPAdepth writeDepth;
     50    pmFPAdepth fileDepth;
     51    pmFPAdepth dataDepth;
    3652
     53    psMetadata *phu;
     54    psMetadata *header;
     55
     56    pmFPA *fpa;
    3757    psFits *fits;
     58    psMetadata *names;
     59
    3860    char *filerule;
    3961    char *filextra;
     
    4567
    4668    pmFPAfileType type;
    47 
    48     psMetadata *names;
    49     pmFPA *fpa;
     69    pmFPAfileMode mode;
     70    pmFPAfileState state;
    5071}
    5172pmFPAfile;
     
    5980
    6081bool pmFPAfileReadChecks (psMetadata *files, pmFPAview *view);
    61 bool pmFPAfileWriteChecks (psMetadata *files, pmFPAview *view);
     82bool pmFPAfileIOChecks (psMetadata *files, pmFPAview *view, pmFPAfilePlace place);
    6283
    6384psImage *pmFPAfileReadoutImage (psMetadata *files, pmFPAview *view, char *name, int Nx, int Ny, int type);
     
    6990bool pmFPAviewWriteFitsImage (pmFPAview *view, pmFPAfile *file);
    7091
     92// convert the rule to a name based on the current view
     93char *pmFPAfileNameFromRule (char *rule, pmFPAfile *file, pmFPAview *view);
     94
     95pmFPAfile *pmFPAfileConstruct (psMetadata *files, psMetadata *format, psMetadata *camera, char *name);
     96
    7197# endif
  • branches/rel10_ifa/psModules/src/astrom/pmFPAview.c

    r6573 r6713  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.1.2.4 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-03-14 02:21:07 $
     5 *  @version $Revision: 1.1.2.5 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-03-28 02:16:26 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1515#include "pslib.h"
    1616#include "pmHDU.h"
     17#include "pmHDUUtils.h"
    1718#include "pmFPA.h"
    1819#include "pmFPAview.h"
     
    212213pmHDU *pmFPAviewThisHDU (pmFPAview *view, pmFPA *fpa)
    213214{
    214 
    215215    // the HDU is attached to a cell, chip or fpa
    216216    // if this view has a -1 for the level which contains the hdu,
     
    229229}
    230230
    231 // select the rule from the camera configuration, perform substitutions as needed
    232 char *pmFPAviewNameFromRule (char *rule, pmFPAview *view, pmFPA *fpa)
    233 {
    234 
    235     char *newName = NULL;     // destination for resulting name
    236 
    237     newName = psStringCopy (rule);
    238 
    239     if (strstr (newName, "{CHIP.NAME}") != NULL) {
    240         pmChip *chip = pmFPAviewThisChip (view, fpa);
    241         if (chip != NULL) {
    242             char *name = psMetadataLookupStr (NULL, chip->concepts, "CHIP.NAME");
    243             if (name != NULL) {
    244                 newName = psStringSubstitute (newName, name, "{CHIP.NAME}");
    245             }
    246         }
    247     }
    248     if (strstr (newName, "{CELL.NAME}") != NULL) {
    249         pmCell *cell = pmFPAviewThisCell (view, fpa);
    250         if (cell != NULL) {
    251             char *name = psMetadataLookupStr (NULL, cell->concepts, "CELL.NAME");
    252             if (name != NULL) {
    253                 newName = psStringSubstitute (newName, name, "{CELL.NAME}");
    254             }
    255         }
    256     }
    257     if (strstr (newName, "{EXTNAME}") != NULL) {
    258         pmHDU *hdu = pmFPAviewThisHDU (view, fpa);
    259         if (hdu->extname != NULL) {
    260             newName = psStringSubstitute (newName, hdu->extname, "{EXTNAME}");
    261         }
    262     }
    263     return newName;
    264 }
     231pmHDU *pmFPAviewThisPHU (pmFPAview *view, pmFPA *fpa)
     232{
     233    // select the HDU which corresponds to the PHU containing this view
     234
     235    pmHDU *hdu;
     236    pmFPAview *new;
     237    pmChip *chip;
     238    pmCell *cell;
     239
     240    *new = *view;
     241
     242    if (view->chip < 0) {
     243        hdu = pmHDUFromFPA (fpa);
     244        if (hdu->phu)
     245            return hdu;
     246        return NULL;
     247    }
     248    if (view->cell < 0) {
     249        chip = pmFPAviewThisChip (view, fpa);
     250        hdu  = pmHDUFromChip (chip);
     251        if (hdu->phu)
     252            return hdu;
     253        new->chip = -1;
     254        hdu = pmFPAviewThisPHU (new, fpa);
     255        return hdu;
     256    }
     257    if (view->readout < 0) {
     258        cell = pmFPAviewThisCell (view, fpa);
     259        hdu  = pmHDUFromCell (cell);
     260        if (hdu->phu)
     261            return hdu;
     262        new->cell = -1;
     263        hdu = pmFPAviewThisPHU (new, fpa);
     264        return hdu;
     265    }
     266    return NULL;
     267}
  • branches/rel10_ifa/psModules/src/astrom/pmFPAview.h

    r6618 r6713  
    77*  @author EAM, IfA
    88*
    9 *  @version $Revision: 1.1.2.6 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2006-03-17 01:47:44 $
     9*  @version $Revision: 1.1.2.7 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2006-03-28 02:16:26 $
    1111*
    1212*  Copyright 2004-2005 Institute for Astronomy, University of Hawaii
     
    3737    int nRows;                          // Maximum number of rows per readout segment read, or 0 for all
    3838    int iRows;                          // Starting point for this read
    39     pmFPA *fpa;
    4039}
    4140pmFPAview;
     
    6766// return the HDU corresponding to the current view
    6867pmHDU *pmFPAviewThisHDU (pmFPAview *view, pmFPA *fpa);
    69 
    70 // convert the rule to a name based on the current view
    71 char *pmFPAviewNameFromRule (char *rule, pmFPAview *view, pmFPA *fpa);
     68pmHDU *pmFPAviewThisPHU (pmFPAview *view, pmFPA *fpa);
    7269
    7370# endif
  • branches/rel10_ifa/psModules/src/astrom/pmHDU.h

    r6663 r6713  
    1010    psMetadata *header;                 // The FITS header, or NULL if primary for FITS; or section info
    1111    psArray *images;                    // The pixel data
     12    psArray *weights;                   // The pixel data
     13    psArray *masks;                     // The pixel data
    1214    psArray *table;                     // The table data
    1315}
  • branches/rel10_ifa/psModules/src/astrom/pmHDUUtils.c

    r6672 r6713  
    3333}
    3434
     35pmHDU *pmHDUFromReadout (pmReadout *readout)
     36{
     37
     38    pmCell *cell = readout->parent; // cell containing this readout;
     39    pmHDU *hdu = pmHDUFromCell (cell);
     40    return hdu;
     41}
    3542
    3643// Get the lowest HDU
  • branches/rel10_ifa/psModules/src/astrom/pmHDUUtils.h

    r6672 r6713  
    1919                    );
    2020
     21pmHDU *pmHDUFromReadout (pmReadout *readout  // Readout for which to find HDU
     22                        );
     23
    2124#endif
  • branches/rel10_ifa/psModules/src/astrom/pmReadout.c

    r6448 r6713  
    11#include <stdio.h>
    22#include "pslib.h"
    3 
    43#include "pmFPA.h"
     4#include "pmHDUUtils.h"
     5#include "pmFPAMaskWeight.h"
    56
    67// Get the bias images for a readout, using the CELL.BIASSEC
     
    2526    return images;
    2627}
     28
     29bool pmReadoutSetWeights(pmReadout *readout)
     30{
     31
     32    pmCell *cell = readout->parent;
     33
     34    float gain = psMetadataLookupF32(NULL, cell->concepts, "CELL.GAIN"); // Cell gain
     35    float readnoise = psMetadataLookupF32(NULL, cell->concepts, "CELL.READNOISE"); // Cell read noise
     36    psRegion *trimsec = psMetadataLookupPtr(NULL, cell->concepts, "CELL.TRIMSEC"); // Trim section
     37    float saturation = psMetadataLookupF32(NULL, cell->concepts, "CELL.SATURATION"); // Saturation level
     38    float bad = psMetadataLookupF32(NULL, cell->concepts, "CELL.BAD"); // Bad level
     39
     40    pmHDU *hdu = pmHDUFromCell (cell);
     41
     42    psArray *pixels = hdu->images;      // Array of images
     43    psArray *weights = hdu->weights;    // Array of weight images
     44    psArray *masks = hdu->masks;        // Array of mask images
     45    // Generate the weights and masks if required
     46    if (! weights) {
     47        weights = psArrayAlloc(pixels->n);
     48        for (int i = 0; i < pixels->n; i++) {
     49            psImage *image = pixels->data[i];
     50            weights->data[i] = psImageAlloc(image->numCols, image->numRows, PS_TYPE_F32);
     51            psImageInit(weights->data[i], 0.0);
     52        }
     53        hdu->weights = weights;
     54    }
     55    if (! masks) {
     56        masks = psArrayAlloc(pixels->n);
     57        for (int i = 0; i < pixels->n; i++) {
     58            psImage *image = pixels->data[i];
     59            masks->data[i] = psImageAlloc(image->numCols, image->numRows, PS_TYPE_U8);
     60            psImageInit(masks->data[i], 0);
     61        }
     62        hdu->masks = masks;
     63    }
     64
     65    // Set the pixels
     66    psArray *readouts = cell->readouts; // Array of readouts
     67    for (int i = 0; i < readouts->n; i++) {
     68        pmReadout *readout = readouts->data[i]; // The readout of interest
     69
     70        if (! readout->weight) {
     71            readout->weight = psMemIncrRefCounter(psImageSubset(weights->data[i], *trimsec));
     72        }
     73        if (! readout->mask) {
     74            readout->mask = psMemIncrRefCounter(psImageSubset(masks->data[i], *trimsec));
     75        }
     76
     77        // Set up the mask
     78        psImage *image = readout->image;// Pixels
     79        psImage *mask = readout->mask;  // Mask image
     80        for (int i = 0; i < image->numRows; i++) {
     81            for (int j = 0; j < image->numCols; j++) {
     82                if (image->data.F32[i][j] >= saturation) {
     83                    mask->data.U8[i][j] = PM_MASK_SAT;
     84                }
     85                if (image->data.F32[i][j] <= bad) {
     86                    mask->data.U8[i][j] = PM_MASK_BAD;
     87                }
     88            }
     89        }
     90
     91        psImage *weight = readout->weight;  // Mask image
     92        float rnoise = PS_SQR(readnoise/gain);
     93        for (int i = 0; i < image->numRows; i++) {
     94            for (int j = 0; j < image->numCols; j++) {
     95                if (!mask->data.U8[i][j]) {
     96                    weight->data.F32[i][j] = image->data.F32[i][j]/ gain + rnoise;
     97                }
     98            }
     99        }
     100
     101        // Set weight image to the variance = g*f + rn^2
     102        // psBinaryOp(readout->weight, image, "/", psScalarAlloc(gain, PS_TYPE_F32));
     103        // psBinaryOp(readout->weight, readout->weight, "+",
     104        // psScalarAlloc(readnoise*readnoise/gain/gain, PS_TYPE_F32));
     105    }
     106
     107    return true;
     108}
     109
  • branches/rel10_ifa/psModules/src/astrom/pmReadout.h

    r6448 r6713  
    99                        );
    1010
     11bool pmReadoutSetWeights(pmReadout *readout);
    1112
    1213#endif
  • branches/rel10_ifa/psModules/src/config/pmConfig.c

    r6580 r6713  
    33 *  @author PAP, IfA
    44 *
    5  *  @version $Revision: 1.7.4.5 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-03-14 04:40:37 $
     5 *  @version $Revision: 1.7.4.6 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-03-28 02:16:26 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2222{
    2323    psFree(config->site);
     24    psFree(config->files);
    2425    psFree(config->camera);
    2526    psFree(config->recipes);
     
    3536    // Initialise
    3637    config->site = NULL;
     38    config->files = NULL;
    3739    config->camera = NULL;
    3840    config->recipes = NULL;
  • branches/rel10_ifa/psModules/src/config/pmConfig.h

    r6572 r6713  
    33 *  @author PAP, IfA
    44 *
    5  *  @version $Revision: 1.3.4.3 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-03-14 02:20:22 $
     5 *  @version $Revision: 1.3.4.4 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-03-28 02:16:26 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2222    psMetadata *recipes;                // Recipes for processing
    2323    psMetadata *arguments;              // Command-line arguments
    24     psMetadata *files;   // pmFPAfiles used for analysis
     24    psMetadata *files;                  // pmFPAfiles used for analysis
    2525    psDB *database;                     // Database handle
    2626}
  • branches/rel10_ifa/psModules/src/pslib/Makefile.am

    r6620 r6713  
    44libpsmodulepslib_la_LDFLAGS  = -release $(PACKAGE_VERSION)
    55libpsmodulepslib_la_SOURCES  = \
     6    psAdditionals.c \
    67    psEllipse.c \
    78    psImageJpeg.c \
     
    1415psmoduleincludedir = $(includedir)
    1516psmoduleinclude_HEADERS = \
     17    psAdditionals.h \
    1618    psEllipse.h \
    1719    psImageJpeg.h \
  • branches/rel10_ifa/psModules/src/pslib/psAdditionals.c

    r6530 r6713  
    22#include <strings.h>
    33#include "pslib.h"
    4 
    54#include "psAdditionals.h"
    6 
    75
    86psMetadata *pap_psMetadataCopy(psMetadata *out,
  • branches/rel10_ifa/psModules/src/pslib/psRegionIsBad.c

    r6620 r6713  
    77}
    88
     9bool psRegionIsNaN (psRegion region)
     10{
     11
     12    if (!isfinite(region.x0))
     13        return true;
     14    if (!isfinite(region.x1))
     15        return true;
     16    if (!isfinite(region.y0))
     17        return true;
     18    if (!isfinite(region.y1))
     19        return true;
     20    return false;
     21}
  • branches/rel10_ifa/psModules/src/pslib/psRegionIsBad.h

    r6620 r6713  
    66bool psRegionIsBad(const psRegion region);
    77
     8// test is any element of the region is not finite
     9bool psRegionIsNaN (psRegion region // test for this region
     10                   );
     11
    812#endif
  • branches/rel10_ifa/psModules/src/psmodules.h

    r6663 r6713  
    22#define PS_MODULES_H
    33
    4 #include "pslib.h"
     4// XXX should this be included explicitly?
     5#include <pslib.h>
    56
    6 #include "psImageJpeg.h"
    7 #include "psLine.h"
    8 #include "psPolynomialUtils.h"
    9 #include "psSparse.h"
    10 #include "psEllipse.h"
    11 //#include "pmChipMosaic.h"
    12 #include "pmConcepts.h"
    13 #include "pmConceptsRead.h"
    14 #include "pmConceptsStandard.h"
    15 #include "pmConceptsWrite.h"
    16 #include "pmHDU.h"
    17 #include "pmFPA.h"
    18 //#include "pmFPAAstrometry.h"
    19 #include "pmFPAConstruct.h"
    20 #include "pmFPARead.h"
    21 #include "pmFPAWrite.h"
    22 #include "pmReadout.h"
    23 #include "pmFPAfile.h"
    24 #include "pmFPAview.h"
    25 #include "pmConfig.h"
    26 #include "pmFlatField.h"
    27 #include "pmFlatFieldErrors.h"
    28 #include "pmMaskBadPixels.h"
    29 #include "pmMaskBadPixelsErrors.h"
    30 #include "pmNonLinear.h"
    31 #include "pmImageCombine.h"
    32 //#include "pmReadoutCombine.h"
    33 #include "pmImageSubtract.h"
    34 #include "pmSubtractBias.h"
    35 //#include "pmSubtractSky.h"
     7// the following headers are from psModule:pslib
     8#include <psImageJpeg.h>
     9#include <psLine.h>
     10#include <psPolynomialUtils.h>
     11#include <psSparse.h>
     12#include <psEllipse.h>
     13#include <psAdditionals.h>
     14#include <psRegionIsBad.h>
     15#include <psMetadataItemParse.h>
    3616
    37 // #include "pmGrowthCurve.h"
    38 // #include "pmObjects.h"
    39 // #include "pmObjectsIO.h"
    40 // #include "pmModel.h"
    41 // #include "pmPSF.h"
    42 // #include "pmPSFtry.h"
    43 // #include "pmMoments.h"
    44 // #include "pmPeaks.h"
    45 // #include "pmSource.h"
    46 // #include "pmSourceContour.h"
    47 // #include "pmSourceFitModel.h"
    48 // #include "pmSourceFitSet.h"
    49 // #include "pmSourcePhotometry.h"
    50 // #include "pmSourceSky.h"
    51 // #include "pmSourceIO.h"
    52 // #include "pmModelGroup.h"
     17// the following headers are from psModule:config
     18#include <pmConfig.h>
     19
     20// the following headers are from psModule:astrom
     21#include <pmConcepts.h>
     22#include <pmConceptsRead.h>
     23#include <pmConceptsStandard.h>
     24#include <pmConceptsWrite.h>
     25#include <pmHDU.h>
     26#include <pmHDUUtils.h>
     27#include <pmFPA.h>
     28#include <pmFPAview.h>
     29#include <pmFPAfile.h>
     30#include <pmFPARead.h>
     31#include <pmFPAConstruct.h>
     32#include <pmFPAConstruct.h>
     33#include <pmFPARead.h>
     34#include <pmFPAWrite.h>
     35#include <pmReadout.h>
     36#include <pmFPAfile.h>
     37#include <pmFPAview.h>
     38// #include <pmChipMosaic.h>
     39// #include <pmFPAAstrometry.h>
     40
     41// the following headers are from psModule:detrend
     42#include <pmFlatField.h>
     43#include <pmFlatFieldErrors.h>
     44#include <pmMaskBadPixels.h>
     45#include <pmMaskBadPixelsErrors.h>
     46#include <pmNonLinear.h>
     47
     48// the following headers are from psModule:imcombine
     49#include <pmImageCombine.h>
     50// #include <pmReadoutCombine.h>
     51
     52// the following headers are from psModule:detrend
     53#include <pmSubtractBias.h>
     54#include <pmImageSubtract.h>
     55// #include <pmSubtractSky.h>
     56
     57// the following headers are from psModule:objects
     58# include <pmPeaks.h>
     59# include <pmMoments.h>
     60# include <pmModel.h>
     61# include <pmSource.h>
     62# include <pmSourceIO.h>
     63# include <pmSourceSky.h>
     64# include <pmSourceFitModel.h>
     65# include <pmSourceFitSet.h>
     66# include <pmSourceContour.h>
     67# include <pmGrowthCurve.h>
     68# include <pmPSF.h>
     69# include <pmPSFtry.h>
     70# include <pmModelGroup.h>
     71# include <pmSourcePhotometry.h>
     72# include <pmFPAviewObjectsIO.h>
    5373
    5474#endif
Note: See TracChangeset for help on using the changeset viewer.