IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14647


Ignore:
Timestamp:
Aug 23, 2007, 1:42:41 PM (19 years ago)
Author:
magnier
Message:

added formatName to pmFPAfile (needed in some cases)
dropped const from pmConfig argument to pmFPAfileBindFromArgs
changed instances of psErrorStackPrint to psError (should only be used if we abort)
changed API names for pmPSFmodel I/O functions to put pmPSFmodel at front

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

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPA.h

    r14201 r14647  
    66 * @author Eugene Magnier, IfA
    77 *
    8  * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    9  * @date $Date: 2007-07-14 03:17:18 $
     8 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     9 * @date $Date: 2007-08-23 23:42:41 $
    1010 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    1111 */
     
    1818
    1919#define FPA_ASTROM 1                    ///< Include astrometry information in the structures?
     20
     21// Return chip position, given FPA position; calculations are all done in pixel units
     22#define PM_FPA_TO_CHIP(pos, chip0, chipParity) \
     23    (((pos) - (chip0))*(chipParity))
     24
     25// Return cell position, given chip position; calculations are all done in pixel units
     26#define PM_CHIP_TO_CELL(pos, cell0, cellParity, binning) \
     27    (((pos) - (cell0))*(cellParity)/(binning))
     28
     29// Return chip position, given a cell position; calculations are all done in pixel units
     30#define PM_CELL_TO_CHIP(pos, cell0, cellParity, binning) \
     31    ((pos)*(binning)*(cellParity) + (cell0))
     32
     33// Return FPA position, given a chip position; calculations are all done in pixel units
     34#define PM_CHIP_TO_FPA(pos, chip0, chipParity) \
     35    ((pos)*(chipParity) + (chip0))
    2036
    2137/// Focal plane array (the entirety of the camera)
  • trunk/psModules/src/camera/pmFPAfile.c

    r14202 r14647  
    3232    psFree (file->camera);
    3333    psFree (file->format);
     34    psFree (file->formatName);
    3435    psFree (file->name);
    3536
     
    7374    file->camera = NULL;
    7475    file->format = NULL;
     76    file->formatName = NULL;
    7577    file->name = NULL;
    7678
  • trunk/psModules/src/camera/pmFPAfile.h

    r14202 r14647  
    44 * @author EAM, IfA
    55 *
    6  * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-07-14 03:17:44 $
     6 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2007-08-23 23:42:41 $
    88 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii
    99 */
     
    9191    psMetadata *camera;                 // Camera configuration
    9292    psMetadata *format;                 // Camera format
     93    char *formatName;                   // name of the camera format
    9394}
    9495pmFPAfile;
  • trunk/psModules/src/camera/pmFPAfileDefine.c

    r14596 r14647  
    203203    }
    204204    file->format = psMemIncrRefCounter(format);
     205    file->formatName = psStringCopy(formatName);
    205206
    206207    if (fpa) {
     
    351352    psFree (format);
    352353    file->format = psMemIncrRefCounter(format);
     354    file->formatName = psStringCopy(config->formatName);
    353355
    354356    // adjust the rules to identify these files in the file->names data
     
    440442// save the pmFPAfile on config->files
    441443// return the pmFPAfile (a view to the one saved on config->files)
    442 pmFPAfile *pmFPAfileBindFromArgs (bool *success, pmFPAfile *input, const pmConfig *config, const char *filename, const char *argname)
     444pmFPAfile *pmFPAfileBindFromArgs (bool *success, pmFPAfile *input, pmConfig *config, const char *filename, const char *argname)
    443445{
    444446    PS_ASSERT_PTR_NON_NULL(input, NULL);
     
    511513
    512514        if (!format) {
    513             format = pmConfigCameraFormatFromHeader((pmConfig*)config, phu, true);
     515            format = pmConfigCameraFormatFromHeader(config, phu, true);
    514516            if (!format) {
    515517                psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", realName);
     
    562564    psFree(file->format);
    563565    file->format = format;
     566    file->formatName = psStringCopy(config->formatName);
    564567
    565568    if (success) *success = true;
     
    639642    psFree (file->format);
    640643    file->format = format;
     644    file->formatName = psStringCopy(config->formatName);
    641645
    642646    // adjust the rules to identify these files in the file->names data
     
    925929    pmFPAfile *file = pmFPAfileDefineOutput (config, fpa, filename);
    926930    if (!file) {
    927         psErrorStackPrint(stderr, "file %s not defined\n", filename);
     931        psError(PS_ERR_UNEXPECTED_NULL, false, "file %s not defined\n", filename);
    928932        return NULL;
    929933    }
     
    944948    pmFPAfile *file = pmFPAfileDefineOutput (config, NULL, filename);
    945949    if (!file) {
    946         psErrorStackPrint(stderr, "file %s not defined\n", filename);
     950        psError(PS_ERR_UNEXPECTED_NULL, false, "file %s not defined\n", filename);
    947951        return NULL;
    948952    }
    949953    if (!file->camera) {
    950         psErrorStackPrint(stderr, "file %s does not define a new camera\n", filename);
     954        psError(PS_ERR_UNEXPECTED_NULL, false, "file %s does not define a new camera\n", filename);
    951955        return NULL;
    952956    }
     
    987991    }
    988992    if (!file) {
    989         psErrorStackPrint(stderr, "file %s not defined\n", filename);
     993        psError(PS_ERR_UNEXPECTED_NULL, false, "file %s not defined\n", filename);
    990994        return NULL;
    991995    }
     
    10301034    }
    10311035    if (!file) {
    1032         psErrorStackPrint(stderr, "file %s not defined\n", filename);
     1036        psError(PS_ERR_UNEXPECTED_NULL, false, "file %s not defined\n", filename);
    10331037        return NULL;
    10341038    }
     
    10751079    }
    10761080    if (!file) {
    1077         psErrorStackPrint(stderr, "file %s not defined\n", filename);
     1081        psError(PS_ERR_UNEXPECTED_NULL, false, "file %s not defined\n", filename);
    10781082        return NULL;
    10791083    }
  • trunk/psModules/src/camera/pmFPAfileDefine.h

    r13931 r14647  
    44 * @author EAM, IfA
    55 *
    6  * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-06-21 22:45:27 $
     6 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2007-08-23 23:42:41 $
    88 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii
    99 */
     
    4949// Note that the returned pmFPAfile is a view only, so it should not be freed by the caller --- the only
    5050// reference count is held by the config->files metadata.
    51 pmFPAfile *pmFPAfileBindFromArgs (bool *found, pmFPAfile *input, const pmConfig *config, const char *filename, const char *argname);
     51pmFPAfile *pmFPAfileBindFromArgs (bool *found, pmFPAfile *input, pmConfig *config, const char *filename, const char *argname);
    5252
    5353// look for the given argname on the argument list.  find the give filename from the file rules
  • trunk/psModules/src/camera/pmFPAfileIO.c

    r14206 r14647  
    2626#include "pmMoments.h"
    2727#include "pmResiduals.h"
     28#include "pmGrowthCurve.h"
     29#include "pmPSF.h"
    2830#include "pmModel.h"
    2931#include "pmSource.h"
    3032#include "pmSourceIO.h"
    31 #include "pmGrowthCurve.h"
    3233#include "pmResiduals.h"
    33 #include "pmPSF.h"
    3434#include "pmPSF_IO.h"
    3535#include "pmFPA_JPEG.h"
     
    188188        break;
    189189      case PM_FPA_FILE_PSF:
    190         status = pmFPAviewReadPSFmodel (view, file, config);
     190        status = pmPSFmodelReadForView (view, file, config);
    191191        break;
    192192      case PM_FPA_FILE_JPEG:
     
    335335    // (existing) fpa
    336336    if (file->type == PM_FPA_FILE_PSF) {
    337       if (!pmFPAviewCheckDataStatusForPSFmodel (view, file)) {
     337      if (!pmPSFmodelCheckDataStatusForView (view, file)) {
    338338        psTrace("psModules.camera", 6, "skip write for %s, no data for this entry", file->name);
    339339        return true;
     
    402402
    403403      case PM_FPA_FILE_PSF:
    404         status = pmFPAviewWritePSFmodel (view, file, config);
     404        status = pmPSFmodelWriteForView (view, file, config);
    405405        break;
    406406
     
    757757            return false;
    758758        }
     759        file->formatName = psStringCopy(config->formatName);
     760
    759761    } else {
    760762        bool valid;
     
    798800        break;
    799801      case PM_FPA_FILE_PSF:
    800         status = pmPSF_WritePHU (view, file, config);
     802        status = pmPSFmodelWritePHU (view, file, config);
    801803        break;
    802804      case PM_FPA_FILE_SX:
Note: See TracChangeset for help on using the changeset viewer.