IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28249


Ignore:
Timestamp:
Jun 7, 2010, 2:58:52 PM (16 years ago)
Author:
rhenders
Message:

Now pulling correct survey ID from init data

Location:
trunk/ippToPsps
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/scripts/ippToPsps_run.pl

    r28205 r28249  
    7070
    7171# make a temporary file for saving results
    72 my ($resultsFile, $resultsFileName) = tempfile( "/tmp/results.XXXX", UNLINK => !$save_temps);
     72my ($resultsFile, $resultsFileName) = tempfile( "/tmp/ippToPsps_results.XXXX", UNLINK => !$save_temps);
    7373
    7474process();
     
    8686    if ($distGroup =~ m/^MD([0-1][0-9])$/i) {return "MD$1";}
    8787    if ($distGroup =~ m/^M31$/i) {return "M31";}
    88     if ($distGroup =~ m/^sts$/i) {return "STS";}
     88    if ($distGroup =~ m/^sts$/i) {return "STS1";}
    8989    if ($distGroup =~ m/^SweetSpot$/i) {return "SSS";}
    9090    if ($distGroup =~ m/^(3PI)|(ThreePi)|(SAS)$/i) {return "3PI";}
     
    140140            AND chipRun.exp_id = rawExp.exp_id
    141141            AND camRun.dist_group = '$survey'   
    142             AND rawExp.exp_id > 145986
    143142            GROUP BY  rawExp.exp_id
    144143            ORDER BY rawExp.exp_id ASC;
     
    627626    my $fullJobPath = "$path/$job";
    628627
    629     my ($tempFile, $tempName) = tempfile( "/tmp/dsregList.XXXX", UNLINK => !$save_temps);
     628    my ($tempFile, $tempName) = tempfile( "/tmp/ippToPsps_dsregList.XXXX", UNLINK => !$save_temps);
    630629
    631630    # loop through all batch files in this job directory
     
    718717
    719718        # now write the path to this file out to temp file
    720         my ($tempFile, $tempName) = tempfile( "/tmp/inputFileList.XXXX", UNLINK => !$save_temps);
     719        my ($tempFile, $tempName) = tempfile( "/tmp/ippToPsps_inputFileList.XXXX", UNLINK => !$save_temps);
    721720        print $tempFile $realFile . "\n";
    722721        close $tempFile;
     
    794793    $command .= " -expid $expid";
    795794    $command .= " -expname $expName";
     795    $command .= " -survey $surveyType";
    796796    $command .= " -batch $batchType";
    797797    $command .= " -results $resultsFileName";
  • trunk/ippToPsps/src/ippToPsps.c

    r28205 r28249  
    9393    if (this->numOfInputFiles < 1) return false;
    9494
    95 
    9695    this->inputFiles = (char**)calloc(this->numOfInputFiles, sizeof(char*));
    9796    for(uint32_t i=0; i<this->numOfInputFiles; i++)
     
    145144    psMetadataAddStr(arguments, PS_LIST_TAIL, "-expid", 0, "Exposure ID", NULL);
    146145    psMetadataAddStr(arguments, PS_LIST_TAIL, "-expname", 0, "Exposure name", NULL);
     146    psMetadataAddStr(arguments, PS_LIST_TAIL, "-survey", 0, "Survey type", NULL);
    147147    psMetadataAddStr(arguments, PS_LIST_TAIL, "-input", 0, "Path to FITS inout", NULL);
    148148    psMetadataAddStr(arguments, PS_LIST_TAIL, "-output", 0, "Path to FITS output", NULL);
     
    163163        //free(tmp); tmp = NULL;
    164164        this->expName = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-expname"));
     165        this->surveyType = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-survey"));
    165166        this->fitsInPath = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-input"));
    166167        this->resultsPath = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-results"));
     
    179180        if (
    180181                (this->batchType != BATCH_INIT && !this->expName) ||
     182                (this->batchType != BATCH_INIT && !this->surveyType) ||
    181183                (this->batchType != BATCH_INIT && !this->fitsInPath) ||
    182184                (this->batchType != BATCH_INIT && !this->resultsPath) ||
     
    241243    this->expId = -1;
    242244    this->expName = NULL;
     245    this->surveyType = NULL;
    243246    this->fitsInPath = NULL;
    244247    this->resultsPath = NULL;
  • trunk/ippToPsps/src/ippToPsps.h

    r28205 r28249  
    2222    uint32_t expId;            // the exposure ID to be used
    2323    psString expName;          // the exposure name
     24    psString surveyType;       // the survey type, eg 3PI, MD01, STS, SSS
    2425    uint8_t batchType;         // PSPS batch type
    2526    psString fitsInPath;       // path to FITS input
  • trunk/ippToPsps/src/ippToPspsBatchDetection.c

    r28205 r28249  
    6565    fits_write_col(this->fitsOut, TSTRING, FRAMEMETA_FRAMENAME, 1, 1, 1, &this->expName, &status);
    6666
    67     int8_t surveyID = 0; // TODO
     67    int8_t surveyID = -1;
     68    if (!ippToPspsConfig_getSurveyId(this->config, this->surveyType, &surveyID)) {return PS_EXIT_DATA_ERROR;}
    6869    fits_write_col(this->fitsOut, TBYTE, FRAMEMETA_SURVEYID, 1, 1, 1, &surveyID, &status);
    6970
    7071    int8_t filterID = -1;
    71     ippToPspsConfig_getFilterId(this->config, filterType, &filterID);
     72    if (!ippToPspsConfig_getFilterId(this->config, filterType, &filterID)) {return PS_EXIT_DATA_ERROR;}
    7273    fits_write_col(this->fitsOut, TBYTE, FRAMEMETA_FILTERID, 1, 1, 1, &filterID, &status);
    7374
  • trunk/ippToPsps/src/ippToPspsConfig.c

    r27779 r28249  
    325325
    326326    return ret;
     327}
     328
     329// gets survey ID from survey name
     330bool ippToPspsConfig_getSurveyId(IppToPspsConfig* this, const char* surveyType, int8_t* surveyId) {
     331
     332    char buffer[10];
     333    if (!ippToPspsConfig_getInitValue(this, "Survey", "name", surveyType, "surveyID", buffer)) {
     334
     335        *surveyId = -1;
     336        return false;
     337    }
     338
     339    *surveyId = atoi(buffer);
     340    return true;
    327341}
    328342
  • trunk/ippToPsps/src/ippToPspsConfig.h

    r27345 r28249  
    5959// getters
    6060bool ippToPspsConfig_getFilterId(IppToPspsConfig* this, const char* filterType, int8_t* filterId);
     61bool ippToPspsConfig_getSurveyId(IppToPspsConfig* this, const char* surveyType, int8_t* surveyId);
    6162
    6263#endif // IPPTOPSPSCONFIG_H
Note: See TracChangeset for help on using the changeset viewer.