IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 13, 2006, 12:15:55 PM (19 years ago)
Author:
Paul Price
Message:

Adding FRINGE type to pmFPAfile, which reads from/writes to FITS tables at the cell level.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAfile.c

    r9436 r9950  
    119119}
    120120
     121// select the cell from the named pmFPAfile; if the named file does not exist,
     122pmCell *pmFPAfileThisCell (psMetadata *files, const pmFPAview *view, const char *name)
     123{
     124    PS_ASSERT_PTR_NON_NULL(files, false);
     125    PS_ASSERT_PTR_NON_NULL(view, false);
     126    PS_ASSERT_PTR_NON_NULL(name, false);
     127    PS_ASSERT_INT_POSITIVE(strlen(name), false);
     128
     129    bool status;
     130
     131    pmFPAfile *file = psMetadataLookupPtr (&status, files, name);
     132    if (file == NULL) {
     133        return NULL;
     134    }
     135
     136    // internal files have the readout as a separate element:
     137    if (file->mode == PM_FPA_MODE_INTERNAL) {
     138        return NULL;
     139    }
     140
     141    pmCell *cell = pmFPAviewThisCell(view, file->fpa);
     142    return cell;
     143}
     144
     145// select the readout from the named pmFPAfile; if the named file does not exist,
     146pmChip *pmFPAfileThisChip (psMetadata *files, const pmFPAview *view, const char *name)
     147{
     148    PS_ASSERT_PTR_NON_NULL(files, false);
     149    PS_ASSERT_PTR_NON_NULL(view, false);
     150    PS_ASSERT_PTR_NON_NULL(name, false);
     151    PS_ASSERT_INT_POSITIVE(strlen(name), false);
     152
     153    bool status;
     154
     155    pmFPAfile *file = psMetadataLookupPtr (&status, files, name);
     156    if (file == NULL) {
     157        return NULL;
     158    }
     159
     160    // internal files have the readout as a separate element:
     161    if (file->mode == PM_FPA_MODE_INTERNAL) {
     162        return NULL;
     163    }
     164
     165    pmChip *chip = pmFPAviewThisChip (view, file->fpa);
     166    return chip;
     167}
     168
    121169// select the rule from the camera configuration, perform substitutions as needed
    122170char *pmFPAfileNameFromRule (char *rule, pmFPAfile *file, const pmFPAview *view)
     
    296344    return false;
    297345}
     346
     347
     348pmFPAfileType pmFPAfileTypeFromString(const char *type)
     349{
     350    PS_ASSERT_STRING_NON_EMPTY(type, PM_FPA_FILE_NONE);
     351
     352    if (!strcasecmp (type, "SX"))     {
     353        return PM_FPA_FILE_SX;
     354    }
     355    if (!strcasecmp (type, "OBJ"))     {
     356        return PM_FPA_FILE_OBJ;
     357    }
     358    if (!strcasecmp (type, "CMP"))     {
     359        return PM_FPA_FILE_CMP;
     360    }
     361    if (!strcasecmp (type, "CMF"))     {
     362        return PM_FPA_FILE_CMF;
     363    }
     364    if (!strcasecmp (type, "RAW"))     {
     365        return PM_FPA_FILE_RAW;
     366    }
     367    if (!strcasecmp (type, "IMAGE"))     {
     368        return PM_FPA_FILE_IMAGE;
     369    }
     370    if (!strcasecmp (type, "PSF"))     {
     371        return PM_FPA_FILE_PSF;
     372    }
     373    if (!strcasecmp (type, "JPEG"))     {
     374        return PM_FPA_FILE_JPEG;
     375    }
     376    if (!strcasecmp (type, "FRINGE")) {
     377        return PM_FPA_FILE_FRINGE;
     378    }
     379
     380    return PM_FPA_FILE_NONE;
     381}
     382
Note: See TracChangeset for help on using the changeset viewer.