IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 26, 2004, 2:57:34 PM (22 years ago)
Author:
desonia
Message:

converted native C types to ps Types, where practical.

Location:
trunk/psLib/src/astronomy
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astronomy/psAstrometry.c

    r2137 r2204  
    88 *  @author George Gusciora, MHPCC
    99 *
    10  *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-10-14 23:45:53 $
     10 *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-10-27 00:57:30 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3333psImage.
    3434 *****************************************************************************/
    35 static int checkValidImageCoords(double x,
    36                                  double y,
    37                                  psImage* tmpImage)
     35static psS32 checkValidImageCoords(double x,
     36                                   double y,
     37                                   psImage* tmpImage)
    3838{
    3939    if (tmpImage == NULL) {
     
    5656cooefficients of order 2 are higher are non-zero, then it is not linear.
    5757 *****************************************************************************/
    58 static int isProjectionLinear(psPlaneTransform *transform)
    59 {
    60     int i = 0;
     58static psS32 isProjectionLinear(psPlaneTransform *transform)
     59{
     60    psS32 i = 0;
    6161    PS_CHECK_NULL_PTR_RETURN_ZERO(transform);
    6262
     
    178178{
    179179    if (obs != NULL) {
    180         psFree((void*)obs->name);
     180        psFree((psPtr)obs->name);
    181181    }
    182182}
     
    185185{
    186186    if (exp != NULL) {
    187         psFree((void*)exp->time);
    188         psFree((void*)exp->observatory);
    189         psFree((void*)exp->cameraName);
    190         psFree((void*)exp->telescopeName);
     187        psFree((psPtr)exp->time);
     188        psFree((psPtr)exp->observatory);
     189        psFree((psPtr)exp->cameraName);
     190        psFree((psPtr)exp->telescopeName);
    191191    }
    192192}
     
    195195{
    196196    if (fp != NULL) {
    197         for (int i = 0; i < fp->p_ps_xRows; i++) {
     197        for (psS32 i = 0; i < fp->p_ps_xRows; i++) {
    198198            psFree(fp->x[i]);
    199199        }
    200200
    201         for (int j = 0; j < fp->p_ps_yRows; j++) {
     201        for (psS32 j = 0; j < fp->p_ps_yRows; j++) {
    202202            psFree(fp->y[j]);
    203203        }
     
    226226{
    227227    psFixedPattern *tmp;
    228     int i;
    229     int j;
     228    psS32 i;
     229    psS32 j;
    230230
    231231    PS_CHECK_NULL_IMAGE_RETURN_NULL(x);
     
    301301    *(float *)&exp->wavelength = wavelength;
    302302
    303     exp->time = psMemIncrRefCounter((void*)time);
    304     exp->observatory = psMemIncrRefCounter((void*)observatory);
     303    exp->time = psMemIncrRefCounter((psPtr)time);
     304    exp->observatory = psMemIncrRefCounter((psPtr)observatory);
    305305
    306306    // XXX: how is these value derived?
     
    343343}
    344344
    345 psFPA* psFPAAlloc(int nChips,
     345psFPA* psFPAAlloc(psS32 nChips,
    346346                  const psExposure* exp)
    347347{
     
    350350    // create array of NULL chips of the size nChips
    351351    newFPA->chips = psArrayAlloc(nChips);
    352     void** chips = newFPA->chips->data;
    353     for (int i=0;i<nChips;i++) {
     352    psPtr* chips = newFPA->chips->data;
     353    for (psS32 i=0;i<nChips;i++) {
    354354        chips[i] = NULL;
    355355    }
     
    384384 * psChip constructor
    385385 */
    386 psChip* psChipAlloc(int nCells,
     386psChip* psChipAlloc(psS32 nCells,
    387387                    psFPA *parentFPA)
    388388{
     
    391391    // create array of NULL psCells
    392392    chip->cells = psArrayAlloc(nCells);
    393     void** cells = chip->cells->data;
    394     for (int i=0;i<nCells;i++) {
     393    psPtr* cells = chip->cells->data;
     394    for (psS32 i=0;i<nCells;i++) {
    395395        cells[i] = NULL;
    396396    }
     
    412412 * psCell constructor
    413413 */
    414 psCell* psCellAlloc(int nReadouts,
     414psCell* psCellAlloc(psS32 nReadouts,
    415415                    psChip* parentChip)
    416416{
     
    419419    // create array of NULL psReadouts
    420420    cell->readouts = psArrayAlloc(nReadouts);
    421     void** readouts = cell->readouts->data;
    422     for (int i=0;i<nReadouts;i++) {
     421    psPtr* readouts = cell->readouts->data;
     422    for (psS32 i=0;i<nReadouts;i++) {
    423423        readouts[i] = NULL;
    424424    }
     
    440440}
    441441
    442 psReadout* psReadoutAlloc(int col0,
    443                           int row0,
     442psReadout* psReadoutAlloc(psS32 col0,
     443                          psS32 row0,
    444444                          const psImage* image)
    445445{
    446446    psReadout* readout = psAlloc(sizeof(psReadout));
    447447
    448     *(unsigned int*)&readout->colBins = 1;
    449     *(unsigned int*)&readout->rowBins = 1;
    450     *(int*)&readout->col0 = col0;
    451     *(int*)&readout->row0 = row0;
     448    *(psU32*)&readout->colBins = 1;
     449    *(psU32*)&readout->rowBins = 1;
     450    *(psS32*)&readout->col0 = col0;
     451    *(psS32*)&readout->row0 = row0;
    452452
    453453    readout->image = (psImage*)image;
     
    521521    PS_CHECK_NULL_PTR_RETURN_NULL(FPA->chips);
    522522    psArray* chips = FPA->chips;
    523     int nChips = chips->n;
     523    psS32 nChips = chips->n;
    524524    psPlane chipCoord;
    525525    psCell *tmpCell = NULL;
     
    529529    // cells in that chip contain those chip coordinates.
    530530
    531     for (int i = 0; i < nChips; i++) {
     531    for (psS32 i = 0; i < nChips; i++) {
    532532        psChip* tmpChip = chips->data[i];
    533533        psPlaneTransformApply(&chipCoord, tmpChip->fromFPA, fpaCoord);
     
    560560    // If so, then we return that cell.
    561561
    562     for (int i = 0; i < cells->n; i++) {
     562    for (psS32 i = 0; i < cells->n; i++) {
    563563        psCell* tmpCell = (psCell* ) cells->data[i];
    564564        psArray* readouts = tmpCell->readouts;
    565565
    566566        if (readouts != NULL) {
    567             for (int j = 0; j < readouts->n; j++) {
     567            for (psS32 j = 0; j < readouts->n; j++) {
    568568                psReadout* tmpReadout = readouts->data[j];
    569569
  • trunk/psLib/src/astronomy/psAstrometry.h

    r2058 r2204  
    88*  @author George Gusciora, MHPCC
    99*
    10 *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2004-10-12 20:53:02 $
     10*  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-10-27 00:57:30 $
    1212*
    1313*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7272typedef struct
    7373{
    74     int nX;                            ///< Number of elements in x direction
    75     int nY;                            ///< Number of elements in y direction
     74    psS32 nX;                            ///< Number of elements in x direction
     75    psS32 nY;                            ///< Number of elements in y direction
    7676    double x0;                         ///< X Position of 0,0 corner on focal plane
    7777    double y0;                         ///< Y Position of 0,0 corner on focal plane
     
    7979    double yScale;                     ///< Scale of the grid in x direction
    8080    /// XXX: I added the following memvers to facilitate the psFreeing of the x,y data structures.
    81     int p_ps_xRows;                    ///< Number of rows in the x member
    82     int p_ps_xCols;                    ///< Number of cols in the x member
    83     int p_ps_yRows;                    ///< Number of rows in the y member
    84     int p_ps_yCols;                    ///< Number of cols in the y member
     81    psS32 p_ps_xRows;                    ///< Number of rows in the x member
     82    psS32 p_ps_xCols;                    ///< Number of cols in the x member
     83    psS32 p_ps_yRows;                    ///< Number of rows in the y member
     84    psS32 p_ps_yCols;                    ///< Number of cols in the y member
    8585    double **x;                        ///< The grid of offsets in x
    8686    double **y;                        ///< The grid of offsets in y
     
    9999typedef struct
    100100{
    101     const unsigned int colBins;        ///< Amount of binning in x-dimension
    102     const unsigned int rowBins;        ///< Amount of binning in y-dimension
    103     const int col0;                    ///< Offset from the left of chip.
    104     const int row0;                    ///< Offset from the bottom of chip.
     101    const psU32 colBins;        ///< Amount of binning in x-dimension
     102    const psU32 rowBins;        ///< Amount of binning in y-dimension
     103    const psS32 col0;                    ///< Offset from the left of chip.
     104    const psS32 row0;                    ///< Offset from the bottom of chip.
    105105
    106106    psImage* image;                    ///< Imaging area of readout
     
    304304 */
    305305psFPA* psFPAAlloc(
    306     int nChips,                        ///< number of chips in the FPA
     306    psS32 nChips,                        ///< number of chips in the FPA
    307307    const psExposure* exp              ///< the exposure information
    308308);
     
    317317 */
    318318psChip* psChipAlloc(
    319     int nCells,                        ///< number of cells in Chip
     319    psS32 nCells,                        ///< number of cells in Chip
    320320    psFPA* parentFPA                   ///< parent FPA
    321321);
     
    330330 */
    331331psCell* psCellAlloc(
    332     int nReadouts,                     ///< number of readouts in cell
     332    psS32 nReadouts,                     ///< number of readouts in cell
    333333    psChip* parentChip                 ///< parent Chip
    334334);
     
    342342 */
    343343psReadout* psReadoutAlloc(
    344     int col0,                          ///< offset from the left of the cell
    345     int row0,                          ///< offset from the bottom of the cell
     344    psS32 col0,                          ///< offset from the left of the cell
     345    psS32 row0,                          ///< offset from the bottom of the cell
    346346    const psImage* image               ///< image of the readout
    347347);
  • trunk/psLib/src/astronomy/psCoord.c

    r2200 r2204  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-10-26 22:32:09 $
     12*  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-27 00:57:30 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6767}
    6868
    69 psPlaneTransform* psPlaneTransformAlloc(int n1, int n2)
     69psPlaneTransform* psPlaneTransformAlloc(psS32 n1, psS32 n2)
    7070{
    7171    psPlaneTransform *pt = psAlloc(sizeof(psPlaneTransform));
     
    9797}
    9898
    99 psPlaneDistort* psPlaneDistortAlloc(int n1, int n2, int n3, int n4)
     99psPlaneDistort* psPlaneDistortAlloc(psS32 n1, psS32 n2, psS32 n3, psS32 n4)
    100100{
    101101    psPlaneDistort *pt = psAlloc(sizeof(psPlaneDistort));
  • trunk/psLib/src/astronomy/psCoord.h

    r2200 r2204  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-10-26 22:32:09 $
     12*  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-27 00:57:30 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    173173
    174174psPlaneTransform* psPlaneTransformAlloc(
    175     int n1,  ///< The order of the x term in the transform.
    176     int n2   ///< The order of the y term in the transform.
     175    psS32 n1,  ///< The order of the x term in the transform.
     176    psS32 n2   ///< The order of the y term in the transform.
    177177);
    178178
     
    193193
    194194psPlaneDistort* psPlaneDistortAlloc(
    195     int n1,  ///< The order of the w term in the transform.
    196     int n2,  ///< The order of the x term in the transform.
    197     int n3,  ///< The order of the y term in the transform.
    198     int n4   ///< The order of the z term in the transform.
     195    psS32 n1,  ///< The order of the w term in the transform.
     196    psS32 n2,  ///< The order of the x term in the transform.
     197    psS32 n3,  ///< The order of the y term in the transform.
     198    psS32 n4   ///< The order of the z term in the transform.
    199199);
    200200
  • trunk/psLib/src/astronomy/psMetadata.c

    r2040 r2204  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2004-10-09 03:05:53 $
     14*  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2004-10-27 00:57:30 $
    1616*
    1717*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5959/*****************************************************************************/
    6060
    61 static int metadataId = 0;
     61static psS32 metadataId = 0;
    6262
    6363/*****************************************************************************/
     
    143143
    144144    // Set metadata item unique id
    145     *(int *)(&metadataItem->id) = ++metadataId;
     145    *(psS32 *)(&metadataItem->id) = ++metadataId;
    146146
    147147    // Set metadata item type
     
    154154        break;
    155155    case PS_META_BOOL:
    156         metadataItem->data.B = (bool)va_arg(argPtr, int);
     156        metadataItem->data.B = (psBool)va_arg(argPtr, psS32);
    157157        break;
    158158    case PS_META_S32:
     
    215215}
    216216
    217 bool psMetadataAddItem( psMetadata *restrict md, psMetadataItem *restrict metadataItem, int location )
     217psBool psMetadataAddItem( psMetadata *restrict md, psMetadataItem *restrict metadataItem, psS32 location )
    218218{
    219219    char * key = NULL;
     
    337337}
    338338
    339 bool psMetadataAdd(psMetadata* restrict md, int where, const char *name, psMetadataType type,
    340                    const char *comment, ...)
     339psBool psMetadataAdd(psMetadata* restrict md, psS32 where, const char *name, psMetadataType type,
     340                     const char *comment, ...)
    341341{
    342342    va_list argPtr;
     
    359359}
    360360
    361 bool psMetadataRemove(psMetadata* restrict md, int where, const char *restrict key)
    362 {
    363     int numChildren = 0;
     361psBool psMetadataRemove(psMetadata* restrict md, psS32 where, const char *restrict key)
     362{
     363    psS32 numChildren = 0;
    364364    psList* mdList = NULL;
    365365    psHash* mdTable = NULL;
     
    471471}
    472472
    473 psMetadataItem* psMetadataGet(psMetadata* restrict md, int where)
     473psMetadataItem* psMetadataGet(psMetadata* restrict md, psS32 where)
    474474{
    475475    psList* mdList = NULL;
     
    497497}
    498498
    499 bool psMetadataSetIterator(psMetadata* restrict md, int where)
     499psBool psMetadataSetIterator(psMetadata* restrict md, psS32 where)
    500500{
    501501    psList* mdList = NULL;
     
    517517}
    518518
    519 psMetadataItem* psMetadataGetNext(psMetadata* restrict md, const char *restrict match, int which)
     519psMetadataItem* psMetadataGetNext(psMetadata* restrict md, const char *restrict match, psS32 which)
    520520{
    521521    psList* mdList = NULL;
     
    553553}
    554554
    555 psMetadataItem* psMetadataGetPrevious(psMetadata* restrict md, const char *restrict match, int which)
     555psMetadataItem* psMetadataGetPrevious(psMetadata* restrict md, const char *restrict match, psS32 which)
    556556{
    557557    psList* mdList = NULL;
  • trunk/psLib/src/astronomy/psMetadata.h

    r1970 r2204  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-10-06 01:06:27 $
     13*  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-10-27 00:57:30 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3838    PS_META_F32,                       ///< Single-precision float data.
    3939    PS_META_F64,                       ///< Double-precision float data.
    40     PS_META_STR,                       ///< String data (Stored in as void *).
    41     PS_META_VEC,                       ///< Vector data (Stored in as void *).
    42     PS_META_IMG,                       ///< Image data (Stored in as void *).
    43     PS_META_JPEG,                      ///< JPEG data (Stored in as void *).
    44     PS_META_PNG,                       ///< PNG data (Stored in as void *).
    45     PS_META_ASTROM,                    ///< Astrometric coefficients (Stored in as void *).
    46     PS_META_UNKNOWN,                   ///< Other data (Stored in as void *).
     40    PS_META_STR,                       ///< String data (Stored in as psPtr ).
     41    PS_META_VEC,                       ///< Vector data (Stored in as psPtr ).
     42    PS_META_IMG,                       ///< Image data (Stored in as psPtr ).
     43    PS_META_JPEG,                      ///< JPEG data (Stored in as psPtr ).
     44    PS_META_PNG,                       ///< PNG data (Stored in as psPtr ).
     45    PS_META_ASTROM,                    ///< Astrometric coefficients (Stored in as psPtr ).
     46    PS_META_UNKNOWN,                   ///< Other data (Stored in as psPtr ).
    4747    PS_META_NTYPE                      ///< Number of types. Must be last.
    4848} psMetadataType;
     
    5555typedef struct psMetadataItem
    5656{
    57     const int id;                      ///< Unique ID for metadata item.
     57    const psS32 id;                      ///< Unique ID for metadata item.
    5858    char *restrict name;               ///< Name of metadata item.
    5959    psMetadataType type;               ///< Type of metadata item.
    6060    union {
    61         bool B;                        ///< boolean data
     61        psBool B;                        ///< boolean data
    6262        psS32 S32;                     ///< Signed 32-bit integer data.
    6363        psF32 F32;                     ///< Single-precision float data.
    6464        psF64 F64;                     ///< Double-precision float data.
    65         psPTR V;                       ///< Pointer to other type of data.
     65        psPtr V;                       ///< Pointer to other type of data.
    6666    } data;                            ///< Union for data types.
    6767    char *comment;                     ///< Optional comment ("", not NULL).
     
    144144 *  @return bool: True for success, false for failure.
    145145 */
    146 bool psMetadataAddItem(
     146psBool psMetadataAddItem(
    147147    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
    148148    psMetadataItem* restrict item,     ///< Metadata item to be added.
    149     int location                       ///< Location to be added.
     149    psS32 location                       ///< Location to be added.
    150150);
    151151
     
    156156 * @return bool: True for success, false for failure.
    157157 */
    158 bool psMetadataAdd(
    159     psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
    160     int where,                         ///< Location to be added.
     158psBool psMetadataAdd(
     159    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
     160    psS32 where,                         ///< Location to be added.
    161161    const char *name,                  ///< Name of metadata item.
    162162    psMetadataType type,               ///< Type of metadata item.
     
    175175 * @return bool: True for success, false for failure.
    176176 */
    177 bool psMetadataRemove(
    178     psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
    179     int where,                         ///< Location to be removed.
     177psBool psMetadataRemove(
     178    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
     179    psS32 where,                         ///< Location to be removed.
    180180    const char *restrict key           ///< Name of metadata key.
    181181);
     
    203203psMetadataItem* psMetadataGet(
    204204    psMetadata* restrict md,           ///< Metadata collection to insert metadat item.
    205     int where                          ///< Location to be retrieved.
     205    psS32 where                          ///< Location to be retrieved.
    206206);
    207207
     
    213213 * @return void: void.
    214214 */
    215 bool psMetadataSetIterator(
     215psBool psMetadataSetIterator(
    216216    psMetadata* restrict md,           ///< Metadata collection to iterate.
    217     int where                          ///< Location of iterator.
     217    psS32 where                          ///< Location of iterator.
    218218);
    219219
     
    227227    psMetadata* restrict md,           ///< Metadata collection to iterate.
    228228    const char *restrict match,        ///< Beginning of key name.
    229     int which                          ///< Iterator to be used.
     229    psS32 which                          ///< Iterator to be used.
    230230);
    231231
     
    239239    psMetadata* restrict md,           ///< Metadata collection to iterate.
    240240    const char *restrict match,        ///< Beginning of key name.
    241     int which                          ///< Iterator to be used.
     241    psS32 which                          ///< Iterator to be used.
    242242);
    243243
  • trunk/psLib/src/astronomy/psMetadataIO.c

    r2014 r2204  
    99*  @author Ross Harman, MHPCC
    1010*
    11 *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-10-08 00:43:12 $
     11*  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-10-27 00:57:30 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    104104/** Determines if a line is blank (whitespace only) or a commentline. It returns true if so. The input string
    105105 *  must be null terminated. */
    106 bool ignoreLine(char *inString)
     106psBool ignoreLine(char *inString)
    107107{
    108108    while(*inString!='\0' && *inString!='#') {
     
    119119/** Removes leading and trailing whitespace and # characters from a string. The cleaned string is a new null
    120120 *  terminated copy of the original input string. */
    121 char *cleanString(char *inString, int sLen)
     121char *cleanString(char *inString, psS32 sLen)
    122122{
    123123    char *ptrB = NULL;
     
    149149
    150150/** Count repeat occurances of a single character within a line. The input string must be null terminated. */
    151 int repeatedChars(char *inString, char ch)
    152 {
    153     int count = 0;
     151psS32 repeatedChars(char *inString, char ch)
     152{
     153    psS32 count = 0;
    154154
    155155
     
    166166/** Returns cleaned token based on delimiter, but not including delimiter. Also changes the pointer location
    167167 * the beginning of the string. Tokens are newly allocated null terminated strings. */
    168 char* getToken(char **inString, char *delimiter, int *status)
     168char* getToken(char **inString, char *delimiter, psS32 *status)
    169169{
    170170    char *cleanToken = NULL;
    171     int sLen = 0;
     171    psS32 sLen = 0;
    172172
    173173
     
    195195/** Returns single parsed value as a double precision number. The input string must be cleaned and null
    196196 * terminated. */
    197 double parseValue(char *inString, int *status)
     197double parseValue(char *inString, psS32 *status)
    198198{
    199199    char *end = NULL;
     
    212212
    213213/** Returns true or false. 'T', 't', '1', 'F', 'f', and '0' are acceptable, parsable variations. */
    214 bool parseBool(char *inString, int *status)
    215 {
    216     bool value = false;
     214psBool parseBool(char *inString, psS32 *status)
     215{
     216    psBool value = false;
    217217
    218218
     
    229229
    230230/** Returns parsed vector filled with with data. The input string must be null terminated. */
    231 psVector* parseVector(char *inString, psElemType elemType, int *status)
     231psVector* parseVector(char *inString, psElemType elemType, psS32 *status)
    232232{
    233233    char *end = NULL;
    234234    char *saveValue = NULL;
    235     int i = 0;
    236     int numValues = 0;
     235    psS32 i = 0;
     236    psS32 numValues = 0;
    237237    double value = 0.0;
    238238    psVector *vec = NULL;
     
    341341
    342342
    343 psMetadata* psMetadataReadHeader(psMetadata* output, char *extName, int extNum, char *fileName)
    344 {
    345     bool tempBool;
    346     bool success;
     343psMetadata* psMetadataReadHeader(psMetadata* output, char *extName, psS32 extNum, char *fileName)
     344{
     345    psBool tempBool;
     346    psBool success;
    347347    char keyType;
    348348    char keyName[FITS_LINE_SIZE];
     
    350350    char keyComment[FITS_LINE_SIZE];
    351351    char fitsErr[MAX_STRING_LENGTH];
    352     int i;
    353     int hduType = 0;
    354     int status = 0;
    355     int numKeys = 0;
    356     int keyNum = 0;
     352    psS32 i;
     353    psS32 hduType = 0;
     354    psS32 status = 0;
     355    psS32 numKeys = 0;
     356    psS32 keyNum = 0;
    357357    psMetadataType metadataItemType;
    358358    fitsfile *fd = NULL;
     
    449449
    450450
    451 int psMetadataParseConfig(psMetadata** md, char *fileName, bool overwrite)
    452 {
    453     bool tempBool;
     451psS32 psMetadataParseConfig(psMetadata** md, char *fileName, psBool overwrite)
     452{
     453    psBool tempBool;
    454454    char *line = NULL;
    455455    char *strName = NULL;
     
    458458    char *strComment = NULL;
    459459    char *linePtr = NULL;
    460     int status = 0;
    461     int lineCount = 0;
    462     int failedLines = 0;
     460    psS32 status = 0;
     461    psS32 lineCount = 0;
     462    psS32 failedLines = 0;
    463463    psF64 tempDbl = 0.0;
    464464    psS32 tempInt = 0.0;
  • trunk/psLib/src/astronomy/psMetadataIO.h

    r1973 r2204  
    99*  @author Ross Harman, MHPCC
    1010*
    11 *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-10-06 01:17:39 $
     11*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-10-27 00:57:30 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5050    psMetadata* output,                ///< Resulting metadata from read.
    5151    char *extName,                     ///< File name extension string.
    52     int extNum,                        ///< File name extension number. Starts at 1.
     52    psS32 extNum,                        ///< File name extension number. Starts at 1.
    5353    char *fileName                     ///< Name of file to read.
    5454);
     
    5858 *  Loads pre-defined settings by parsing a configuration file into a psMetadata structure.
    5959 *
    60  *  @return int : Number of lines that failed to be read.
     60 *  @return psS32 : Number of lines that failed to be read.
    6161 */
    62 int psMetadataParseConfig(
     62psS32 psMetadataParseConfig(
    6363    psMetadata** md,                   ///< Resulting metadata from read.
    6464    char *fileName,                    ///< Name of file to read.
    65     bool overwrite                     ///< Allow overwrite of duplicate specifications.
     65    psBool overwrite                     ///< Allow overwrite of duplicate specifications.
    6666);
    6767
  • trunk/psLib/src/astronomy/psPhotometry.h

    r1441 r2204  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-08-09 23:40:54 $
     12*  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-27 00:57:30 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4343typedef struct
    4444{
    45     const int ID;               ///< ID number for this photometric system
     45    const psS32 ID;               ///< ID number for this photometric system
    4646    const char *name;           ///< Name of photometric system
    4747    const char *camera;         ///< Camera for photometric system
  • trunk/psLib/src/astronomy/psTime.c

    r2196 r2204  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-10-26 00:37:44 $
     13 *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-10-27 00:57:30 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    144144static double lookupSer7Table(
    145145    const psTime *time,                 ///< time to lookup.
    146     int col                             ///< Column to lookup.
     146    psS32 col                             ///< Column to lookup.
    147147);
    148148
     
    150150{
    151151    char line[LINESIZE];
    152     int j = 0;
    153     int maxLines = 100;
     152    psS32 j = 0;
     153    psS32 maxLines = 100;
    154154    psF64 *ptr = NULL;
    155155    psImage *table = NULL;
     
    180180    }
    181181
    182     *(unsigned int *)&table->numRows = j;
     182    *(psU32 *)&table->numRows = j;
    183183
    184184    p_psMemSetPersistent(table,true);
     
    191191static psImage* readSer7File(const char *fileName)
    192192{
    193     bool beginRecord = false;
     193    psBool beginRecord = false;
    194194    char line[LINESIZE];
    195     int j = 0;
    196     int maxLines = 400;
     195    psS32 j = 0;
     196    psS32 maxLines = 400;
    197197    psImage *table = NULL;
    198198    FILE *fd = NULL;
     
    231231        }
    232232    }
    233     *(unsigned int *)&table->numRows = j;
     233    *(psU32 *)&table->numRows = j;
    234234
    235235    p_psMemSetPersistent(table,true);
     
    244244{
    245245    char line[LINESIZE];
    246     int i = 0;
    247     int j = 0;
    248     int maxLines = 2500;
     246    psS32 i = 0;
     247    psS32 j = 0;
     248    psS32 maxLines = 2500;
    249249    psImage *table = NULL;
    250250    FILE *fd = NULL;
     
    276276    }
    277277 
    278     *(unsigned int *)&table->numRows = j;
     278    *(psU32 *)&table->numRows = j;
    279279 
    280280    return table;
     
    284284{
    285285    char line[LINESIZE];
    286     int j = 0;
    287     int maxLines = 15000;
     286    psS32 j = 0;
     287    psS32 maxLines = 15000;
    288288    psImage *table = NULL;
    289289    FILE *fd = NULL;
     
    346346    }
    347347 
    348     *(unsigned int *)&table->numRows = j;
     348    *(psU32 *)&table->numRows = j;
    349349 
    350350    return table;
     
    354354static double lookupTaiUtcTable(const psTime *time)
    355355{
    356     int hiIdx = 0;
    357     int loIdx = 0;
    358     int numRows = 0;
     356    psS32 hiIdx = 0;
     357    psS32 loIdx = 0;
     358    psS32 numRows = 0;
    359359    double jd = 0.0;
    360360    double mjd = 0.0;
     
    422422}
    423423
    424 static double lookupSer7Table(const psTime *time, int col)
    425 {
    426     int hiIdx = 0;
    427     int loIdx = 0;
    428     int numRows = 0;
     424static double lookupSer7Table(const psTime *time, psS32 col)
     425{
     426    psS32 hiIdx = 0;
     427    psS32 loIdx = 0;
     428    psS32 numRows = 0;
    429429    double out = 0.0;
    430430    double denom = 0.0;
     
    752752}
    753753
    754 long psTimeLeapseconds(const psTime *time1, const psTime *time2)
    755 {
    756     long diff = 0;
     754psS64 psTimeLeapseconds(const psTime *time1, const psTime *time2)
     755{
     756    psS64 diff = 0;
    757757
    758758
     
    827827char* psTimeToISOTime(const psTime *time)
    828828{
    829     int ms = 0;
     829    psS32 ms = 0;
    830830    char *timeString = NULL;
    831831    char *tempString = NULL;
     
    889889struct tm* psTimeToTM(const psTime *time)
    890890{
    891     long cent = 0;
    892     long year = 0;
    893     long month = 0;
    894     long day = 0;
    895     long hour = 0;
    896     long minute = 0;
    897     long seconds = 0;
    898     long temp = 0;
     891    psS64 cent = 0;
     892    psS64 year = 0;
     893    psS64 month = 0;
     894    psS64 day = 0;
     895    psS64 hour = 0;
     896    psS64 minute = 0;
     897    psS64 seconds = 0;
     898    psS64 temp = 0;
    899899    struct tm* tmTime = NULL;
    900900
     
    975975    seconds = days * SEC_PER_DAY;
    976976    if(seconds < 0.0) {
    977         outTime->usec = (seconds - (long)seconds) * -1000000.0;  // psTime earlier than epoch
     977        outTime->usec = (seconds - (psS64)seconds) * -1000000.0;  // psTime earlier than epoch
    978978    } else {
    979         outTime->usec = (seconds - (long)seconds) * 1000000.0;   // psTime greater than epoch
     979        outTime->usec = (seconds - (psS64)seconds) * 1000000.0;   // psTime greater than epoch
    980980    }
    981981    outTime->sec = seconds;
     
    10031003    seconds = days * SEC_PER_DAY;
    10041004    if(seconds < 0.0) {
    1005         outTime->usec = (seconds - (long)seconds) * -1000000.0;  // psTime earlier than epoch
     1005        outTime->usec = (seconds - (psS64)seconds) * -1000000.0;  // psTime earlier than epoch
    10061006    } else {
    1007         outTime->usec = (seconds - (long)seconds) * 1000000.0;   // psTime greater than epoch
     1007        outTime->usec = (seconds - (psS64)seconds) * 1000000.0;   // psTime greater than epoch
    10081008    }
    10091009    outTime->sec = seconds;
     
    10201020{
    10211021    char tempString[MAX_TIME_STRING_LENGTH];
    1022     int month;
    1023     int day;
    1024     int year;
    1025     int hour;
    1026     int minute;
    1027     int second;
    1028     int millisecond;
     1022    psS32 month;
     1023    psS32 day;
     1024    psS32 year;
     1025    psS32 hour;
     1026    psS32 minute;
     1027    psS32 second;
     1028    psS32 millisecond;
    10291029    struct tm tmTime;
    10301030    psTime *outTime = NULL;
     
    11271127psTime* psTimeFromTM(const struct tm* time)
    11281128{
    1129     long year;
    1130     long month;
    1131     long day;
    1132     long hour;
    1133     long minute;
    1134     long seconds;
    1135     long temp;
     1129    psS64 year;
     1130    psS64 month;
     1131    psS64 day;
     1132    psS64 hour;
     1133    psS64 minute;
     1134    psS64 seconds;
     1135    psS64 temp;
    11361136    psTime *outTime = NULL;
    11371137
     
    11941194{
    11951195    psF64 deltaSec = 0;
    1196     long deltaUsec = 0;
     1196    psS64 deltaUsec = 0;
    11971197    psTime *outTime = NULL;
    11981198
     
    12431243{
    12441244    psS64 deltaSec = 0;
    1245     long deltaUsec = 0;
     1245    psS64 deltaUsec = 0;
    12461246    psTime *outTime = NULL;
    12471247
     
    12671267    outTime = psTimeAlloc(tai1->type);
    12681268    deltaSec = tai1->sec - tai2->sec;
    1269     deltaUsec = (long)tai1->usec - (long)tai2->usec;
     1269    deltaUsec = (psS64)tai1->usec - (psS64)tai2->usec;
    12701270
    12711271    // Adjust time in case of microsecond underflow after subtraction
     
    12891289{
    12901290    psS64 deltaSec = 0;
    1291     long deltaUsec = 0;
     1291    psS64 deltaUsec = 0;
    12921292    psTime *outTime = NULL;
    12931293
     
    13131313    outTime = psTimeAlloc(tai1->type);
    13141314    deltaSec = tai1->sec - tai2->sec;
    1315     deltaUsec = (long)tai1->usec - (long)tai2->usec;
     1315    deltaUsec = (psS64)tai1->usec - (psS64)tai2->usec;
    13161316
    13171317    // Adjust time in case of microsecond underflow after subtraction
  • trunk/psLib/src/astronomy/psTime.h

    r2179 r2204  
    5454 *  @author Ross Harman, MHPCC
    5555 *
    56  *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    57  *  @date $Date: 2004-10-20 20:05:58 $
     56 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     57 *  @date $Date: 2004-10-27 00:57:30 $
    5858 *
    5959 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    181181 *  @return  long: leapseconds added between given times
    182182 */
    183 long psTimeLeapseconds(
     183psS64 psTimeLeapseconds(
    184184    const psTime* time1,                ///< First input time.
    185185    const psTime* time2                 ///< Second input time.
Note: See TracChangeset for help on using the changeset viewer.