IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29317


Ignore:
Timestamp:
Oct 4, 2010, 4:29:04 PM (16 years ago)
Author:
rhenders
Message:

Using more generic id rather than expid; storing surveyID and today's date

Location:
trunk/ippToPsps/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/src/ippToPsps.c

    r29294 r29317  
    3030    if (!isfinite(*flux) || *flux < 0.000001) return false;
    3131    if (fluxErr) *fluxErr = fabsf((magnitudeErr * *flux)/1.085736);
    32       if (fluxErr)    printf("Mag = %03.03f, Flux = %03.03f, Mag err = %03.03f, Flux Err = %03.03f\n", magnitude, *flux, magnitudeErr, *fluxErr);
     32//      if (fluxErr)    printf("Mag = %03.03f, Flux = %03.03f, Mag err = %03.03f, Flux Err = %03.03f\n", magnitude, *flux, magnitudeErr, *fluxErr);
    3333
    3434    return true;
     
    162162
    163163    psMetadata *arguments = psMetadataAlloc();
    164     psMetadataAddStr(arguments, PS_LIST_TAIL, "-expid", 0, "Exposure ID", NULL);
     164    psMetadataAddStr(arguments, PS_LIST_TAIL, "-id", 0, "ID", NULL);
    165165    psMetadataAddStr(arguments, PS_LIST_TAIL, "-expname", 0, "Exposure name", NULL);
    166166    psMetadataAddStr(arguments, PS_LIST_TAIL, "-survey", 0, "Survey type", NULL);
     
    179179    else {
    180180
    181         char *tmp = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-expid"));
    182         if (tmp) this->expId = atoi(tmp);
     181        char *tmp = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-id"));
     182        if (tmp) this->id = atoi(tmp);
    183183        //free(tmp); tmp = NULL;
    184184        this->expName = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-expname"));
     
    203203                (this->batchType != BATCH_INIT && !this->fitsInPath) ||
    204204                (this->batchType != BATCH_INIT && !this->resultsPath) ||
    205                 (this->batchType != BATCH_INIT && this->expId == -1) ||
     205                (this->batchType != BATCH_INIT && this->id == -1) ||
    206206                !this->fitsOutPath ||
    207207                !this->configsDir ||
     
    284284
    285285    // remaining args
    286     this->expId = -1;
     286    this->id = -1;
    287287    this->expName = NULL;
    288288    this->surveyType = NULL;
     289    this->surveyID = -1;
    289290    this->fitsInPath = NULL;
    290291    this->resultsPath = NULL;
     
    300301    this->run = ippToPsps_run;
    301302
     303    // sort out current time
     304    time_t now = time(NULL);;
     305    struct tm *ts = gmtime(&now); // TODO should be UTC
     306    strftime(this->todaysDate, sizeof(this->todaysDate), "%Y-%m-%d", ts);
     307
    302308    if (!this->pmconfig) {
    303309
     
    333339    // create filename
    334340    char outputName[100];
    335     sprintf(outputName, "%08d.FITS", this->expId);
     341    sprintf(outputName, "%08d.FITS", this->id);
    336342    psStringAppend(&this->fitsOutPath, "/%s", outputName);
    337343
     
    353359    }
    354360
     361    // get survey ID using config object
     362    if (this->batchType != BATCH_INIT &&
     363            !ippToPspsConfig_getSurveyId(this->config, this->surveyType, &this->surveyID)) {
     364       
     365        this->exitCode = PS_EXIT_CONFIG_ERROR;
     366        return this;
     367    }
     368
    355369    // create XML document for results
    356370    if (this->resultsPath) {
  • trunk/ippToPsps/src/ippToPsps.h

    r29297 r29317  
    2222typedef struct {
    2323
    24     uint32_t expId;             // the exposure ID to be used
     24    uint32_t id;                 // ID: might be expId for detections, skycell ID etc
    2525    psString expName;           // the exposure name
    2626    psString surveyType;        // the survey type, eg 3PI, MD01, STS, SSS
     27    int8_t surveyID;            // survey ID
    2728    uint8_t batchType;          // PSPS batch type
    2829    psString fitsInPath;        // path to FITS input
     
    3738    dvoConfig* dvoConfig;       // dvo database
    3839    IppToPspsConfig* config;    // config structure
     40    char todaysDate[12];        // today's date
    3941    int exitCode;               // ps exit code
    4042
Note: See TracChangeset for help on using the changeset viewer.