Changeset 29319 for trunk/ippToPsps/src/ippToPspsBatchStack.c
- Timestamp:
- Oct 4, 2010, 4:30:04 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/src/ippToPspsBatchStack.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/src/ippToPspsBatchStack.c
r29298 r29319 16 16 */ 17 17 int ippToPsps_batchStack(IppToPsps *this) { 18 19 18 20 19 int status = 0; … … 39 38 40 39 40 char** assocDate = (char**)calloc(MAXDETECT, sizeof(char**)); 41 for (uint32_t i=0; i<MAXDETECT;i++) assocDate[i] = (char*)calloc(20,sizeof(char)); 42 int8_t filterIDs[MAXDETECT], surveyIDs[MAXDETECT]; 43 44 41 45 // write StackMeta 42 46 ippToPspsConfig_writeTable(this->config, fitsIn, this->fitsOut, 1, "StackMeta", true); 47 fits_write_col(this->fitsOut, TLONG, STACKMETA_SKYCELLID, 1, 1, 1, &this->id, &status); 43 48 44 49 int8_t filterID = -1; 45 50 if (!ippToPspsConfig_getFilterId(this->config, filterType, &filterID)) {return PS_EXIT_DATA_ERROR;} 46 51 fits_write_col(this->fitsOut, TBYTE, STACKMETA_FILTERID, 1, 1, 1, &filterID, &status); 52 53 fits_write_col(this->fitsOut, TBYTE, STACKMETA_SURVEYID, 1, 1, 1, &this->surveyID, &status); 54 47 55 48 56 // psf detections … … 54 62 } 55 63 else { 56 64 65 // some stuff is the same for all detections so we can populate here 66 for (long s = 0; s<MAXDETECT; s++) { 67 68 filterIDs[s] = filterID; 69 surveyIDs[s] = this->surveyID; 70 strcpy(assocDate[s], this->todaysDate); 71 } 72 73 57 74 long nDet = 0; 58 75 if (fits_get_num_rows(fitsIn, &nDet, &status)) { … … 96 113 97 114 ippToPspsConfig_writeTable(this->config, fitsIn, this->fitsOut, nDet, "StackDetection", false); 115 fits_write_col(this->fitsOut, TLONG, STACKDETECTION_SKYCELLID, 1, 1, 1, &this->id, &status); 116 fits_write_col(this->fitsOut, TBYTE, STACKDETECTION_FILTERID, 1, 1, nDet, filterIDs, &status); 117 fits_write_col(this->fitsOut, TBYTE, STACKDETECTION_SURVEYID, 1, 1, nDet, surveyIDs, &status); 118 fits_write_col(this->fitsOut, TSTRING, STACKDETECTION_ASSOCDATE, 1, 1, nDet, assocDate, &status); 119 98 120 if (numInvalidFlux) fits_delete_rowlist(this->fitsOut, removeList, numInvalidFlux, &status); 99 121 … … 129 151 } 130 152 131 132 133 153 ippToPspsConfig_writeTable(this->config, fitsIn, this->fitsOut, nDet, "StackApFlx", false); 154 fits_write_col(this->fitsOut, TBYTE, STACKAPFLX_FILTERID, 1, 1, nDet, filterIDs, &status); 155 fits_write_col(this->fitsOut, TBYTE, STACKAPFLX_SURVEYID, 1, 1, nDet, surveyIDs, &status); 134 156 } 135 157
Note:
See TracChangeset
for help on using the changeset viewer.
