Changeset 7618
- Timestamp:
- Jun 21, 2006, 12:44:16 PM (20 years ago)
- Location:
- trunk/psModules/src/camera
- Files:
-
- 9 edited
-
pmFPAConstruct.c (modified) (1 diff)
-
pmFPACopy.c (modified) (4 diffs)
-
pmFPAMosaic.c (modified) (1 diff)
-
pmFPAWrite.c (modified) (2 diffs)
-
pmFPAfile.c (modified) (4 diffs)
-
pmFPAfile.h (modified) (2 diffs)
-
pmFPAfileDefine.c (modified) (6 diffs)
-
pmFPAfileFitsIO.c (modified) (1 diff)
-
pmFPAfileIO.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAConstruct.c
r7604 r7618 739 739 PS_ASSERT_PTR_NON_NULL(format, false); 740 740 741 return addSource(fpa, phuView, NULL, format) ? true : false; 742 } 743 744 741 pmFPAview *view = addSource(fpa, phuView, NULL, format); 742 bool status = (view == NULL); 743 psFree (view); 744 return status; 745 } 745 746 746 747 // Add an input file to the FPA -
trunk/psModules/src/camera/pmFPACopy.c
r7419 r7618 181 181 psFree(biasIter); 182 182 183 targetReadout->data_exists = true; 183 184 psFree(targetReadout); // Drop reference 184 185 } … … 251 252 binItem->data.S32 *= yBin; 252 253 253 254 254 // Copy any headers 255 255 pmHDU *targetHDU = pmHDUFromCell(target); // The target HDU … … 265 265 } 266 266 267 target->data_exists = true; 267 268 return true; 268 269 } … … 301 302 psMetadataCopy(target->concepts, source->concepts); 302 303 304 target->data_exists = true; 303 305 return status; 304 306 } -
trunk/psModules/src/camera/pmFPAMosaic.c
r7610 r7618 458 458 psTrace(__func__, 3, "Spliced image will be %dx%d\n", (int)xSize, (int)ySize); 459 459 psImage *mosaic = psImageAlloc((int)xSize, (int)ySize, type); // The mosaic image 460 psImageInit(mosaic, 0 .0);460 psImageInit(mosaic, 0); 461 461 462 462 // Next pass through the images to do the mosaicking -
trunk/psModules/src/camera/pmFPAWrite.c
r7589 r7618 101 101 if ((!pixels && hdu->phu && !hdu->images) || // Data-less PHU 102 102 (pixels && (hdu->images || (!hdu->images && pmHDUGenerateForCell(cell) && hdu->images)))) { // Data 103 psMetadataPrint (stdout, cell->concepts, 0);104 103 success &= pmConceptsWriteCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA | 105 104 PM_CONCEPT_SOURCE_DEFAULTS, false, NULL); … … 152 151 if (blankSegment || imageSegment) { 153 152 pmConceptSource source = PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CAMERA | PM_CONCEPT_SOURCE_DEFAULTS; 154 for (int i = 0; i < chip->cells->n; i++) {155 pmCell *cell = chip->cells->data[i];156 psMetadataPrint (stdout, cell->concepts, 0);157 }158 153 if (!pmConceptsWriteChip(chip, source, false, true, NULL)) { 159 154 psError(PS_ERR_IO, false, "Unable to write Concepts for Chip.\n"); -
trunk/psModules/src/camera/pmFPAfile.c
r7589 r7618 81 81 file->state = PM_FPA_STATE_CLOSED; 82 82 83 file->xBin = 1; 84 file->yBin = 1; 85 file->src = NULL; 86 87 file->save = false; 88 83 89 return file; 84 90 } … … 109 115 110 116 // XXX reconsider this function name / concept 117 # if 0 111 118 bool pmFPAfileAddFileNames (psMetadata *files, char *name, char *value, int mode) 112 119 { … … 130 137 return true; 131 138 } 139 # endif 132 140 133 141 // select the rule from the camera configuration, perform substitutions as needed … … 241 249 if (view->cell == -1) { 242 250 pmFPAAddSourceFromView (out, view, format); 243 return pmChipCopyStructure (outChip, inChip, xBin, yBin); 251 // XXX this is a hack: can i defer this to ppImageRebinChip? 252 // bool status = pmChipCopyStructure (outChip, inChip, xBin, yBin); 253 return true; 244 254 } 245 255 if (view->cell >= inChip->cells->n) { -
trunk/psModules/src/camera/pmFPAfile.h
r7589 r7618 7 7 * @author EAM, IfA 8 8 * 9 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-06- 17 01:50:43$9 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-06-21 22:44:16 $ 11 11 * 12 12 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii … … 60 60 pmFPALevel fileLevel; // what level in the FPA hierarchy represents a unique file? 61 61 pmFPALevel dataLevel; // at what level do we read/write the data segment? 62 pmFPALevel freeLevel; // at what level do we read/write the data segment? 62 63 63 64 pmFPA *fpa; // for I/O files, we carry a pointer to the complete fpa -
trunk/psModules/src/camera/pmFPAfileDefine.c
r7589 r7618 109 109 return NULL; 110 110 } 111 // default is to free the data after use (after written out) 112 // this can be overridden for pmFPAfiles used as carriers as well 113 file->freeLevel = file->dataLevel; 111 114 112 115 if (fpa != NULL) { … … 199 202 char *save = psMetadataLookupStr (&status, data, "FILE.SAVE"); 200 203 if (save != NULL) { 201 if (!strcasecmp ( type, "TRUE")) {204 if (!strcasecmp (save, "TRUE")) { 202 205 file->save = true; 203 206 } 204 if (!strcasecmp ( type, "FALSE")) {207 if (!strcasecmp (save, "FALSE")) { 205 208 file->save = false; 206 209 } … … 218 221 return NULL; 219 222 } 223 // default is to free the data after use (after written out) 224 // this can be overridden for pmFPAfiles used as carriers as well 225 file->freeLevel = file->dataLevel; 220 226 221 227 if (fpa != NULL) { … … 266 272 } 267 273 274 // add argument-supplied OUTPUT name to this file 275 char *outname = psMetadataLookupStr(&status, config->arguments, "OUTPUT"); 276 psMetadataAddStr (file->names, PS_LIST_TAIL, "OUTPUT", PS_META_NO_REPLACE, "", outname); 277 278 // place the resulting file in the config system 268 279 psMetadataAddPtr (config->files, PS_LIST_TAIL, name, PS_DATA_UNKNOWN, "", file); 269 280 psFree (file); // we free this copy of file, but 'files' still has a copy … … 616 627 PS_ASSERT_INT_POSITIVE(strlen(filename), false); 617 628 618 pmFPA *fpa = pmFPAConstruct ( config->camera);629 pmFPA *fpa = pmFPAConstruct (src->camera); 619 630 pmFPAfile *file = pmFPAfileDefineOutput (config, fpa, filename); 620 631 if (!file) { … … 648 659 } 649 660 file->fpa = pmFPAConstruct(file->camera); 661 662 for (int i = 0; i < file->fpa->chips->n; i++) { 663 pmChip *chip = file->fpa->chips->data[i]; 664 for (int j = 0; j < chip->cells->n; j++) { 665 pmCell *cell = chip->cells->data[j]; 666 char *name = psMetadataLookupStr (NULL, cell->concepts, "CELL.NAME"); 667 fprintf (stderr, "cell %d,%d : %s\n", i, j, name); 668 } 669 } 670 650 671 return file; 651 672 } -
trunk/psModules/src/camera/pmFPAfileFitsIO.c
r7589 r7618 101 101 if (hdu != phu) { 102 102 // we assume that the PHU is just a header 103 psMetadata *outhead = psMetadataCopy (NULL, phu->header); 103 // header may not be defined for constructed images; make a dummy one 104 psMetadata *outhead = NULL; 105 if (phu->header) { 106 outhead = psMetadataCopy (NULL, phu->header); 107 } else { 108 outhead = psMetadataAlloc (); 109 } 104 110 psMetadataAdd (outhead, PS_LIST_TAIL, "EXTEND", PS_DATA_BOOL | PS_META_REPLACE, "this file has extensions", true); 105 111 psFitsWriteBlank (file->fits, outhead); -
trunk/psModules/src/camera/pmFPAfileIO.c
r7589 r7618 261 261 262 262 // do we need to read this file? 263 if (level != file->dataLevel) { 264 psTrace("pmFPAfile", 6, "skip free of %s at this level %s: dataLevel is %s", 263 if (level != file->freeLevel) { 264 psTrace("pmFPAfile", 6, "skip free of %s at this level %s: freeLevel is %s", 265 file->name, pmFPALevelToName(level), pmFPALevelToName(file->freeLevel)); 266 return true; 267 } 268 269 // XXX totally lame hack: how do I handle this? 270 # if 0 271 if (!strcasecmp(file->name, "PPIMAGE.BIN1") && (level != PM_FPA_LEVEL_FPA)) 272 { 273 psTrace("pmFPAfile", 5, "skip free of %s at this level %s: dataLevel is %s", 274 file->name, pmFPALevelToName(level), pmFPALevelToName(file->dataLevel)); 275 return true; 276 } 277 if (!strcasecmp(file->name, "PPIMAGE.BIN2") && (level != PM_FPA_LEVEL_FPA)) { 278 psTrace("pmFPAfile", 5, "skip free of %s at this level %s: dataLevel is %s", 265 279 file->name, pmFPALevelToName(level), pmFPALevelToName(file->dataLevel)); 266 280 return true; 267 281 } 282 # endif 268 283 269 284 switch (file->type) { … … 271 286 if (pmFPAviewFreeFitsImage (view, file)) { 272 287 psTrace ("pmFPAfile", 5, "freed %s (type: %d)\n", file->filename, file->type); 288 if (file->filename == NULL) { 289 psTrace ("pmFPAfile", 5, "filename is not defined for %s\n", file->name); 290 } 273 291 } else { 274 292 psError(PS_ERR_UNKNOWN, false, "skipping %s (type: %d)\n", file->filename, file->type); … … 310 328 if (file->mode != PM_FPA_MODE_WRITE) { 311 329 psTrace("pmFPAfile", 6, "skip write for %s, mode is not WRITE", file->name); 330 return true; 331 } 332 333 if (!file->save) { 334 psTrace("pmFPAfile", 6, "skip write for %s, save is FALSE", file->name); 312 335 return true; 313 336 } … … 393 416 394 417 // do we need to write this file? 395 if (level != file-> dataLevel) {396 psTrace("pmFPAfile", 6, "skip creation of %s at this level %s: dataLevel is %s",397 file->name, pmFPALevelToName(level), pmFPALevelToName(file-> dataLevel));418 if (level != file->fileLevel) { 419 psTrace("pmFPAfile", 6, "skip creation of %s at this level %s: fileLevel is %s", 420 file->name, pmFPALevelToName(level), pmFPALevelToName(file->fileLevel)); 398 421 return true; 399 422 } … … 404 427 /* create a PHU for thie file, if it does not exist */ 405 428 pmFPAfileCopyStructureView (file->fpa, file->src, file->format, file->xBin, file->yBin, view); 406 psTrace ("pmFPAfile", 5, "created fpa data elements for %s (fpa: %p)\n", file->name, file->fpa);429 // psTrace ("pmFPAfile", 5, "created fpa data elements for %s (fpa: %p)\n", file->name, file->fpa); 407 430 break; 408 431
Note:
See TracChangeset
for help on using the changeset viewer.
