IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12260


Ignore:
Timestamp:
Mar 5, 2007, 5:42:40 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION 1.1.16

Location:
trunk/ippdb
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/configure.ac

    r12202 r12260  
    77AC_PREREQ(2.59)
    88
    9 AC_INIT([ippdb], [1.1.15], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [1.1.16], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • trunk/ippdb/src/ippdb.c

    r12236 r12260  
    35263526static void rawExpRowFree(rawExpRow *object);
    35273527
    3528 rawExpRow *rawExpRowAlloc(const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles, const char *workdir, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *object, psF32 solang, psS16 fault)
     3528rawExpRow *rawExpRowAlloc(const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles, const char *filelevel, const char *workdir, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *object, psF32 solang, psS16 fault)
    35293529{
    35303530    rawExpRow       *_object;
     
    35403540    _object->exp_type = psStringCopy(exp_type);
    35413541    _object->imfiles = imfiles;
     3542    _object->filelevel = psStringCopy(filelevel);
    35423543    _object->workdir = psStringCopy(workdir);
    35433544    _object->filter = psStringCopy(filter);
     
    35683569    psFree(object->dateobs);
    35693570    psFree(object->exp_type);
     3571    psFree(object->filelevel);
    35703572    psFree(object->workdir);
    35713573    psFree(object->filter);
     
    36113613        return false;
    36123614    }
     3615    if (!psMetadataAdd(md, PS_LIST_TAIL, "filelevel", PS_DATA_STRING, NULL, "64")) {
     3616        psError(PS_ERR_UNKNOWN, false, "failed to add item filelevel");
     3617        psFree(md);
     3618        return false;
     3619    }
    36133620    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, "destination for output files", "255")) {
    36143621        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     
    37043711}
    37053712
    3706 bool rawExpInsert(psDB * dbh, const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles, const char *workdir, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *object, psF32 solang, psS16 fault)
     3713bool rawExpInsert(psDB * dbh, const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles, const char *filelevel, const char *workdir, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *object, psF32 solang, psS16 fault)
    37073714{
    37083715    psMetadata *md = psMetadataAlloc();
     
    37393746    if (!psMetadataAdd(md, PS_LIST_TAIL, "imfiles", PS_DATA_S32, NULL, imfiles)) {
    37403747        psError(PS_ERR_UNKNOWN, false, "failed to add item imfiles");
     3748        psFree(md);
     3749        return false;
     3750    }
     3751    if (!psMetadataAdd(md, PS_LIST_TAIL, "filelevel", PS_DATA_STRING, NULL, filelevel)) {
     3752        psError(PS_ERR_UNKNOWN, false, "failed to add item filelevel");
    37413753        psFree(md);
    37423754        return false;
     
    38453857bool rawExpInsertObject(psDB *dbh, rawExpRow *object)
    38463858{
    3847     return rawExpInsert(dbh, object->exp_tag, object->exp_id, object->camera, object->telescope, object->dateobs, object->exp_type, object->imfiles, object->workdir, object->filter, object->airmass, object->ra, object->decl, object->exp_time, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->object, object->solang, object->fault);
     3859    return rawExpInsert(dbh, object->exp_tag, object->exp_id, object->camera, object->telescope, object->dateobs, object->exp_type, object->imfiles, object->filelevel, object->workdir, object->filter, object->airmass, object->ra, object->decl, object->exp_time, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->object, object->solang, object->fault);
    38483860}
    38493861
     
    39533965        return false;
    39543966    }
     3967    if (!psMetadataAdd(md, PS_LIST_TAIL, "filelevel", PS_DATA_STRING, NULL, object->filelevel)) {
     3968        psError(PS_ERR_UNKNOWN, false, "failed to add item filelevel");
     3969        psFree(md);
     3970        return false;
     3971    }
    39553972    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, object->workdir)) {
    39563973        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     
    40774094        return false;
    40784095    }
     4096    char* filelevel = psMetadataLookupPtr(&status, md, "filelevel");
     4097    if (!status) {
     4098        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item filelevel");
     4099        return false;
     4100    }
    40794101    char* workdir = psMetadataLookupPtr(&status, md, "workdir");
    40804102    if (!status) {
     
    41584180    }
    41594181
    4160     return rawExpRowAlloc(exp_tag, exp_id, camera, telescope, dateobs, exp_type, imfiles, workdir, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, object, solang, fault);
     4182    return rawExpRowAlloc(exp_tag, exp_id, camera, telescope, dateobs, exp_type, imfiles, filelevel, workdir, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, object, solang, fault);
    41614183}
    41624184psArray *rawExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    42704292static void rawImfileRowFree(rawImfileRow *object);
    42714293
    4272 rawImfileRow *rawImfileRowAlloc(const char *exp_tag, const char *class, const char *class_id, const char *uri, const char *exp_type, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *object, psTime* dateobs, psS16 fault)
     4294rawImfileRow *rawImfileRowAlloc(const char *exp_tag, const char *class_id, const char *uri, const char *exp_type, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *object, psTime* dateobs, psS16 fault)
    42734295{
    42744296    rawImfileRow    *_object;
     
    42784300
    42794301    _object->exp_tag = psStringCopy(exp_tag);
    4280     _object->class = psStringCopy(class);
    42814302    _object->class_id = psStringCopy(class_id);
    42824303    _object->uri = psStringCopy(uri);
     
    43044325{
    43054326    psFree(object->exp_tag);
    4306     psFree(object->class);
    43074327    psFree(object->class_id);
    43084328    psFree(object->uri);
     
    43214341        return false;
    43224342    }
    4323     if (!psMetadataAdd(md, PS_LIST_TAIL, "class", PS_DATA_STRING, NULL, "64")) {
    4324         psError(PS_ERR_UNKNOWN, false, "failed to add item class");
    4325         psFree(md);
    4326         return false;
    4327     }
    43284343    if (!psMetadataAdd(md, PS_LIST_TAIL, "class_id", PS_DATA_STRING, "Primary Key", "64")) {
    43294344        psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
     
    44294444}
    44304445
    4431 bool rawImfileInsert(psDB * dbh, const char *exp_tag, const char *class, const char *class_id, const char *uri, const char *exp_type, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *object, psTime* dateobs, psS16 fault)
     4446bool rawImfileInsert(psDB * dbh, const char *exp_tag, const char *class_id, const char *uri, const char *exp_type, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *object, psTime* dateobs, psS16 fault)
    44324447{
    44334448    psMetadata *md = psMetadataAlloc();
    44344449    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_tag", PS_DATA_STRING, NULL, exp_tag)) {
    44354450        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
    4436         psFree(md);
    4437         return false;
    4438     }
    4439     if (!psMetadataAdd(md, PS_LIST_TAIL, "class", PS_DATA_STRING, NULL, class)) {
    4440         psError(PS_ERR_UNKNOWN, false, "failed to add item class");
    44414451        psFree(md);
    44424452        return false;
     
    45554565bool rawImfileInsertObject(psDB *dbh, rawImfileRow *object)
    45564566{
    4557     return rawImfileInsert(dbh, object->exp_tag, object->class, object->class_id, object->uri, object->exp_type, object->filter, object->airmass, object->ra, object->decl, object->exp_time, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->object, object->dateobs, object->fault);
     4567    return rawImfileInsert(dbh, object->exp_tag, object->class_id, object->uri, object->exp_type, object->filter, object->airmass, object->ra, object->decl, object->exp_time, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->object, object->dateobs, object->fault);
    45584568}
    45594569
     
    46334643        return false;
    46344644    }
    4635     if (!psMetadataAdd(md, PS_LIST_TAIL, "class", PS_DATA_STRING, NULL, object->class)) {
    4636         psError(PS_ERR_UNKNOWN, false, "failed to add item class");
    4637         psFree(md);
    4638         return false;
    4639     }
    46404645    if (!psMetadataAdd(md, PS_LIST_TAIL, "class_id", PS_DATA_STRING, NULL, object->class_id)) {
    46414646        psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
     
    47424747        return false;
    47434748    }
    4744     char* class = psMetadataLookupPtr(&status, md, "class");
    4745     if (!status) {
    4746         psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item class");
    4747         return false;
    4748     }
    47494749    char* class_id = psMetadataLookupPtr(&status, md, "class_id");
    47504750    if (!status) {
     
    48384838    }
    48394839
    4840     return rawImfileRowAlloc(exp_tag, class, class_id, uri, exp_type, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, object, dateobs, fault);
     4840    return rawImfileRowAlloc(exp_tag, class_id, uri, exp_type, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, object, dateobs, fault);
    48414841}
    48424842psArray *rawImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r12236 r12260  
    20042004    char            *exp_type;
    20052005    psS32           imfiles;
     2006    char            *filelevel;
    20062007    char            *workdir;
    20072008    char            *filter;
     
    20352036    const char      *exp_type,
    20362037    psS32           imfiles,
     2038    const char      *filelevel,
    20372039    const char      *workdir,
    20382040    const char      *filter,
     
    20872089    const char      *exp_type,
    20882090    psS32           imfiles,
     2091    const char      *filelevel,
    20892092    const char      *workdir,
    20902093    const char      *filter,
     
    22592262typedef struct {
    22602263    char            *exp_tag;
    2261     char            *class;
    22622264    char            *class_id;
    22632265    char            *uri;
     
    22872289rawImfileRow *rawImfileRowAlloc(
    22882290    const char      *exp_tag,
    2289     const char      *class,
    22902291    const char      *class_id,
    22912292    const char      *uri,
     
    23362337    psDB            *dbh,               ///< Database handle
    23372338    const char      *exp_tag,
    2338     const char      *class,
    23392339    const char      *class_id,
    23402340    const char      *uri,
  • trunk/ippdb/tests/alloc.c

    r12236 r12260  
    311311        rawExpRow       *object;
    312312
    313         object = rawExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", 32.32, -16    );
     313        object = rawExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", 32.32, -16    );
    314314
    315315        if (!object) {
     
    344344            exit(EXIT_FAILURE);
    345345        }
     346        if (strncmp(object->filelevel, "a string", MAX_STRING_LENGTH)) {
     347            psFree(object);
     348            exit(EXIT_FAILURE);
     349        }
    346350        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
    347351            psFree(object);
     
    415419        rawImfileRow    *object;
    416420
    417         object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", -16    );
     421        object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", -16    );
    418422
    419423        if (!object) {
     
    422426
    423427        if (strncmp(object->exp_tag, "a string", MAX_STRING_LENGTH)) {
    424             psFree(object);
    425             exit(EXIT_FAILURE);
    426         }
    427         if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) {
    428428            psFree(object);
    429429            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r12236 r12260  
    148148        }
    149149
    150         if (!rawExpInsert(dbh, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", 32.32, -16)) {
    151             exit(EXIT_FAILURE);
    152         }
    153 
    154         psDBCleanup(dbh);
    155     }
    156 
    157     {
    158         psDB            *dbh;
    159 
    160         dbh = psDBInit("localhost", "test", NULL, "test");
    161         if (!dbh) {
    162             exit(EXIT_FAILURE);
    163         }
    164 
    165         if (!rawImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", -16)) {
     150        if (!rawExpInsert(dbh, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", 32.32, -16)) {
     151            exit(EXIT_FAILURE);
     152        }
     153
     154        psDBCleanup(dbh);
     155    }
     156
     157    {
     158        psDB            *dbh;
     159
     160        dbh = psDBInit("localhost", "test", NULL, "test");
     161        if (!dbh) {
     162            exit(EXIT_FAILURE);
     163        }
     164
     165        if (!rawImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", -16)) {
    166166            exit(EXIT_FAILURE);
    167167        }
  • trunk/ippdb/tests/insertobject.c

    r12236 r12260  
    212212        }
    213213
    214         object = rawExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", 32.32, -16);
     214        object = rawExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", 32.32, -16);
    215215        if (!object) {
    216216            exit(EXIT_FAILURE);
     
    234234        }
    235235
    236         object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", -16);
     236        object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", -16);
    237237        if (!object) {
    238238            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r12236 r12260  
    384384        bool            status;
    385385
    386         object = rawExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", 32.32, -16);
     386        object = rawExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", -32, "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", 32.32, -16);
    387387        if (!object) {
    388388            exit(EXIT_FAILURE);
     
    423423            exit(EXIT_FAILURE);
    424424        }
     425        if (strncmp(psMetadataLookupPtr(&status, md, "filelevel"), "a string", MAX_STRING_LENGTH)) {
     426            psFree(md);
     427            exit(EXIT_FAILURE);
     428        }
    425429        if (strncmp(psMetadataLookupPtr(&status, md, "workdir"), "a string", MAX_STRING_LENGTH)) {
    426430            psFree(md);
     
    495499        bool            status;
    496500
    497         object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", -16);
     501        object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string", "0001-01-01T00:00:00Z", -16);
    498502        if (!object) {
    499503            exit(EXIT_FAILURE);
     
    508512
    509513        if (strncmp(psMetadataLookupPtr(&status, md, "exp_tag"), "a string", MAX_STRING_LENGTH)) {
    510             psFree(md);
    511             exit(EXIT_FAILURE);
    512         }
    513         if (strncmp(psMetadataLookupPtr(&status, md, "class"), "a string", MAX_STRING_LENGTH)) {
    514514            psFree(md);
    515515            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r12236 r12260  
    566566            exit(EXIT_FAILURE);
    567567        }
     568        if (!psMetadataAddStr(md, PS_LIST_TAIL, "filelevel", 0, NULL, "a string")) {
     569            psFree(md);
     570            exit(EXIT_FAILURE);
     571        }
    568572        if (!psMetadataAddStr(md, PS_LIST_TAIL, "workdir", 0, NULL, "a string")) {
    569573            psFree(md);
     
    665669            exit(EXIT_FAILURE);
    666670        }
     671        if (strncmp(object->filelevel, "a string", MAX_STRING_LENGTH)) {
     672            psFree(object);
     673            exit(EXIT_FAILURE);
     674        }
    667675        if (strncmp(object->workdir, "a string", MAX_STRING_LENGTH)) {
    668676            psFree(object);
     
    741749            exit(EXIT_FAILURE);
    742750        }
    743         if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "a string")) {
    744             psFree(md);
    745             exit(EXIT_FAILURE);
    746         }
    747751        if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) {
    748752            psFree(md);
     
    825829
    826830        if (strncmp(object->exp_tag, "a string", MAX_STRING_LENGTH)) {
    827             psFree(object);
    828             exit(EXIT_FAILURE);
    829         }
    830         if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) {
    831831            psFree(object);
    832832            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.