IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 25, 2007, 3:20:29 PM (19 years ago)
Author:
magnier
Message:

incorporating updates from eam_02_branch (cached models, pmPSF FITS IO)

Location:
trunk/psModules/src/camera
Files:
3 edited

Legend:

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

    r12838 r13034  
    211211        if (mdok && trimsec && !psRegionIsNaN(*trimsec)) {
    212212            *trimsec = psImageBinningSetRuffRegion(binning, *trimsec);
     213            // force integer pixels : truncate x0, roundup x1:
     214            trimsec->x0 = (int)trimsec->x0;
     215            if (trimsec->x1 > (int)trimsec->x1) {
     216                trimsec->x1 = (int)trimsec->x1 + 1;
     217            } else {
     218                trimsec->x1 = (int)trimsec->x1;
     219            }           
     220            trimsec->y0 = (int)trimsec->y0;
     221            if (trimsec->y1 > (int)trimsec->y1) {
     222                trimsec->y1 = (int)trimsec->y1 + 1;
     223            } else {
     224                trimsec->y1 = (int)trimsec->y1;
     225            }           
    213226        }
    214227        psList *biassecs = psMetadataLookupPtr(&mdok, target->concepts, "CELL.BIASSEC"); // The bias sections
     
    219232                if (!psRegionIsNaN(*biassec)) {
    220233                    *biassec = psImageBinningSetRuffRegion(binning, *biassec);
     234                    // force integer pixels : truncate x0, roundup x1:
     235                    biassec->x0 = (int)biassec->x0;
     236                    if (biassec->x1 > (int)biassec->x1) {
     237                        biassec->x1 = (int)biassec->x1 + 1;
     238                    } else {
     239                        biassec->x1 = (int)biassec->x1;
     240                    }           
     241                    biassec->y0 = (int)biassec->y0;
     242                    if (biassec->y1 > (int)biassec->y1) {
     243                        biassec->y1 = (int)biassec->y1 + 1;
     244                    } else {
     245                        biassec->y1 = (int)biassec->y1;
     246                    }           
    221247                }
    222248            }
  • trunk/psModules/src/camera/pmFPAfile.c

    r12890 r13034  
    1717#include "pmFPAfile.h"
    1818#include "pmFPACopy.h"
     19#include "pmConcepts.h"
    1920
    2021static void pmFPAfileFree(pmFPAfile *file)
     
    326327    PS_ASSERT_PTR_NON_NULL(view, false);
    327328
     329    // XXX this should be smarter (ie, only copy concepts from the current chips)
     330    // but such a call is needed, so re-copy stuff rather than no copy
     331    pmFPACopyConcepts (out, in);
     332
    328333    // pmFPAWrite takes care of all PHUs as needed
    329     if ((view->chip == -1) || in->hdu) {
     334    if (view->chip == -1) {
    330335        status = pmFPACopyStructure (out, in, xBin, yBin);
    331336        return status;
     
    338343    pmChip *outChip = out->chips->data[view->chip];
    339344
    340     if ((view->cell == -1) || inChip->hdu) {
     345    if (view->cell == -1) {
    341346        status = pmChipCopyStructure (outChip, inChip, xBin, yBin);
    342347        return status;
    343     }
     348    } 
    344349    if (view->cell >= inChip->cells->n) {
    345350        psError(PS_ERR_IO, true, "Requested cell == %d>= inChip->cells->n == %ld",
     
    350355    pmCell *outCell = outChip->cells->data[view->cell];
    351356
    352     if ((view->readout == -1) || inCell->hdu) {
    353         status = pmCellCopyStructure (outCell, inCell, xBin, yBin);
    354         return status;
    355     }
    356     psError(PS_ERR_UNKNOWN, true, "Returning false");
    357     return false;
     357    status = pmCellCopyStructure (outCell, inCell, xBin, yBin);
     358    return status;
    358359}
    359360
  • trunk/psModules/src/camera/pmFPAfileIO.c

    r12949 r13034  
    434434      case PM_FPA_FILE_FRINGE:
    435435      case PM_FPA_FILE_CMF:
     436      case PM_FPA_FILE_PSF:
    436437        psTrace ("psModules.camera", 5, "closing %s (%s) (%d:%d:%d)\n", file->filename, file->name, view->chip, view->cell, view->readout);
    437438        status = psFitsClose (file->fits);
     
    447448      case PM_FPA_FILE_OBJ:
    448449      case PM_FPA_FILE_CMP:
    449       case PM_FPA_FILE_PSF:
    450450      case PM_FPA_FILE_JPEG:
    451451      case PM_FPA_FILE_KAPA:
     
    500500      case PM_FPA_FILE_CMP:
    501501      case PM_FPA_FILE_CMF:
     502      case PM_FPA_FILE_PSF:
    502503        psTrace ("psModules.camera", 5, "NOT freeing %s (%s) : save for further analysis\n", file->filename, file->name);
    503504        return true;
    504       case PM_FPA_FILE_PSF:
    505505      case PM_FPA_FILE_JPEG:
    506506      case PM_FPA_FILE_KAPA:
     
    638638      case PM_FPA_FILE_FRINGE:
    639639      case PM_FPA_FILE_CMF:
     640      case PM_FPA_FILE_PSF:
    640641        psTrace ("psModules.camera", 5, "opening %s (%s) (%d:%d:%d)\n", file->filename, file->name, view->chip, view->cell, view->readout);
    641642        file->fits = psFitsOpen (file->filename, mode);
     
    672673      case PM_FPA_FILE_CMP:
    673674      case PM_FPA_FILE_RAW:
    674       case PM_FPA_FILE_PSF:
    675675      case PM_FPA_FILE_JPEG:
    676676      case PM_FPA_FILE_KAPA:
     
    751751
    752752// XXX this function is only called from pmFPAfileWrite
     753// XXX for each data type, there should be a function which writes the PHU, if needed
    753754bool pmFPAfileWritePHU(pmFPAfile *file, const pmFPAview *view, const pmConfig *config)
    754755{
Note: See TracChangeset for help on using the changeset viewer.