IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 18, 2006, 1:43:28 PM (19 years ago)
Author:
Paul Price
Message:

Extensive changes to FPA reading/writing functions to support mask and weight map reading/writing. Actually, not so much changes as generalisations to the reading/writing functions. Moved the reading/writing functionality into file-static functions, which the higher level functions for reading/writing particular elements (image, mask, weight) call. Added additional pmFPAfile types for mask and weight, with supporting functionality to call the reading/writing functions.

File:
1 edited

Legend:

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

    r9950 r10081  
    225225        // open the FITS types:
    226226    case PM_FPA_FILE_IMAGE:
     227    case PM_FPA_FILE_MASK:
     228    case PM_FPA_FILE_WEIGHT:
    227229    case PM_FPA_FILE_FRINGE:
    228230        psTrace ("pmFPAfile", 5, "opening %s (type: %d)\n", file->filename, file->type);
     
    311313    switch (file->type) {
    312314    case PM_FPA_FILE_IMAGE:
    313         if (!pmFPAviewReadFitsImage (view, file)) {
     315        if (!pmFPAviewReadFitsImage(view, file)) {
     316            psError(PS_ERR_UNKNOWN, false, "skipping %s (type: %d)\n", file->filename, file->type);
     317            return false;
     318        }
     319        psTrace ("pmFPAfile", 5, "reading %s (type: %d)\n", file->filename, file->type);
     320        break;
     321    case PM_FPA_FILE_MASK:
     322        if (!pmFPAviewReadFitsMask(view, file)) {
     323            psError(PS_ERR_UNKNOWN, false, "skipping %s (type: %d)\n", file->filename, file->type);
     324            return false;
     325        }
     326        psTrace ("pmFPAfile", 5, "reading %s (type: %d)\n", file->filename, file->type);
     327        break;
     328    case PM_FPA_FILE_WEIGHT:
     329        if (!pmFPAviewReadFitsWeight(view, file)) {
    314330            psError(PS_ERR_UNKNOWN, false, "skipping %s (type: %d)\n", file->filename, file->type);
    315331            return false;
     
    384400    switch (file->type) {
    385401    case PM_FPA_FILE_IMAGE:
    386         if (pmFPAviewFreeFitsImage (view, file)) {
     402    case PM_FPA_FILE_MASK:
     403    case PM_FPA_FILE_WEIGHT:
     404    case PM_FPA_FILE_FRINGE:
     405        if (pmFPAviewFreeData(view, file)) {
    387406            psTrace ("pmFPAfile", 5, "freed %s for %s (type: %d)\n", file->filename, file->name, file->type);
    388407            if (file->filename == NULL) {
     
    394413        }
    395414        break;
    396     case PM_FPA_FILE_FRINGE:
    397         if (!pmFPAviewFreeFitsTable(view, file, "FRINGE")) {
    398             psError(PS_ERR_UNKNOWN, false, "Unable to free fringe data.\n");
    399             return false;
    400         }
    401         break;
    402 
    403415    case PM_FPA_FILE_SX:
    404416    case PM_FPA_FILE_RAW:
     
    469481    switch (file->type) {
    470482    case PM_FPA_FILE_IMAGE:
     483        pmFPAviewWriteFitsImage(view, file);
     484        psTrace ("pmFPAfile", 5, "wrote image %s (fpa: %p)\n", file->filename, file->fpa);
     485        break;
     486    case PM_FPA_FILE_MASK:
     487        pmFPAviewWriteFitsMask(view, file);
     488        psTrace ("pmFPAfile", 5, "wrote mask %s (fpa: %p)\n", file->filename, file->fpa);
     489        break;
     490    case PM_FPA_FILE_WEIGHT:
     491        pmFPAviewWriteFitsWeight(view, file);
     492        psTrace ("pmFPAfile", 5, "wrote weight %s (fpa: %p)\n", file->filename, file->fpa);
     493        break;
     494    case PM_FPA_FILE_FRINGE:
    471495        pmFPAviewWriteFitsImage (view, file);
    472496        psTrace ("pmFPAfile", 5, "wrote image %s (fpa: %p)\n", file->filename, file->fpa);
    473         break;
    474     case PM_FPA_FILE_FRINGE:
    475         pmFPAviewWriteFitsImage (view, file);
    476         psTrace ("pmFPAfile", 5, "wrote table %s (fpa: %p)\n", file->filename, file->fpa);
    477497        pmFPAviewWriteFitsTable(view, file, "FRINGE");
    478498        psTrace ("pmFPAfile", 5, "wrote fringe table %s (fpa: %p)\n", file->filename, file->fpa);
     
    554574    switch (file->type) {
    555575    case PM_FPA_FILE_IMAGE:
     576    case PM_FPA_FILE_MASK:
     577    case PM_FPA_FILE_WEIGHT:
    556578    case PM_FPA_FILE_FRINGE:
    557579        // create FPA structure component based on view
     
    608630        // check the FITS types
    609631    case PM_FPA_FILE_IMAGE:
     632    case PM_FPA_FILE_MASK:
     633    case PM_FPA_FILE_WEIGHT:
    610634    case PM_FPA_FILE_FRINGE:
    611635    case PM_FPA_FILE_CMF:
Note: See TracChangeset for help on using the changeset viewer.