Changeset 5974
- Timestamp:
- Jan 13, 2006, 5:10:19 PM (21 years ago)
- Location:
- branches/eam_rel9_p0/psModules/src/astrom
- Files:
-
- 8 edited
-
Makefile.am (modified) (2 diffs)
-
pmAstrometry.c (modified) (10 diffs)
-
pmAstrometry.h (modified) (3 diffs)
-
pmChipMosaic.c (modified) (2 diffs)
-
pmChipMosaic.h (modified) (1 diff)
-
pmFPAConstruct.c (modified) (2 diffs)
-
pmFPARead.c (modified) (10 diffs)
-
pmFPAWrite.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_rel9_p0/psModules/src/astrom/Makefile.am
r5795 r5974 6 6 pmAstrometry.c \ 7 7 pmAstrometryObjects.c \ 8 pmChipMosaic.c \9 pmFPAConceptsGet.c \10 pmFPAConceptsSet.c \11 8 pmFPAConstruct.c \ 12 9 pmFPARead.c \ 13 10 pmFPAWrite.c \ 14 11 pmReadout.c \ 15 psAdditionals.c 12 psAdditionals.c \ 13 pmConcepts.c \ 14 pmConceptsRead.c \ 15 pmConceptsWrite.c \ 16 pmConceptsStandard.c \ 17 pmChipMosaic.c 18 ### pmFPAConceptsGet.c 19 ### pmFPAConceptsSet.c 16 20 17 21 psmoduleincludedir = $(includedir) … … 19 23 pmAstrometry.h \ 20 24 pmAstrometryObjects.h \ 21 pmChipMosaic.h \22 pmFPAConceptsGet.h \23 pmFPAConceptsSet.h \24 25 pmFPAConstruct.h \ 25 26 pmFPARead.h \ 26 27 pmFPAWrite.h \ 27 28 pmReadout.h \ 28 psAdditionals.h 29 psAdditionals.h \ 30 pmConcepts.h \ 31 pmConceptsRead.h \ 32 pmConceptsWrite.h \ 33 pmConceptsStandard.h \ 34 pmChipMosaic.h 35 ### pmFPAConceptsGet.h 36 ### pmFPAConceptsSet.h -
branches/eam_rel9_p0/psModules/src/astrom/pmAstrometry.c
r5795 r5974 13 13 * XXX: Should we implement non-linear cell->chip transforms? 14 14 * 15 * @version $Revision: 1.11.2.1 $ $Name: not supported by cvs2svn $16 * @date $Date: 200 5-12-17 03:18:38$15 * @version $Revision: 1.11.2.1.2.1 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2006-01-14 03:10:19 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 25 25 #include <math.h> 26 26 #include "pslib.h" 27 27 28 #include "pmAstrometry.h" 29 #include "pmConcepts.h" 28 30 29 31 /***************************************************************************** … … 201 203 chip->cells = psArrayAdd(chip->cells, 1, (psPtr) tmpCell); 202 204 } 203 tmpCell->valid = true; // All cells are valid by default 205 tmpCell->process = true; // All cells are processed by default 206 tmpCell->exists = false; // Not yet read in 204 207 tmpCell->hdu = NULL; 208 209 pmConceptsBlankCell(tmpCell); 205 210 206 211 psMemSetDeallocator(tmpCell, (psFreeFunc) cellFree); … … 231 236 fpa->chips = psArrayAdd(fpa->chips, 1, (psPtr) tmpChip); 232 237 } 233 tmpChip->valid = true; // Work on all chips, by default 238 tmpChip->process = true; // Work on all chips, by default 239 tmpChip->exists = false; // Not read in yet 234 240 tmpChip->hdu = NULL; 241 242 pmConceptsBlankChip(tmpChip); 235 243 236 244 psMemSetDeallocator(tmpChip, (psFreeFunc) chipFree); … … 251 259 tmpFPA->hdu = NULL; 252 260 tmpFPA->phu = NULL; 261 262 pmConceptsBlankFPA(tmpFPA); 253 263 254 264 psMemSetDeallocator(tmpFPA, (psFreeFunc) FPAFree); … … 817 827 *****************************************************************************/ 818 828 819 // Set cells within a chip to a specified validity820 static bool setCells Valid(const pmChip *chip, // Chip of interest821 bool valid // Valid?822 )829 // Set cells within a chip to be processed or not 830 static bool setCellsProcess(const pmChip *chip, // Chip of interest 831 bool process // Process this chip? 832 ) 823 833 { 824 834 PS_ASSERT_PTR_NON_NULL(chip, false); … … 831 841 pmCell *tmpCell = cells->data[i]; // Cell of interest 832 842 if (tmpCell) { 833 tmpCell-> valid = valid;843 tmpCell->process = process; 834 844 } 835 845 } … … 857 867 } 858 868 if (i == chipNum) { 859 tmpChip-> valid= true;860 setCells Valid(tmpChip, true);869 tmpChip->process = true; 870 setCellsProcess(tmpChip, true); 861 871 } else { 862 tmpChip-> valid= false;863 setCells Valid(tmpChip, false);872 tmpChip->process = false; 873 setCellsProcess(tmpChip, false); 864 874 } 865 875 … … 872 882 /***************************************************************************** 873 883 XXX: The SDRS is ambiguous on a few things: 874 Whether or not the other chips should be set valid=true. [PAP: No]875 Should we return the number of chip valid=true before or after they're set, [PAP: After]884 Whether or not the other chips should be set process=true. [PAP: No] 885 Should we return the number of chip process=true before or after they're set, [PAP: After] 876 886 *****************************************************************************/ 877 887 /** 878 888 * 879 * pmFPAExcludeChip shall set validto false only for the specified chip889 * pmFPAExcludeChip shall set process to false only for the specified chip 880 890 * number (chipNum). In the event that the specified chip number does not exist 881 891 * within the fpa, the function shall generate a warning, and perform no action. 882 * The function shall return the number of chips within the fpa that have valid892 * The function shall return the number of chips within the fpa that have process 883 893 * set to true. 884 894 * … … 900 910 } 901 911 902 int numChips = 0; // Number of valid chips912 int numChips = 0; // Number of chips to be processed 903 913 for (int i = 0 ; i < chips->n ; i++) { 904 914 pmChip *tmpChip = (pmChip *) chips->data[i]; // Chip of interest 905 915 if (tmpChip != NULL) { 906 916 if (i == chipNum) { 907 tmpChip-> valid= false;908 setCells Valid(tmpChip, false); // Wipe out the cell as well909 } else if (tmpChip-> valid) {917 tmpChip->process = false; 918 setCellsProcess(tmpChip, false); // Wipe out the cell as well 919 } else if (tmpChip->process) { 910 920 numChips++; 911 921 } -
branches/eam_rel9_p0/psModules/src/astrom/pmAstrometry.h
r5795 r5974 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.5.2.1 $ $Name: not supported by cvs2svn $11 * @date $Date: 200 5-12-17 03:18:38$10 * @version $Revision: 1.5.2.1.2.1 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-01-14 03:10:19 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 96 96 psArray *cells; ///< The cells (referred to by name) 97 97 pmFPA *parent; ///< Parent FPA 98 bool valid; ///< Do we bother about reading and working with this chip? 98 bool process; ///< Do we bother about reading and working with this chip? 99 bool exists; ///< Does the chip exist --- has it been read in? 99 100 p_pmHDU *hdu; ///< FITS data 100 101 } … … 125 126 psArray *readouts; ///< The readouts (referred to by number) 126 127 pmChip *parent; ///< Parent chip 127 bool valid; ///< Do we bother about reading and working with this cell? 128 bool process; ///< Do we bother about reading and working with this cell? 129 bool exists; ///< Does the cell exist --- has it been read in? 128 130 p_pmHDU *hdu; ///< FITS data 129 131 } -
branches/eam_rel9_p0/psModules/src/astrom/pmChipMosaic.c
r5796 r5974 106 106 } 107 107 108 psImage *pmChipMosaic(pmChip *chip, // Chip to mosaic 109 int xBinChip, int yBinChip // Binning of mosaic image in x and y 110 ) 108 // Mosaic a chip together into a single image 109 static psImage *mosaicChip(pmChip *chip,// Chip to mosaic 110 int xBinChip, int yBinChip // Binning of mosaic image in x and y 111 ) 111 112 { 113 112 114 psArray *cells = chip->cells; // The array of cells 113 115 psArray *images = psArrayAlloc(cells->n); // Array of images that will be mosaicked … … 174 176 return mosaic; 175 177 } 178 179 180 int pmFPAMosaicChips(pmFPA *fpa, // FPA 181 int xBinChip, int yBinChip // Binning of mosaic image in x and y 182 ) 183 { 184 assert(fpa); 185 186 int numChips = 0; 187 psArray *chips = fpa->chips; // Component chips 188 for (int i = 0; i < chips->n; i++) { 189 pmChip *chip = chips->data[i]; // The chip of interest 190 if (! chip || ! chip->exists || ! chip->process) { 191 continue; 192 } 193 194 numChips++; 195 psImage *mosaic = mosaicChip(chip, xBinChip, yBinChip); // Mosaic of cells within the chip 196 197 // Chop off all the component cells, and put in a new one 198 psArrayElementsFree(chip->cells); 199 chip->cells = psArrayRealloc(chip->cells, 1); 200 pmCell *cell = pmCellAlloc(chip, NULL, __func__); // New cell 201 pmReadout *readout = pmReadoutAlloc(cell); // New readout 202 readout->image = mosaic; 203 psFree(readout); 204 } 205 206 return numChips; 207 208 } -
branches/eam_rel9_p0/psModules/src/astrom/pmChipMosaic.h
r5796 r5974 14 14 ); 15 15 16 // Mosaic all the cells in a chip together (neglecting the overscans) 17 psImage *pmChipMosaic(pmChip *chip, // Chip to mosaic 18 int xBinChip, int yBinChip // Binning of mosaic image in x and y 19 ); 20 16 // Mosaic all the cells in all (valid) chips together (neglecting the overscans); return number of chips 17 int pmFPAMosaicChips(pmFPA *fpa, // FPA 18 int xBinChip, int yBinChip // Binning of mosaic image in x and y 19 ); 21 20 22 21 #endif -
branches/eam_rel9_p0/psModules/src/astrom/pmFPAConstruct.c
r5939 r5974 62 62 ) 63 63 { 64 pmFPA *fpa = pmFPAAlloc(camera); // The FPA to fill out64 pmFPA *fpa = pmFPAAlloc(camera); // The FPA to fill out 65 65 bool mdStatus = true; // Status from metadata lookups 66 66 const char *phuType = psMetadataLookupStr(&mdStatus, camera, "PHU"); // What is the PHU? … … 266 266 } 267 267 268 // Initialise with dummy concepts, until the real ones can be read.269 pmFPABlankConcepts(fpa);270 271 268 return fpa; 272 269 } -
branches/eam_rel9_p0/psModules/src/astrom/pmFPARead.c
r5796 r5974 4 4 5 5 #include "pmAstrometry.h" 6 #include "pmFPAConceptsGet.h"7 6 #include "pmFPARead.h" 7 #include "pmConcepts.h" 8 8 9 9 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 157 157 } 158 158 } 159 pm FPAIngestConcepts(fpa, db);159 pmConceptsReadFPA(fpa, db); 160 160 161 161 psArray *chips = fpa->chips; // Array of chips … … 164 164 pmChip *chip = chips->data[i]; // The chip 165 165 166 // Only read chips marked "valid"167 if (! chip-> valid) {166 // Only read chips marked to "process" 167 if (! chip->process) { 168 168 psTrace(__func__, 2, "Ignoring chip %d...\n", i); 169 169 continue; … … 179 179 } 180 180 } 181 pmChipIngestConcepts(chip, db); 181 182 pmConceptsReadChip(chip, db); 182 183 183 184 // Iterate over the chip … … 186 187 pmCell *cell = cells->data[j]; // The cell 187 188 188 // Only read cells marked "valid"189 if (! cell-> valid) {189 // Only read cells marked to "process" 190 if (! cell->process) { 190 191 psTrace(__func__, 3, "Ignoring chip %d...\n", i); 191 192 continue; … … 203 204 } 204 205 } 205 pmC ellIngestConcepts(cell, db);206 pmConceptsReadCell(cell, db); 206 207 207 208 psTrace(__func__, 5, "Allocating readouts for chip %d cell %d...\n", 208 209 i, j); 209 210 generateReadouts(cell, hdu); 210 } 211 212 cell->exists = true; 213 } 214 chip->exists = true; 211 215 } 212 216 … … 396 400 for (int chipNum = 0; chipNum < chips->n; chipNum++) { 397 401 pmChip *chip = chips->data[chipNum]; // The current chip of interest 398 if (chip-> valid) {402 if (chip->process) { 399 403 if (chip->hdu) { 400 404 hdu = chip->hdu; … … 403 407 for (int cellNum = 0; cellNum < cells->n; cellNum++) { 404 408 pmCell *cell = cells->data[cellNum]; // The current cell of interest 405 if (cell-> valid) {409 if (cell->process) { 406 410 if (cell->hdu) { 407 411 hdu = cell->hdu; … … 534 538 for (int chipNum = 0; chipNum < chips->n; chipNum++) { 535 539 pmChip *chip = chips->data[chipNum]; // The current chip of interest 536 if (chip-> valid) {540 if (chip->process) { 537 541 if (chip->hdu) { 538 542 hdu = chip->hdu; … … 541 545 for (int cellNum = 0; cellNum < cells->n; cellNum++) { 542 546 pmCell *cell = cells->data[cellNum]; // The current cell of interest 543 if (cell-> valid) {547 if (cell->process) { 544 548 if (cell->hdu) { 545 549 hdu = cell->hdu; -
branches/eam_rel9_p0/psModules/src/astrom/pmFPAWrite.c
r5796 r5974 4 4 5 5 #include "pmAstrometry.h" 6 #include "pmFPAConceptsSet.h"7 6 #include "pmFPARead.h" 7 #include "pmConcepts.h" 8 8 9 9 static bool writeHDU(psFits *fits, // FITS file to which to write … … 29 29 30 30 psTrace(__func__, 7, "Outgesting FPA concepts...\n"); 31 pm FPAOutgestConcepts(fpa, db);31 pmConceptsWriteFPA(fpa, db); 32 32 33 33 // Write the primary header … … 40 40 for (int i = 0; i < chips->n; i++) { 41 41 pmChip *chip = chips->data[i]; // The component chip 42 if (chip-> valid) {42 if (chip->exists && chip->process) { 43 43 psTrace(__func__, 1, "Writing out chip %d...\n", i); 44 44 45 pmC hipOutgestConcepts(chip, db);45 pmConceptsWriteChip(chip, db); 46 46 47 47 psArray *cells = chip->cells; // Array of component cells 48 48 for (int j = 0; j < cells->n; j++) { 49 49 pmCell *cell = cells->data[j]; // The component cell 50 if (cell-> valid) {50 if (cell->exists && cell->process) { 51 51 psTrace(__func__, 2, "Writing out cell, %d...\n", j); 52 52 53 pmC ellOutgestConcepts(cell, db);53 pmConceptsWriteCell(cell, db); 54 54 55 55 if (cell->hdu && strlen(cell->hdu->extname) > 0) { … … 107 107 for (int chipNum = 0; chipNum < chips->n; chipNum++) { 108 108 pmChip *chip = chips->data[chipNum]; // The current chip of interest 109 if (chip-> valid) {109 if (chip->exists && chip->process) { 110 110 if (chip->hdu) { 111 111 hdu = chip->hdu; … … 114 114 for (int cellNum = 0; cellNum < cells->n; cellNum++) { 115 115 pmCell *cell = cells->data[cellNum]; // The current cell of interest 116 if (cell-> valid) {116 if (cell->exists && cell->process) { 117 117 if (cell->hdu) { 118 118 hdu = cell->hdu; … … 198 198 for (int chipNum = 0; chipNum < chips->n; chipNum++) { 199 199 pmChip *chip = chips->data[chipNum]; // The current chip of interest 200 if (chip-> valid) {200 if (chip->exists && chip->process) { 201 201 if (chip->hdu) { 202 202 hdu = chip->hdu; … … 205 205 for (int cellNum = 0; cellNum < cells->n; cellNum++) { 206 206 pmCell *cell = cells->data[cellNum]; // The current cell of interest 207 if (cell-> valid) {207 if (cell->exists && cell->process) { 208 208 if (cell->hdu) { 209 209 hdu = cell->hdu;
Note:
See TracChangeset
for help on using the changeset viewer.
