Changeset 6559 for branches/rel10_ifa/psModules/src/astrom/pmFPAview.c
- Timestamp:
- Mar 8, 2006, 5:24:49 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/astrom/pmFPAview.c
r6521 r6559 1 # include "pmFPAview.h" 2 3 static void pmPFAviewFree (pmFPAview *view) 1 /** @file pmFPAview.c 2 * 3 * @author EAM, IfA 4 * 5 * @version $Revision: 1.1.2.2 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-03-09 03:24:49 $ 7 * 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 9 * 10 */ 11 12 #include <stdio.h> 13 #include <math.h> 14 #include <string.h> 15 #include "pslib.h" 16 #include "pmHDU.h" 17 #include "pmFPA.h" 18 #include "pmFPAview.h" 19 #include "pmFPARead.h" 20 #include "pmFPAWrite.h" 21 22 bool pmChipRead(pmChip *fpa, // FPA to read into 23 psFits *fits, // FITS file from which to read 24 psMetadata *phu, // Primary header 25 psDB *db // Database handle, for concept ingest 26 ); 27 28 bool pmCellRead(pmCell *fpa, // FPA to read into 29 psFits *fits, // FITS file from which to read 30 psMetadata *phu, // Primary header 31 psDB *db // Database handle, for concept ingest 32 ); 33 34 bool pmReadoutRead(pmReadout *fpa, // FPA to read into 35 psFits *fits, // FITS file from which to read 36 psMetadata *phu, // Primary header 37 psDB *db // Database handle, for concept ingest 38 ); 39 40 bool pmReadoutReadSegment(pmReadout *fpa, // FPA to read into 41 psFits *fits, // FITS file from which to read 42 int n, int i, 43 psMetadata *phu, // Primary header 44 psDB *db); 45 46 static void pmFPAviewFree (pmFPAview *view) 4 47 { 5 48 … … 15 58 16 59 pmFPAview *view = psAlloc (sizeof(pmFPAview)); 60 psMemSetDeallocator (view, (psFreeFunc) pmFPAviewFree); 17 61 18 62 view->fpa = fpa; … … 167 211 } 168 212 169 pm Cell*pmFPAviewNextReadout (pmFPAview *view, int nStep)213 pmReadout *pmFPAviewNextReadout (pmFPAview *view, int nStep) 170 214 { 171 215 … … 178 222 179 223 // if there are no available cells, return NULL 180 if ( view->fpa->readouts->n <= 0) {181 view->readout s= -1;224 if (cell->readouts->n <= 0) { 225 view->readout = -1; 182 226 return NULL; 183 227 } … … 210 254 211 255 if (view->chip < 0) { 212 return pmHDU fromFPA (view->fpa);256 return pmHDUFromFPA (view->fpa); 213 257 } 214 258 if (view->cell < 0) { 215 return pmHDU fromChip (pmFPAviewThisChip (view));259 return pmHDUFromChip (pmFPAviewThisChip (view)); 216 260 } 217 261 if (view->readout < 0) { 218 return pmHDU fromCell (pmFPAviewThisCell (view));262 return pmHDUFromCell (pmFPAviewThisCell (view)); 219 263 } 220 264 return NULL; … … 225 269 { 226 270 227 char *name;228 271 char *newName = NULL; // destination for resulting name 229 272 … … 249 292 } 250 293 if (strstr (newName, "{EXTNAME}") != NULL) { 251 pmCell *cell = pmFPAviewThisCell (view); 252 char *name = psMetadataLookupStr (NULL, header, "EXTNAME"); 253 if (name != NULL) { 254 newName = psStringSubstitute (newName, name, "{EXTNAME}"); 294 pmHDU *hdu = pmFPAviewThisHDU (view); 295 if (hdu->extname != NULL) { 296 newName = psStringSubstitute (newName, hdu->extname, "{EXTNAME}"); 255 297 } 256 298 } … … 266 308 267 309 if (view->chip == -1) { 268 pmFPARead (fpa, fits, phu, database);310 pmFPARead (fpa, fits, NULL, NULL); 269 311 return true; 270 312 } … … 276 318 277 319 if (view->cell == -1) { 278 pmChipRead (chip, fits, phu, database);320 pmChipRead (chip, fits, NULL, NULL); 279 321 return true; 280 322 } … … 286 328 287 329 if (view->readout == -1) { 288 pmCellRead (cell, fits, phu, database);330 pmCellRead (cell, fits, NULL, NULL); 289 331 return true; 290 332 } … … 296 338 297 339 if (view->nRows == 0) { 298 pmReadoutRead (readout, fits, phu, database);340 pmReadoutRead (readout, fits, NULL, NULL); 299 341 } else { 300 pmReadoutReadSegment (readout, fits, view->nRows, view->iRows, phu, database);342 pmReadoutReadSegment (readout, fits, view->nRows, view->iRows, NULL, NULL); 301 343 } 302 344 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
