Changeset 8848
- Timestamp:
- Sep 19, 2006, 4:36:36 PM (20 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 16 edited
-
camera/pmFPACopy.c (modified) (1 diff)
-
camera/pmFPAUtils.c (modified) (1 diff)
-
camera/pmFPA_JPEG.c (modified) (2 diffs)
-
camera/pmFPAfile.c (modified) (1 diff)
-
camera/pmFPAfileDefine.c (modified) (1 diff)
-
camera/pmFPAfileIO.c (modified) (1 diff)
-
camera/pmHDU.c (modified) (1 diff)
-
camera/pmHDUGenerate.c (modified) (1 diff)
-
concepts/pmConceptsRead.c (modified) (1 diff)
-
concepts/pmConceptsStandard.c (modified) (1 diff)
-
concepts/pmConceptsWrite.c (modified) (4 diffs)
-
detrend/pmDetrendDB.c (modified) (1 diff)
-
detrend/pmFringeStats.c (modified) (2 diffs)
-
detrend/psIOBuffer.c (modified) (1 diff)
-
detrend/psPipe.c (modified) (1 diff)
-
imcombine/pmReadoutCombine.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPACopy.c
r8823 r8848 5 5 #include <stdio.h> 6 6 #include <assert.h> 7 #include <string.h> 7 8 8 9 #include <pslib.h> -
trunk/psModules/src/camera/pmFPAUtils.c
r8815 r8848 4 4 5 5 #include <stdio.h> 6 #include <string.h> 7 6 8 #include <pslib.h> 7 9 #include "pmFPA.h" -
trunk/psModules/src/camera/pmFPA_JPEG.c
r8815 r8848 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-09- 15 09:49:01$7 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-09-20 02:36:36 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 20 20 /*****************************************************************************/ 21 21 22 #include <stdio.h> 23 #include <string.h> 22 24 #include <pslib.h> 23 25 -
trunk/psModules/src/camera/pmFPAfile.c
r8815 r8848 4 4 5 5 #include <stdio.h> 6 #include <string.h> 6 7 #include <pslib.h> 7 8 -
trunk/psModules/src/camera/pmFPAfileDefine.c
r8815 r8848 4 4 5 5 #include <stdio.h> 6 #include <string.h> 6 7 #include <pslib.h> 7 8 -
trunk/psModules/src/camera/pmFPAfileIO.c
r8815 r8848 4 4 5 5 #include <stdio.h> 6 #include <string.h> 6 7 #include <pslib.h> 7 8 -
trunk/psModules/src/camera/pmHDU.c
r8815 r8848 5 5 #include <stdio.h> 6 6 #include <assert.h> 7 #include <string.h> 7 8 8 9 #include <pslib.h> -
trunk/psModules/src/camera/pmHDUGenerate.c
r8815 r8848 5 5 #include <stdio.h> 6 6 #include <assert.h> 7 #include <string.h> 7 8 #include <pslib.h> 8 9 -
trunk/psModules/src/concepts/pmConceptsRead.c
r8821 r8848 5 5 #include <stdio.h> 6 6 #include <assert.h> 7 #include <string.h> 7 8 #include <pslib.h> 8 9 -
trunk/psModules/src/concepts/pmConceptsStandard.c
r8820 r8848 4 4 5 5 #include <stdio.h> 6 #include <string.h> 6 7 #include <assert.h> 7 8 -
trunk/psModules/src/concepts/pmConceptsWrite.c
r8815 r8848 5 5 #include <stdio.h> 6 6 #include <assert.h> 7 #include <string s.h>7 #include <string.h> 8 8 #include <pslib.h> 9 9 … … 132 132 static bool writeSingleHeader(pmHDU *hdu, // HDU for which to add to the header 133 133 const char *keyword, // Keyword to add 134 psMetadataItem *item // Item to add to the header 134 psMetadataItem *item // Item to add to the header; may be NULL 135 135 ) 136 136 { 137 137 assert(hdu); 138 138 assert(keyword && strlen(keyword) > 0); 139 assert(item);140 139 141 140 if (!hdu->header) { 142 141 hdu->header = psMetadataAlloc(); 142 } 143 if (!item) { 144 psTrace("psModules.concepts", 9, "Writing header %s: <<<BLANK>>>\n", keyword); 145 // Assume it's a NULL string: it's most easily parsed. 146 return psMetadataAddStr(hdu->header, PS_LIST_TAIL, keyword, PS_META_REPLACE, NULL, NULL); 143 147 } 144 148 switch (item->type) { … … 188 192 if (item->type == PS_DATA_LIST) { 189 193 psList *values = item->data.V; // List of outputs 190 if (values->n == 0) { 191 // Nothing to write 194 psList *keys = psStringSplit(keywords, " ,;", true); // List of keywords 195 if (keys->n != values->n && values->n != 0) { 196 psError(PS_ERR_UNKNOWN, true, "Number of keywords (%ld) does not match number of " 197 "values (%ld).\n", keys->n, values->n); 198 psFree(keys); 192 199 return false; 193 }194 psList *keys = psStringSplit(keywords, " ,;", true); // List of keywords195 if (keys->n != values->n) {196 psLogMsg(__func__, PS_LOG_WARN, "Number of keywords (%ld) does not match number of values (%ld).\n",197 keys->n, values->n);198 200 } 199 201 psListIterator *keysIter = psListIteratorAlloc(keys, PS_LIST_HEAD, false); // Iterator for keywords 200 202 psListIterator *valuesIter = psListIteratorAlloc(values, PS_LIST_HEAD, false); // Iterator for values 201 203 psString key = NULL; // Keyword from iteration 202 psMetadataItem *value = NULL; // Value from iteration203 while ((key = psListGetAndIncrement(keysIter)) && (value = psListGetAndIncrement(valuesIter))) {204 while ((key = psListGetAndIncrement(keysIter))) { 205 psMetadataItem *value = psListGetAndIncrement(valuesIter); // Value from iteration; may be NULL 204 206 status |= writeSingleHeader(hdu, key, value); 205 207 } … … 394 396 continue; 395 397 } 396 psList *keywords = psStringSplit(headerItem->data.V, " ,;", true); // List of header keywords 397 if (formatted->type == PS_DATA_LIST) { 398 psList *values = formatted->data.V; // The values for the headers 399 if (values->n != keywords->n) { 400 psLogMsg(__func__, PS_LOG_WARN, "Number of headers specified does not match number " 401 "of values for concept %s.\n", name); 402 } 403 psListIterator *valuesIter = psListIteratorAlloc(values, PS_LIST_HEAD, false); // Iterator 404 psListIterator *keywordsIter = psListIteratorAlloc(keywords, PS_LIST_HEAD, false); 405 psMetadataItem *valuesItem = NULL; // Item from list 406 while ((valuesItem = psListGetAndIncrement(valuesIter))) { 407 psString keyword = psListGetAndIncrement(keywordsIter); // Keyword from the list 408 if (strlen(keyword) > 0) { 409 writeHeader(hdu, keyword, formatted); 410 } 411 } 412 psFree(valuesIter); 413 psFree(keywordsIter); 414 } else { 415 psString keyword = psListGet(keywords, PS_LIST_HEAD); // The keyword 416 writeHeader(hdu, keyword, formatted); 417 } 398 writeHeader(hdu, headerItem->data.V, formatted); 418 399 psFree(formatted); 419 psFree(keywords);420 400 } 421 401 } -
trunk/psModules/src/detrend/pmDetrendDB.c
r8815 r8848 3 3 #endif 4 4 5 # include <pslib.h> 6 # include "pmFPA.h" 7 # include "pmDetrendDB.h" 5 #include <stdio.h> 6 #include <string.h> 7 #include <pslib.h> 8 #include "pmFPA.h" 9 #include "pmDetrendDB.h" 8 10 9 11 // ************* detrend select functions ************** -
trunk/psModules/src/detrend/pmFringeStats.c
r8815 r8848 3 3 * @author Eugene Magnier, IfA 4 4 * 5 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-09- 15 09:49:01$5 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-09-20 02:36:36 $ 7 7 * 8 8 * Copyright 2004 IfA … … 15 15 #include <stdio.h> 16 16 #include <assert.h> 17 #include <string.h> 17 18 #include <pslib.h> 18 19 #include "pmFPA.h" -
trunk/psModules/src/detrend/psIOBuffer.c
r8815 r8848 4 4 #endif 5 5 6 # include <unistd.h> 7 # include <pslib.h> 8 # include "pmFPA.h" 9 # include "pmDetrendDB.h" 6 #include <stdio.h> 7 #include <string.h> 8 #include <unistd.h> 9 #include <pslib.h> 10 #include "pmFPA.h" 11 #include "pmDetrendDB.h" 10 12 11 13 static void psIOBufferFree (psIOBuffer *buffer) -
trunk/psModules/src/detrend/psPipe.c
r8815 r8848 3 3 #endif 4 4 5 # include <sys/types.h> 6 # include <unistd.h> 7 # include <fcntl.h> 8 # include <pslib.h> 9 # include "pmFPA.h" 10 # include "pmDetrendDB.h" 5 #include <stdio.h> 6 #include <string.h> 7 #include <sys/types.h> 8 #include <unistd.h> 9 #include <fcntl.h> 10 #include <pslib.h> 11 #include "pmFPA.h" 12 #include "pmDetrendDB.h" 11 13 12 14 void closePipes (int *stdin_fd, int *stdout_fd, int *stderr_fd) -
trunk/psModules/src/imcombine/pmReadoutCombine.c
r8815 r8848 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1.2 5$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-09- 15 09:49:01$7 * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-09-20 02:36:36 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 17 17 18 18 #include <stdio.h> 19 #include <string.h> 19 20 #include <assert.h> 20 21 #include <pslib.h>
Note:
See TracChangeset
for help on using the changeset viewer.
