Changeset 9572
- Timestamp:
- Oct 13, 2006, 4:35:39 PM (20 years ago)
- Location:
- trunk/psModules/src/concepts
- Files:
-
- 10 edited
-
pmConcepts.c (modified) (15 diffs)
-
pmConcepts.h (modified) (1 diff)
-
pmConceptsAverage.c (modified) (1 diff)
-
pmConceptsAverage.h (modified) (1 diff)
-
pmConceptsPhotcode.c (modified) (2 diffs)
-
pmConceptsPhotcode.h (modified) (1 diff)
-
pmConceptsStandard.c (modified) (17 diffs)
-
pmConceptsStandard.h (modified) (1 diff)
-
pmConceptsWrite.c (modified) (10 diffs)
-
pmConceptsWrite.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConcepts.c
r9570 r9572 25 25 } 26 26 27 pmConceptSpec *pmConceptSpecAlloc(psMetadataItem *blank, // Blank value; contains the name 28 pmConceptParseFunc parse, // Function to call to parse the concept 29 pmConceptFormatFunc format // Function to call to format the concept 30 ) 27 pmConceptSpec *pmConceptSpecAlloc(psMetadataItem *blank, pmConceptParseFunc parse, 28 pmConceptFormatFunc format) 31 29 { 32 30 pmConceptSpec *spec = psAlloc(sizeof(pmConceptSpec)); … … 41 39 42 40 43 bool pmConceptRegister(psMetadataItem *blank, // Blank value; contains the name 44 pmConceptParseFunc parse, // Function to call to parse the concept 45 pmConceptFormatFunc format, // Function to call to format the concept 46 pmFPALevel level // Level at which to store concept in the FPA hierarchy 47 ) 41 bool pmConceptRegister(psMetadataItem *blank, pmConceptParseFunc parse, 42 pmConceptFormatFunc format, pmFPALevel level) 48 43 { 49 44 PS_ASSERT_PTR_NON_NULL(blank, false); … … 185 180 // Write all registered concepts for the specified level 186 181 static bool conceptsWrite(psMetadata **specs, // One of the concepts specifications 187 pmFPA *fpa, // The FPA188 pmChip *chip, // The chip189 pmCell *cell, // The cell182 const pmFPA *fpa, // The FPA 183 const pmChip *chip, // The chip 184 const pmCell *cell, // The cell 190 185 pmConceptSource source, // The source of the concepts to write 191 186 psDB *db, // Database handle 192 psMetadata *concepts // The concepts to write out187 const psMetadata *concepts // The concepts to write out 193 188 ) 194 189 { … … 218 213 } 219 214 220 // Set the concepts for a given FPA to blanks 221 bool pmConceptsBlankFPA(pmFPA *fpa // FPA for which to set blank concepts 222 ) 223 { 224 PS_ASSERT_PTR_NON_NULL(fpa, false); 225 psTrace("psModules.concepts", 5, "Blanking FPA concepts: %p %p\n", conceptsFPA, fpa->concepts); 226 return conceptsBlank(&conceptsFPA, fpa->concepts); 227 } 228 229 // Read the concepts for the given set of fpa, chip, cell 230 bool pmConceptsRead(pmFPA *fpa, // FPA for which to read concepts 231 pmChip *chip, // Chip for which to read concepts, or NULL 232 pmCell *cell, // Cell for which to read concepts, or NULL 233 pmConceptSource source, // The source of the concepts to read 234 psDB *db // Database handle 235 ) 215 216 bool pmConceptsRead(pmFPA *fpa, pmChip *chip, pmCell *cell, pmConceptSource source, psDB *db) 236 217 { 237 218 PS_ASSERT_PTR_NON_NULL(fpa, false); … … 248 229 249 230 250 // Read the concepts for a given FPA 251 bool pmConceptsReadFPA(pmFPA *fpa, // FPA for which to read concepts 252 pmConceptSource source, // The source of the concepts to read 253 bool propagateDown, // Propagate to lower levels? 254 psDB *db // Database handle 255 ) 231 bool pmConceptsBlankFPA(pmFPA *fpa) 232 { 233 PS_ASSERT_PTR_NON_NULL(fpa, false); 234 psTrace("psModules.concepts", 5, "Blanking FPA concepts: %p %p\n", conceptsFPA, fpa->concepts); 235 return conceptsBlank(&conceptsFPA, fpa->concepts); 236 } 237 238 239 bool pmConceptsReadFPA(pmFPA *fpa, pmConceptSource source, bool propagateDown, psDB *db) 256 240 { 257 241 PS_ASSERT_PTR_NON_NULL(fpa, false); … … 271 255 } 272 256 273 // Read the concepts for a given FPA 274 bool pmConceptsWriteFPA(pmFPA *fpa, // FPA for which to write concepts 275 pmConceptSource source, // The source of the concepts to read 276 bool propagateDown, // Propagate to lower levels? 277 psDB *db // Database handle 278 ) 257 bool pmConceptsWriteFPA(const pmFPA *fpa, pmConceptSource source, bool propagateDown, psDB *db) 279 258 { 280 259 PS_ASSERT_PTR_NON_NULL(fpa, false); … … 293 272 } 294 273 295 // Set the concepts for a given chip to blanks 296 bool pmConceptsBlankChip(pmChip *chip // FPA for which to set blank concepts 297 ) 274 bool pmConceptsBlankChip(pmChip *chip) 298 275 { 299 276 PS_ASSERT_PTR_NON_NULL(chip, false); … … 302 279 } 303 280 304 // Read the concepts for a given FPA 305 bool pmConceptsReadChip(pmChip *chip, // Chip for which to read concepts 306 pmConceptSource source, // The source of the concepts to read 307 bool propagateUp, // Propagate to higher levels? 308 bool propagateDown, // Propagate to lower levels? 309 psDB *db // Database handle 310 ) 281 bool pmConceptsReadChip(pmChip *chip, pmConceptSource source, bool propagateUp, 282 bool propagateDown, psDB *db) 311 283 { 312 284 PS_ASSERT_PTR_NON_NULL(chip, false); … … 330 302 } 331 303 332 // Read the concepts for a given FPA 333 bool pmConceptsWriteChip(pmChip *chip, // Chip for which to write concepts 334 pmConceptSource source, // The source of the concepts to read 335 bool propagateUp, // Propagate to higher levels? 336 bool propagateDown, // Propagate to lower levels? 337 psDB *db // Database handle 338 ) 304 bool pmConceptsWriteChip(const pmChip *chip, pmConceptSource source, bool propagateUp, 305 bool propagateDown, psDB *db) 339 306 { 340 307 PS_ASSERT_PTR_NON_NULL(chip, false); … … 357 324 } 358 325 359 // Set the concepts for a given chip to blanks 360 bool pmConceptsBlankCell(pmCell *cell // Cell for which to set blank concepts 361 ) 326 bool pmConceptsBlankCell(pmCell *cell) 362 327 { 363 328 PS_ASSERT_PTR_NON_NULL(cell, false); … … 366 331 } 367 332 368 // Read the concepts for a given FPA 369 bool pmConceptsReadCell(pmCell *cell, // Cell for which to read concepts 370 pmConceptSource source, // The source of the concepts to read 371 bool propagateUp, // Propagate to higher levels? 372 psDB *db // Database handle 373 ) 333 bool pmConceptsReadCell(pmCell *cell, pmConceptSource source, bool propagateUp, psDB *db) 374 334 { 375 335 PS_ASSERT_PTR_NON_NULL(cell, false); … … 394 354 } 395 355 396 // Read the concepts for a given FPA 397 bool pmConceptsWriteCell(pmCell *cell, // FPA for which to write concepts 398 pmConceptSource source, // The source of the concepts to read 399 bool propagateUp, // Propagate to higher levels? 400 psDB *db // Database handle 401 ) 356 bool pmConceptsWriteCell(const pmCell *cell, pmConceptSource source, bool propagateUp, psDB *db) 402 357 { 403 358 PS_ASSERT_PTR_NON_NULL(cell, false); … … 423 378 { 424 379 conceptsInitialised = true; 380 381 p_psMemAllocatePersistent(true); 425 382 426 383 bool init = false; // Did we initialise anything? … … 761 718 } 762 719 720 p_psMemAllocatePersistent(false); 721 763 722 return init; 764 723 } … … 777 736 778 737 779 // Copy concepts from one FPA to another 780 bool pmFPACopyConcepts(pmFPA *target, // The target FPA 781 pmFPA *source // The target FPA 782 ) 738 bool pmFPACopyConcepts(pmFPA *target, const pmFPA *source) 783 739 { 784 740 PS_ASSERT_PTR_NON_NULL(target, false); -
trunk/psModules/src/concepts/pmConcepts.h
r9570 r9572 2 2 #define PM_CONCEPTS_H 3 3 4 #include "pslib.h"4 #include <pslib.h> 5 5 #include "pmFPA.h" 6 6 7 // Function to call to parse a concept once it has been read 8 typedef psMetadataItem* (*pmConceptParseFunc)(const psMetadataItem *concept, const psMetadataItem *pattern, const psMetadata *cameraFormat, const pmFPA *fpa, const pmChip *chip, const pmCell *cell); 9 // Function to call to format a concept for writing 10 typedef psMetadataItem* (*pmConceptFormatFunc)(const psMetadataItem *concept, const psMetadata *cameraFormat, const pmFPA *fpa, const pmChip *chip, const pmCell *cell); 7 /// Function to call to parse a concept once it has been read 8 typedef psMetadataItem* (*pmConceptParseFunc)(const psMetadataItem *concept, ///< Concept to parse 9 const psMetadataItem *pattern, ///< Pattern for parsing 10 const psMetadata *cameraFormat, ///< Camera format definition 11 const pmFPA *fpa, ///< FPA for concept, or NULL 12 const pmChip *chip, ///< Chip for concept, or NULL 13 const pmCell *cell ///< Cell for concept, or NULL 14 ); 11 15 12 // A "concept" specification 16 /// Function to call to format a concept for writing 17 typedef psMetadataItem* (*pmConceptFormatFunc)(const psMetadataItem *concept, ///< Concept to format 18 const psMetadata *cameraFormat, ///< Camera format definition 19 const pmFPA *fpa, ///< FPA for concept, or NULL 20 const pmChip *chip, ///< Chip for concept, or NULL 21 const pmCell *cell ///< Cell for concept, or NULL 22 ); 23 24 25 /// A "concept" specification 26 /// 27 /// Defines the name, default comment, blank value, and functions to parse (after reading) and format (before 28 /// writing) the concept. 13 29 typedef struct 14 30 { 15 psMetadataItem *blank; // Blank value of concept; also contains the name16 pmConceptParseFunc parse; // Function to call to read the concept17 pmConceptFormatFunc format; // Function to call to write the concept31 psMetadataItem *blank; ///< Blank value of concept; also contains the name and comment 32 pmConceptParseFunc parse; ///< Function to call to read the concept 33 pmConceptFormatFunc format; ///< Function to call to write the concept 18 34 } 19 35 pmConceptSpec; 20 36 21 // Allocator22 pmConceptSpec *pmConceptSpecAlloc(psMetadataItem *blank, // Blank value; contains the name23 pmConceptParseFunc parse, // Function to call to parse the concept24 pmConceptFormatFunc format // Function to call to format the concept37 /// Allocator for pmConceptSpec 38 pmConceptSpec *pmConceptSpecAlloc(psMetadataItem *blank, ///< Blank value; contains the name 39 pmConceptParseFunc parse, ///< Function to call to parse the concept 40 pmConceptFormatFunc format ///< Function to call to format the concept 25 41 ); 26 42 27 // Register a new concept 28 bool pmConceptRegister(psMetadataItem *blank, // Blank value; contains the name 29 pmConceptParseFunc parse, // Function to call to parse the concept 30 pmConceptFormatFunc format, // Function to call to format the concept 31 pmFPALevel level // Level at which to store concept in the FPA hierarchy 43 /// Register a new concept for parsing and formatting 44 /// 45 /// Defines a new concept, based on the blank value (with name and default comment), and functions to parse 46 /// and format the concept. The new concept is registered at the specified level (FPA, chip or cell). 47 bool pmConceptRegister(psMetadataItem *blank, ///< Blank value; contains the name and default comment 48 pmConceptParseFunc parse, ///< Function to call to parse the concept 49 pmConceptFormatFunc format, ///< Function to call to format the concept 50 pmFPALevel level ///< Level at which to store concept in the FPA hierarchy 32 51 ); 33 52 34 // Some specificity to reading and writing concepts 53 /// Source for concepts when reading and writing. 54 /// 55 /// Since some sources become available at different times from others, we need to provide some specificity to 56 /// reading and writing concepts (or we're forced to wait until everything's available, which we don't want to 57 /// do). Concepts may be read from or written to multiple sources at once by OR-ing them. 35 58 typedef enum { 36 PM_CONCEPT_SOURCE_NONE = 0x00, // No concepts37 PM_CONCEPT_SOURCE_CELLS = 0x01, // Concept comes from the camera information38 PM_CONCEPT_SOURCE_DEFAULTS = 0x02, // Concept comes from defaults39 PM_CONCEPT_SOURCE_PHU = 0x04, // Concept comes from PHU40 PM_CONCEPT_SOURCE_HEADER = 0x08, // Concept comes from FITS header41 PM_CONCEPT_SOURCE_DATABASE = 0x10, // Concept comes from database42 PM_CONCEPT_SOURCE_ALL = 0xff // All concepts59 PM_CONCEPT_SOURCE_NONE = 0x00, ///< No concepts 60 PM_CONCEPT_SOURCE_CELLS = 0x01, ///< Concept comes from the camera information 61 PM_CONCEPT_SOURCE_DEFAULTS = 0x02, ///< Concept comes from defaults 62 PM_CONCEPT_SOURCE_PHU = 0x04, ///< Concept comes from PHU 63 PM_CONCEPT_SOURCE_HEADER = 0x08, ///< Concept comes from FITS header 64 PM_CONCEPT_SOURCE_DATABASE = 0x10, ///< Concept comes from database 65 PM_CONCEPT_SOURCE_ALL = 0xff ///< All concepts 43 66 } pmConceptSource; 44 67 45 // Read the concepts for the given set of fpa, chip, cell 46 bool pmConceptsRead(pmFPA *fpa, // FPA for which to read concepts 47 pmChip *chip, // Chip for which to read concepts, or NULL 48 pmCell *cell, // Cell for which to read concepts, or NULL 49 pmConceptSource source, // The source of the concepts to read 50 psDB *db // Database handle 68 /// Read the concepts for the given set of fpa, chip, cell 69 /// 70 /// Attempts to read as many concepts as possible from the specified source for the specified FPA, chip and 71 /// cell. That is, it will read chip- and cell-level concepts in addition to fpa-level concepts, if the chip 72 /// and cell are provided. 73 bool pmConceptsRead(pmFPA *fpa, ///< FPA for which to read concepts 74 pmChip *chip, ///< Chip for which to read concepts, or NULL 75 pmCell *cell, ///< Cell for which to read concepts, or NULL 76 pmConceptSource source, ///< The source of the concepts to read 77 psDB *db ///< Database handle 51 78 ); 52 79 53 // Set blanks, read or write concepts at the appropriate level54 bool pmConceptsBlankFPA(pmFPA *fpa // FPA for which to set blank concepts80 /// Set the concepts within the FPA to the blank value 81 bool pmConceptsBlankFPA(pmFPA *fpa ///< FPA for which to set blank concepts 55 82 ); 56 bool pmConceptsReadFPA(pmFPA *fpa, // FPA for which to read concepts 57 pmConceptSource source, // Source for concepts 58 bool propagateDown, // Propagate to lower levels? 59 psDB *db // Database handle 83 84 /// Read concepts for an FPA; optionally, read concepts at all lower levels. 85 /// 86 /// Once concepts should be available for reading at the FPA-level, this function attempts to read the 87 /// concepts from the specified source. It also allows concepts to be read at lower levels by iterating over 88 /// the components. 89 bool pmConceptsReadFPA(pmFPA *fpa, ///< FPA for which to read concepts 90 pmConceptSource source, ///< Source for concepts 91 bool propagateDown, ///< Propagate to lower levels? 92 psDB *db ///< Database handle 60 93 ); 61 bool pmConceptsWriteFPA(pmFPA *fpa, // FPA for which to write concepts 62 pmConceptSource source, // Source for concepts 63 bool propagateDown, // Propagate to lower levels? 64 psDB *db // Database handle 94 95 /// Write concepts for an FPA; optionally, write concepts at all lower levels. 96 /// 97 /// This function writes all concepts for the FPA to the specified "source". It also allows concepts to be 98 /// written for all lower levels by iterating over the components. 99 bool pmConceptsWriteFPA(const pmFPA *fpa, ///< FPA for which to write concepts 100 pmConceptSource source, ///< Source for concepts 101 bool propagateDown, ///< Propagate to lower levels? 102 psDB *db ///< Database handle 65 103 ); 66 bool pmConceptsBlankChip(pmChip *chip // FPA for which to set blank concepts 67 ); 68 bool pmConceptsReadChip(pmChip *chip, // Chip for which to read concepts 69 pmConceptSource source, // Source for concepts 70 bool propagateUp, // Propagate to higher levels? 71 bool propagateDown, // Propagate to lower levels? 72 psDB *db // Database handle 73 ); 74 bool pmConceptsWriteChip(pmChip *chip, // Chip for which to write concepts 75 pmConceptSource source, // Source for concepts 76 bool propagateUp,// Propagate to higher levels? 77 bool propagateDown, // Propagate to lower levels? 78 psDB *db // Database handle 79 ); 80 bool pmConceptsBlankCell(pmCell *cell // Cell for which to set blank concepts 81 ); 82 bool pmConceptsReadCell(pmCell *cell, // Cell for which to read concepts 83 pmConceptSource source, // Source for concepts 84 bool propagateUp, // Propagate to higher levels? 85 psDB *db // Database handle 86 ); 87 bool pmConceptsWriteCell(pmCell *cell, // FPA for which to write concepts 88 pmConceptSource source, // Source for concepts 89 bool propagateUp, // Propagate to higher levels? 90 psDB *db // Database handle 104 105 /// Set the concepts within the chip to the blank value 106 bool pmConceptsBlankChip(pmChip *chip ///< FPA for which to set blank concepts 91 107 ); 92 108 93 // Set up the blank concepts 109 /// Read concepts for a chip; optionally, read concepts at the FPA and cell levels. 110 /// 111 /// Once concepts should be available for reading at the FPA-level, this function attempts to read the 112 /// concepts from the specified source. It also allows concepts to be read at the fpa level (through the 113 /// parent), and the cell level by iterating over the components. 114 bool pmConceptsReadChip(pmChip *chip, ///< Chip for which to read concepts 115 pmConceptSource source, ///< Source for concepts 116 bool propagateUp, ///< Propagate to higher levels? 117 bool propagateDown, ///< Propagate to lower levels? 118 psDB *db ///< Database handle 119 ); 120 121 /// Write concepts for a chip; optionally, write concepts at the FPA and cell levels. 122 /// 123 /// This function writes all concepts for the chip to the specified "source". It also allows concepts to be 124 /// written for the FPA, and the cell level by iterating over the components. 125 bool pmConceptsWriteChip(const pmChip *chip, ///< Chip for which to write concepts 126 pmConceptSource source, ///< Source for concepts 127 bool propagateUp,///< Propagate to higher levels? 128 bool propagateDown, ///< Propagate to lower levels? 129 psDB *db ///< Database handle 130 ); 131 132 /// Set the concepts within the cell to the blank value 133 bool pmConceptsBlankCell(pmCell *cell ///< Cell for which to set blank concepts 134 ); 135 136 /// Read concepts for a cell; optionally, read concepts for the parents. 137 /// 138 /// Once concepts should be available for reading at the FPA-level, this function attempts to read the 139 /// concepts from the specified source. It also allows concepts to be read at upper levels through the 140 /// parents (note, it would not read concepts for all chips, but only the parent of this cell). 141 bool pmConceptsReadCell(pmCell *cell, ///< Cell for which to read concepts 142 pmConceptSource source, ///< Source for concepts 143 bool propagateUp, ///< Propagate to higher levels? 144 psDB *db ///< Database handle 145 ); 146 147 /// Write concepts for a cell; optionally, write concepts for the parents. 148 /// 149 /// This function writes all concepts for the chip to the specified "source". It also allows concepts to be 150 /// written for the upper levels through the parents (note, it would not write concepts for all chips, but 151 /// only the parent of this cell). 152 bool pmConceptsWriteCell(const pmCell *cell, ///< FPA for which to write concepts 153 pmConceptSource source, ///< Source for concepts 154 bool propagateUp, ///< Propagate to higher levels? 155 psDB *db ///< Database handle 156 ); 157 158 /// Initialise the concepts system. 159 /// 160 /// Register the standard concepts, so that concepts may be read and written. This function is called 161 /// automatically the first time the concepts functions are used. 94 162 bool pmConceptsInit(void); 95 // Free the concept specs so there's no memory leak 163 164 /// Signifies that the user is done with the concepts system. 165 /// 166 /// Frees the registered concepts so there is no memory leak when the user checks "persistent" memory. 96 167 void pmConceptsDone(void); 97 168 98 // Copy all the concepts within an FPA to another FPA 99 bool pmFPACopyConcepts(pmFPA *target, // The target FPA 100 pmFPA *source // The target FPA 169 /// Copy all the concepts within an FPA to another FPA 170 /// 171 /// Iterates over all components of the FPA, and copies the concepts metadata from the source to the target. 172 bool pmFPACopyConcepts(pmFPA *target, ///< The target FPA 173 const pmFPA *source ///< The source FPA 101 174 ); 102 175 -
trunk/psModules/src/concepts/pmConceptsAverage.c
r8815 r9572 21 21 22 22 // Set a variety of concepts in a cell by averaging over several 23 bool pmConceptsAverageCells(pmCell *target,// Target cell 24 psList *sources, // List of source cells 25 psRegion *trimsec, // The trim section 26 psRegion *biassec // The bias section 27 ) 23 bool pmConceptsAverageCells(pmCell *target, psList *sources, psRegion *trimsec, psRegion *biassec) 28 24 { 29 25 PS_ASSERT_PTR_NON_NULL(target, false); -
trunk/psModules/src/concepts/pmConceptsAverage.h
r7851 r9572 5 5 #include "pmFPA.h" 6 6 7 // Set a variety of concepts in a cell by averaging over several 8 bool pmConceptsAverageCells(pmCell *target,// Target cell 9 psList *sources, // List of source cells 10 psRegion *trimsec, // The trim section 11 psRegion *biassec // The bias section 7 /// Set a variety of concepts in a cell by averaging over several 8 /// 9 /// In some instances, we want to combine the values of a concept for several cells into a single concept for 10 /// a single cell (e.g., when mosaicking multiple cells into a chip with one "cell"). This function averages 11 /// the values of various concepts: 12 /// - CELL.GAIN 13 /// - CELL.READNOISE 14 /// - CELL.EXPOSURE 15 /// - CELL.DARKTIME 16 /// - CELL.TIME 17 /// For other concepts, it ensures the values are consistent: 18 /// - CELL.READDIR 19 /// - CELL.TIMESYS 20 /// And for others, it takes the "worst" possible value: 21 /// - CELL.SATURATION 22 /// - CELL.BAD 23 bool pmConceptsAverageCells(pmCell *target,///< Target cell 24 psList *sources, ///< List of source cells 25 psRegion *trimsec, ///< The new trim section 26 psRegion *biassec ///< The new bias section 12 27 ); 13 28 -
trunk/psModules/src/concepts/pmConceptsPhotcode.c
r8815 r9572 4 4 5 5 #include <stdio.h> 6 #include <string.h> 6 7 #include <pslib.h> 7 8 8 9 #include "pmConceptsPhotcode.h" 9 10 10 char *pmConceptsPhotcodeForView(pmConfig *config, pmFPAfile *file, pmFPAview *view)11 psString pmConceptsPhotcodeForView(pmConfig *config, pmFPAfile *file, pmFPAview *view) 11 12 { 13 PS_ASSERT_PTR_NON_NULL(config, NULL); 14 PS_ASSERT_PTR_NON_NULL(file, NULL); 15 PS_ASSERT_PTR_NON_NULL(view, NULL); 12 16 13 17 if (view->chip < -1) { 14 psError(PS_ERR_IO, true, " photcodes undefined for FPA: defined by chip\n");18 psError(PS_ERR_IO, true, "Photcodes undefined for FPA: defined by chip\n"); 15 19 return NULL; 16 20 } 17 21 18 22 // select recipe options supplied on command line 19 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, "PHASE2"); 20 if (recipe == NULL) { 21 psError(PS_ERR_IO, true, "recipe PHASE2 not found\n"); 23 bool mdok; // Status of MD lookup 24 psMetadata *recipe = psMetadataLookupPtr(&mdok, config->recipes, "PHASE2"); 25 if (!mdok || !recipe) { 26 psError(PS_ERR_IO, true, "Recipe PHASE2 not found\n"); 22 27 return NULL; 23 28 } 24 29 25 30 // select photcode rule from recipe 26 char *rule = psMetadataLookupStr (NULL, recipe, "PHOTCODE.RULE");27 if ( rule == NULL) {31 char *rule = psMetadataLookupStr(&mdok, recipe, "PHOTCODE.RULE"); 32 if (!mdok || !rule || strlen(rule) == 0) { 28 33 psError(PS_ERR_IO, true, "PHOTCODE.RULE not found in PHASE2 recipe\n"); 29 34 return NULL; … … 31 36 32 37 // convert rule to real photcode 33 char *photcode = pmFPAfileNameFromRule(rule, file, view);38 psString photcode = pmFPAfileNameFromRule(rule, file, view); 34 39 35 40 return photcode; -
trunk/psModules/src/concepts/pmConceptsPhotcode.h
r7679 r9572 2 2 #define PM_CONCEPTS_PHOTCODE_H 3 3 4 #include "pslib.h"4 #include <pslib.h> 5 5 #include "pmConfig.h" 6 6 #include "pmFPAview.h" 7 7 #include "pmFPAfile.h" 8 8 9 char *pmConceptsPhotcodeForView (pmConfig *config, pmFPAfile *file, pmFPAview *view); 9 /// Return the photcode based on the PHOTCODE.RULE in the PHASE2 recipe 10 /// 11 /// A photometry code ("photcode") is a string that represents the combination of filter and detector (chip). 12 /// This functions generates a photcode for a particular chip within the FPA, based on the PHOTCODE.RULE in 13 /// the PHASE2 recipe. Interpolation using the usual syntax (e.g., "{CHIP.NAME}") is permitted. 14 psString pmConceptsPhotcodeForView(pmConfig *config, pmFPAfile *file, pmFPAview *view); 10 15 11 16 # endif -
trunk/psModules/src/concepts/pmConceptsStandard.c
r9539 r9572 30 30 31 31 32 static double defaultCoordScaling( psMetadataItem *pattern)32 static double defaultCoordScaling(const psMetadataItem *pattern) 33 33 { 34 34 if (strcmp(pattern->name, "FPA.RA") == 0) { … … 46 46 47 47 // FPA.RA and FPA.DEC 48 psMetadataItem *p_pmConceptParse_FPA_Coords( psMetadataItem *concept,49 psMetadataItem *pattern,50 psMetadata *cameraFormat,51 pmFPA *fpa,52 pmChip *chip,53 pmCell *cell)48 psMetadataItem *p_pmConceptParse_FPA_Coords(const psMetadataItem *concept, 49 const psMetadataItem *pattern, 50 const psMetadata *cameraFormat, 51 const pmFPA *fpa, 52 const pmChip *chip, 53 const pmCell *cell) 54 54 { 55 55 assert(concept); … … 115 115 116 116 // FPA.RA and FPA.DEC 117 psMetadataItem *p_pmConceptFormat_FPA_Coords( psMetadataItem *concept,118 psMetadata *cameraFormat,119 pmFPA *fpa,120 pmChip *chip,121 pmCell *cell)117 psMetadataItem *p_pmConceptFormat_FPA_Coords(const psMetadataItem *concept, 118 const psMetadata *cameraFormat, 119 const pmFPA *fpa, 120 const pmChip *chip, 121 const pmCell *cell) 122 122 { 123 123 assert(concept); … … 165 165 166 166 167 psMetadataItem *p_pmConceptParse_CELL_TRIMSEC( psMetadataItem *concept,168 psMetadataItem *pattern,169 psMetadata *cameraFormat,170 pmFPA *fpa,171 pmChip *chip,172 pmCell *cell)167 psMetadataItem *p_pmConceptParse_CELL_TRIMSEC(const psMetadataItem *concept, 168 const psMetadataItem *pattern, 169 const psMetadata *cameraFormat, 170 const pmFPA *fpa, 171 const pmChip *chip, 172 const pmCell *cell) 173 173 { 174 174 assert(concept); … … 189 189 } 190 190 191 psMetadataItem *p_pmConceptParse_CELL_BIASSEC( psMetadataItem *concept,192 psMetadataItem *pattern,193 psMetadata *cameraFormat,194 pmFPA *fpa,195 pmChip *chip,196 pmCell *cell)191 psMetadataItem *p_pmConceptParse_CELL_BIASSEC(const psMetadataItem *concept, 192 const psMetadataItem *pattern, 193 const psMetadata *cameraFormat, 194 const pmFPA *fpa, 195 const pmChip *chip, 196 const pmCell *cell) 197 197 { 198 198 assert(concept); … … 245 245 246 246 // CELL.XBIN and CELL.YBIN 247 psMetadataItem *p_pmConceptParse_CELL_Binning( psMetadataItem *concept,248 psMetadataItem *pattern,249 psMetadata *cameraFormat,250 pmFPA *fpa,251 pmChip *chip,252 pmCell *cell)247 psMetadataItem *p_pmConceptParse_CELL_Binning(const psMetadataItem *concept, 248 const psMetadataItem *pattern, 249 const psMetadata *cameraFormat, 250 const pmFPA *fpa, 251 const pmChip *chip, 252 const pmCell *cell) 253 253 { 254 254 assert(concept); … … 282 282 283 283 284 psMetadataItem *p_pmConceptParse_TIMESYS( psMetadataItem *concept,285 psMetadataItem *pattern,286 psMetadata *cameraFormat,287 pmFPA *fpa,288 pmChip *chip,289 pmCell *cell)284 psMetadataItem *p_pmConceptParse_TIMESYS(const psMetadataItem *concept, 285 const psMetadataItem *pattern, 286 const psMetadata *cameraFormat, 287 const pmFPA *fpa, 288 const pmChip *chip, 289 const pmCell *cell) 290 290 { 291 291 assert(concept); … … 311 311 } 312 312 313 psMetadataItem *p_pmConceptParse_TIME( psMetadataItem *concept,314 psMetadataItem *pattern,315 psMetadata *cameraFormat,316 pmFPA *fpa,317 pmChip *chip,318 pmCell *cell)313 psMetadataItem *p_pmConceptParse_TIME(const psMetadataItem *concept, 314 const psMetadataItem *pattern, 315 const psMetadata *cameraFormat, 316 const pmFPA *fpa, 317 const pmChip *chip, 318 const pmCell *cell) 319 319 { 320 320 assert(concept); … … 523 523 524 524 // Correct a position --- in case the user wants FORTRAN indexing (like the FITS standard...) 525 static int fortranCorr( psMetadata *cameraFormat, // The camera format description525 static int fortranCorr(const psMetadata *cameraFormat, // The camera format description 526 526 const char *name // Name of concept to check for FORTRAN indexing 527 527 ) … … 538 538 } 539 539 540 psMetadataItem *p_pmConceptParse_Positions( psMetadataItem *concept,541 psMetadataItem *pattern,542 psMetadata *cameraFormat,543 pmFPA *fpa,544 pmChip *chip,545 pmCell *cell)540 psMetadataItem *p_pmConceptParse_Positions(const psMetadataItem *concept, 541 const psMetadataItem *pattern, 542 const psMetadata *cameraFormat, 543 const pmFPA *fpa, 544 const pmChip *chip, 545 const pmCell *cell) 546 546 { 547 547 assert(concept); … … 572 572 573 573 574 psMetadataItem *p_pmConceptFormat_CELL_TRIMSEC( psMetadataItem *concept,575 psMetadata *cameraFormat,576 pmFPA *fpa,577 pmChip *chip,578 pmCell *cell)574 psMetadataItem *p_pmConceptFormat_CELL_TRIMSEC(const psMetadataItem *concept, 575 const psMetadata *cameraFormat, 576 const pmFPA *fpa, 577 const pmChip *chip, 578 const pmCell *cell) 579 579 { 580 580 assert(concept); … … 588 588 } 589 589 590 psMetadataItem *p_pmConceptFormat_CELL_BIASSEC( psMetadataItem *concept,591 psMetadata *cameraFormat,592 pmFPA *fpa,593 pmChip *chip,594 pmCell *cell)590 psMetadataItem *p_pmConceptFormat_CELL_BIASSEC(const psMetadataItem *concept, 591 const psMetadata *cameraFormat, 592 const pmFPA *fpa, 593 const pmChip *chip, 594 const pmCell *cell) 595 595 { 596 596 // Return a metadata item containing a list of metadata items of region strings … … 614 614 // This function actually does both CELL.XBIN and CELL.YBIN if CELL.XBIN and CELL.YBIN are specified by the 615 615 // same header. 616 psMetadataItem *p_pmConceptFormat_CELL_XBIN( psMetadataItem *concept,617 psMetadata *cameraFormat,618 pmFPA *fpa,619 pmChip *chip,620 pmCell *cell)616 psMetadataItem *p_pmConceptFormat_CELL_XBIN(const psMetadataItem *concept, 617 const psMetadata *cameraFormat, 618 const pmFPA *fpa, 619 const pmChip *chip, 620 const pmCell *cell) 621 621 { 622 622 assert(concept); … … 637 637 638 638 // Otherwise, there's no formatting required 639 return psMe mIncrRefCounter(concept);639 return psMetadataItemCopy(concept); 640 640 } 641 641 642 642 // Only need to format if both if CELL.XBIN and CELL.YBIN are not specified by the same header. 643 psMetadataItem *p_pmConceptFormat_CELL_YBIN( psMetadataItem *concept,644 psMetadata *cameraFormat,645 pmFPA *fpa,646 pmChip *chip,647 pmCell *cell)643 psMetadataItem *p_pmConceptFormat_CELL_YBIN(const psMetadataItem *concept, 644 const psMetadata *cameraFormat, 645 const pmFPA *fpa, 646 const pmChip *chip, 647 const pmCell *cell) 648 648 { 649 649 assert(concept); … … 660 660 661 661 // No formatting required 662 return psMe mIncrRefCounter(concept);663 } 664 665 666 psMetadataItem *p_pmConceptFormat_TIMESYS( psMetadataItem *concept,667 psMetadata *cameraFormat,668 pmFPA *fpa,669 pmChip *chip,670 pmCell *cell)662 return psMetadataItemCopy(concept); 663 } 664 665 666 psMetadataItem *p_pmConceptFormat_TIMESYS(const psMetadataItem *concept, 667 const psMetadata *cameraFormat, 668 const pmFPA *fpa, 669 const pmChip *chip, 670 const pmCell *cell) 671 671 { 672 672 psString sys = NULL; // String to store … … 693 693 } 694 694 695 psMetadataItem *p_pmConceptFormat_TIME( psMetadataItem *concept,696 psMetadata *cameraFormat,697 pmFPA *fpa,698 pmChip *chip,699 pmCell *cell)695 psMetadataItem *p_pmConceptFormat_TIME(const psMetadataItem *concept, 696 const psMetadata *cameraFormat, 697 const pmFPA *fpa, 698 const pmChip *chip, 699 const pmCell *cell) 700 700 { 701 701 psTime *time = concept->data.V; // The time … … 808 808 } 809 809 810 psMetadataItem *p_pmConceptFormat_Positions( psMetadataItem *concept,811 psMetadata *cameraFormat,812 pmFPA *fpa,813 pmChip *chip,814 pmCell *cell)810 psMetadataItem *p_pmConceptFormat_Positions(const psMetadataItem *concept, 811 const psMetadata *cameraFormat, 812 const pmFPA *fpa, 813 const pmChip *chip, 814 const pmCell *cell) 815 815 { 816 816 assert(concept); -
trunk/psModules/src/concepts/pmConceptsStandard.h
r9510 r9572 2 2 #define PM_CONCEPTS_STANDARD_H 3 3 4 #include "pslib.h"4 #include <pslib.h> 5 5 #include "pmFPA.h" 6 6 7 7 // Functions to parse and format the standard concepts 8 8 9 psMetadataItem *p_pmConceptParse_FPA_Coords(psMetadataItem *concept, 10 psMetadataItem *pattern, 11 psMetadata *cameraFormat, 12 pmFPA *fpa, 13 pmChip *chip, 14 pmCell *cell); 15 psMetadataItem *p_pmConceptFormat_FPA_Coords(psMetadataItem *concept, 16 psMetadata *cameraFormat, 17 pmFPA *fpa, 18 pmChip *chip, 19 pmCell *cell); 20 psMetadataItem *p_pmConceptParse_CELL_TRIMSEC(psMetadataItem *concept, 21 psMetadataItem *pattern, 22 psMetadata *cameraFormat, 23 pmFPA *fpa, 24 pmChip *chip, 25 pmCell *cell); 26 psMetadataItem *p_pmConceptParse_CELL_BIASSEC(psMetadataItem *concept, 27 psMetadataItem *pattern, 28 psMetadata *cameraFormat, 29 pmFPA *fpa, 30 pmChip *chip, 31 pmCell *cell); 32 psMetadataItem *p_pmConceptParse_CELL_Binning(psMetadataItem *concept, 33 psMetadataItem *pattern, 34 psMetadata *cameraFormat, 35 pmFPA *fpa, 36 pmChip *chip, 37 pmCell *cell); 38 psMetadataItem *p_pmConceptParse_TIMESYS(psMetadataItem *concept, 39 psMetadataItem *pattern, 40 psMetadata *cameraFormat, 41 pmFPA *fpa, 42 pmChip *chip, 43 pmCell *cell); 44 psMetadataItem *p_pmConceptParse_TIME(psMetadataItem *concept, 45 psMetadataItem *pattern, 46 psMetadata *cameraFormat, 47 pmFPA *fpa, 48 pmChip *chip, 49 pmCell *cell); 50 psMetadataItem *p_pmConceptParse_Positions(psMetadataItem *concept, 51 psMetadataItem *pattern, 52 psMetadata *cameraFormat, 53 pmFPA *fpa, 54 pmChip *chip, 55 pmCell *cell); 56 psMetadataItem *p_pmConceptFormat_CELL_TRIMSEC(psMetadataItem *concept, 57 psMetadata *cameraFormat, 58 pmFPA *fpa, 59 pmChip *chip, 60 pmCell *cell); 61 psMetadataItem *p_pmConceptFormat_CELL_BIASSEC(psMetadataItem *concept, 62 psMetadata *cameraFormat, 63 pmFPA *fpa, 64 pmChip *chip, 65 pmCell *cell); 66 psMetadataItem *p_pmConceptFormat_CELL_XBIN(psMetadataItem *concept, 67 psMetadata *cameraFormat, 68 pmFPA *fpa, 69 pmChip *chip, 70 pmCell *cell); 71 psMetadataItem *p_pmConceptFormat_CELL_YBIN(psMetadataItem *concept, 72 psMetadata *cameraFormat, 73 pmFPA *fpa, 74 pmChip *chip, 75 pmCell *cell); 76 psMetadataItem *p_pmConceptFormat_TIMESYS(psMetadataItem *concept, 77 psMetadata *cameraFormat, 78 pmFPA *fpa, 79 pmChip *chip, 80 pmCell *cell); 81 psMetadataItem *p_pmConceptFormat_TIME(psMetadataItem *concept, 82 psMetadata *cameraFormat, 83 pmFPA *fpa, 84 pmChip *chip, 85 pmCell *cell); 86 psMetadataItem *p_pmConceptFormat_Positions(psMetadataItem *concept, 87 psMetadata *cameraFormat, 88 pmFPA *fpa, 89 pmChip *chip, 90 pmCell *cell); 9 10 /// Parse the coordinates concepts: FPA.RA and FPA.DEC 11 psMetadataItem *p_pmConceptParse_FPA_Coords(const psMetadataItem *concept, ///< Concept to parse 12 const psMetadataItem *pattern, ///< Pattern to use in parsing 13 const psMetadata *cameraFormat, ///< Camera format definition 14 const pmFPA *fpa, ///< FPA for concept, or NULL 15 const pmChip *chip, ///< Chip for concept, or NULL 16 const pmCell *cell ///< Cell for concept, or NULL 17 ); 18 19 /// Format the coordinates concepts: FPA.RA and FPA.DEC 20 psMetadataItem *p_pmConceptFormat_FPA_Coords(const psMetadataItem *concept, ///< Concept to format 21 const psMetadata *cameraFormat, ///< Camera format definition 22 const pmFPA *fpa, ///< FPA for concept, or NULL 23 const pmChip *chip, ///< Chip for concept, or NULL 24 const pmCell *cell ///< Cell for concept, or NULL 25 ); 26 27 /// Parse the CELL.TRIMSEC concept 28 psMetadataItem *p_pmConceptParse_CELL_TRIMSEC(const psMetadataItem *concept, ///< Concept to parse 29 const psMetadataItem *pattern, ///< Pattern to use in parsing 30 const psMetadata *cameraFormat, ///< Camera format definition 31 const pmFPA *fpa, ///< FPA for concept, or NULL 32 const pmChip *chip, ///< Chip for concept, or NULL 33 const pmCell *cell ///< Cell for concept, or NULL 34 ); 35 36 /// Parse the CELL.BIASSEC concept 37 psMetadataItem *p_pmConceptParse_CELL_BIASSEC(const psMetadataItem *concept, ///< Concept to parse 38 const psMetadataItem *pattern, ///< Pattern to use in parsing 39 const psMetadata *cameraFormat, ///< Camera format definition 40 const pmFPA *fpa, ///< FPA for concept, or NULL 41 const pmChip *chip, ///< Chip for concept, or NULL 42 const pmCell *cell ///< Cell for concept, or NULL 43 ); 44 45 /// Parse the cell binning concepts: CELL.XBIN, CELL.YBIN 46 psMetadataItem *p_pmConceptParse_CELL_Binning(const psMetadataItem *concept, ///< Concept to parse 47 const psMetadataItem *pattern, ///< Pattern to use in parsing 48 const psMetadata *cameraFormat, ///< Camera format definition 49 const pmFPA *fpa, ///< FPA for concept, or NULL 50 const pmChip *chip, ///< Chip for concept, or NULL 51 const pmCell *cell ///< Cell for concept, or NULL 52 ); 53 54 /// Parse the time system concepts: FPA.TIMESYS and CELL.TIMESYS 55 psMetadataItem *p_pmConceptParse_TIMESYS(const psMetadataItem *concept, ///< Concept to parse 56 const psMetadataItem *pattern, ///< Pattern to use in parsing 57 const psMetadata *cameraFormat, ///< Camera format definition 58 const pmFPA *fpa, ///< FPA for concept, or NULL 59 const pmChip *chip, ///< Chip for concept, or NULL 60 const pmCell *cell ///< Cell for concept, or NULL 61 ); 62 63 /// Parse the time concepts: FPA.TIME and CELL.TIME 64 psMetadataItem *p_pmConceptParse_TIME(const psMetadataItem *concept, ///< Concept to parse 65 const psMetadataItem *pattern, ///< Pattern to use in parsing 66 const psMetadata *cameraFormat, ///< Camera format definition 67 const pmFPA *fpa, ///< FPA for concept, or NULL 68 const pmChip *chip, ///< Chip for concept, or NULL 69 const pmCell *cell ///< Cell for concept, or NULL 70 ); 71 72 /// Parse a cell position concept, e.g., CELL.X0 73 psMetadataItem *p_pmConceptParse_Positions(const psMetadataItem *concept, ///< Concept to parse 74 const psMetadataItem *pattern, ///< Pattern to use in parsing 75 const psMetadata *cameraFormat, ///< Camera format definition 76 const pmFPA *fpa, ///< FPA for concept, or NULL 77 const pmChip *chip, ///< Chip for concept, or NULL 78 const pmCell *cell ///< Cell for concept, or NULL 79 ); 80 81 /// Format the CELL.TRIMSEC concept 82 psMetadataItem *p_pmConceptFormat_CELL_TRIMSEC(const psMetadataItem *concept, ///< Concept to format 83 const psMetadata *cameraFormat, ///< Camera format definition 84 const pmFPA *fpa, ///< FPA for concept, or NULL 85 const pmChip *chip, ///< Chip for concept, or NULL 86 const pmCell *cell ///< Cell for concept, or NULL 87 ); 88 89 /// Format the CELL.BIASSEC concept 90 psMetadataItem *p_pmConceptFormat_CELL_BIASSEC(const psMetadataItem *concept, ///< Concept to format 91 const psMetadata *cameraFormat, ///< Camera format definition 92 const pmFPA *fpa, ///< FPA for concept, or NULL 93 const pmChip *chip, ///< Chip for concept, or NULL 94 const pmCell *cell ///< Cell for concept, or NULL 95 ); 96 97 /// Format the CELL.XBIN concept 98 psMetadataItem *p_pmConceptFormat_CELL_XBIN(const psMetadataItem *concept, ///< Concept to format 99 const psMetadata *cameraFormat, ///< Camera format definition 100 const pmFPA *fpa, ///< FPA for concept, or NULL 101 const pmChip *chip, ///< Chip for concept, or NULL 102 const pmCell *cell ///< Cell for concept, or NULL 103 ); 104 105 /// Format the CELL.YBIN concept 106 psMetadataItem *p_pmConceptFormat_CELL_YBIN(const psMetadataItem *concept, ///< Concept to format 107 const psMetadata *cameraFormat, ///< Camera format definition 108 const pmFPA *fpa, ///< FPA for concept, or NULL 109 const pmChip *chip, ///< Chip for concept, or NULL 110 const pmCell *cell ///< Cell for concept, or NULL 111 ); 112 113 /// Format the time system concepts: FPA.TIMESYS and CELL.TIMESYS 114 psMetadataItem *p_pmConceptFormat_TIMESYS(const psMetadataItem *concept, ///< Concept to format 115 const psMetadata *cameraFormat, ///< Camera format definition 116 const pmFPA *fpa, ///< FPA for concept, or NULL 117 const pmChip *chip, ///< Chip for concept, or NULL 118 const pmCell *cell ///< Cell for concept, or NULL 119 ); 120 121 /// Format the time concepts: FPA.TIME and CELL.TIME 122 psMetadataItem *p_pmConceptFormat_TIME(const psMetadataItem *concept, ///< Concept to format 123 const psMetadata *cameraFormat, ///< Camera format definition 124 const pmFPA *fpa, ///< FPA for concept, or NULL 125 const pmChip *chip, ///< Chip for concept, or NULL 126 const pmCell *cell ///< Cell for concept, or NULL 127 ); 128 129 /// Format a cell position concept, e.g., CELL.X0 130 psMetadataItem *p_pmConceptFormat_Positions(const psMetadataItem *concept, ///< Concept to format 131 const psMetadata *cameraFormat, ///< Camera format definition 132 const pmFPA *fpa, ///< FPA for concept, or NULL 133 const pmChip *chip, ///< Chip for concept, or NULL 134 const pmCell *cell ///< Cell for concept, or NULL 135 ); 91 136 92 137 #endif -
trunk/psModules/src/concepts/pmConceptsWrite.c
r9570 r9572 18 18 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 19 19 20 static bool compareConcepts( psMetadataItem *compare, // Item to compare21 psMetadataItem *standard // Standard for comparison20 static bool compareConcepts(const psMetadataItem *compare, // Item to compare 21 const psMetadataItem *standard // Standard for comparison 22 22 ) 23 23 { … … 105 105 106 106 // Format a single concept 107 static psMetadataItem *conceptFormat( pmConceptSpec *spec, // The concept specification108 psMetadataItem *concept, // The concept to parse109 psMetadata *cameraFormat, // The camera format110 pmFPA *fpa, // The FPA111 pmChip *chip, // The chip112 pmCell *cell // The cell107 static psMetadataItem *conceptFormat(const pmConceptSpec *spec, // The concept specification 108 const psMetadataItem *concept, // The concept to parse 109 const psMetadata *cameraFormat, // The camera format 110 const pmFPA *fpa, // The FPA 111 const pmChip *chip, // The chip 112 const pmCell *cell // The cell 113 113 ) 114 114 { … … 121 121 formatted = spec->format(concept, cameraFormat, fpa, chip, cell); 122 122 } else { 123 formatted = psMemIncrRefCounter( concept);123 formatted = psMemIncrRefCounter((const psPtr)concept); 124 124 } 125 125 … … 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; may be NULL134 const psMetadataItem *item // Item to add to the header; may be NULL 135 135 ) 136 136 { … … 182 182 static bool writeHeader(pmHDU *hdu, // HDU for which to add to the header 183 183 const char *keywords, // Keywords to add 184 psMetadataItem *item // Item to add to the header184 const psMetadataItem *item // Item to add to the header 185 185 ) 186 186 { … … 220 220 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 221 221 222 bool p_pmConceptsWriteToCells(psMetadata *specs, // The concept specifications 223 pmCell *cell, // The cell 224 psMetadata *concepts // The concepts 225 ) 222 bool p_pmConceptsWriteToCells(const psMetadata *specs, const pmCell *cell, const psMetadata *concepts) 226 223 { 227 224 PS_ASSERT_PTR_NON_NULL(specs, false); … … 230 227 return false; 231 228 } 232 if (!cell->config) 233 return false; 229 if (!cell->config) { 230 return false; 231 } 234 232 235 233 pmHDU *hdu = pmHDUGetLowest(NULL, NULL, cell); // The HDU at the lowest level … … 291 289 } 292 290 293 bool p_pmConceptsWriteToDefaults(psMetadata *specs, // The concept specifications 294 pmFPA *fpa, // The FPA 295 pmChip *chip, // The chip 296 pmCell *cell, // The cell 297 psMetadata *concepts // The concepts 298 ) 291 bool p_pmConceptsWriteToDefaults(const psMetadata *specs, const pmFPA *fpa, const pmChip *chip, 292 const pmCell *cell, psMetadata *concepts) 299 293 { 300 294 PS_ASSERT_PTR_NON_NULL(specs, false); … … 357 351 358 352 359 bool p_pmConceptsWriteToHeader(psMetadata *specs, // The concept specifications 360 pmFPA *fpa, // The FPA 361 pmChip *chip, // The chip 362 pmCell *cell, // The cell 363 psMetadata *concepts // The concepts 364 ) 353 bool p_pmConceptsWriteToHeader(const psMetadata *specs, const pmFPA *fpa, const pmChip *chip, 354 const pmCell *cell, const psMetadata *concepts) 365 355 { 366 356 PS_ASSERT_PTR_NON_NULL(specs, false); … … 405 395 406 396 // XXX Warning: This code has not been tested at all 407 bool p_pmConceptsWriteToDatabase(psMetadata *specs, // The concept specifications 408 pmFPA *fpa, // The FPA 409 pmChip *chip, // The chip 410 pmCell *cell, // The cell 411 psDB *db,// The database handle 412 psMetadata *concepts // The concepts 413 ) 397 bool p_pmConceptsWriteToDatabase(const psMetadata *specs, const pmFPA *fpa, const pmChip *chip, 398 const pmCell *cell, psDB *db, const psMetadata *concepts) 414 399 { 415 400 PS_ASSERT_PTR_NON_NULL(specs, false); -
trunk/psModules/src/concepts/pmConceptsWrite.h
r9570 r9572 5 5 #include "pmFPA.h" 6 6 7 bool p_pmConceptsWriteToCells(psMetadata *specs, // The concept specifications 8 pmCell *cell, // The cell 9 psMetadata *concepts // The concepts 7 /// "Write" concepts to (actually, check against) the camera format file's CELLS. 8 /// 9 /// Examines the CELLS metadata in the camera format file for the current type of cell, and checks that the 10 /// concepts as defined there match the ones defined in the cell. A warning is produced if the concepts do 11 /// not match. 12 bool p_pmConceptsWriteToCells(const psMetadata *specs, ///< The concept specifications 13 const pmCell *cell, ///< The cell 14 const psMetadata *concepts ///< The concepts 10 15 ); 11 bool p_pmConceptsWriteToDefaults(psMetadata *specs, // The concept specifications 12 pmFPA *fpa, // The FPA 13 pmChip *chip, // The chip 14 pmCell *cell, // The cell 15 psMetadata *concepts // The concepts 16 17 /// "Write" concepts to (actually, check against) the camera format file's DEFAULTS. 18 /// 19 /// Examines the DEFAULTS metadata in the camera format file, and checks that the concepts as defined there 20 /// match the ones defined in the cell. A warning is produced if the concepts do not match. 21 bool p_pmConceptsWriteToDefaults(const psMetadata *specs, ///< The concept specifications 22 const pmFPA *fpa, ///< The FPA 23 const pmChip *chip, ///< The chip 24 const pmCell *cell, ///< The cell 25 const psMetadata *concepts ///< The concepts 16 26 ); 17 bool p_pmConceptsWriteToHeader(psMetadata *specs, // The concept specifications 18 pmFPA *fpa, // The FPA 19 pmChip *chip, // The chip 20 pmCell *cell, // The cell 21 psMetadata *concepts // The concepts 27 28 /// "Write" concepts to (actually, add to, pending a later write) the FITS header. 29 /// 30 /// Examines the FITS header TRANSLATION metadata in the camera format file, and writes concepts to the 31 /// appropriate FITS headers in the HDU, in preparation for a future write of the HDU. 32 bool p_pmConceptsWriteToHeader(const psMetadata *specs, ///< The concept specifications 33 const pmFPA *fpa, ///< The FPA 34 const pmChip *chip, ///< The chip 35 const pmCell *cell, ///< The cell 36 const psMetadata *concepts ///< The concepts 22 37 ); 23 bool p_pmConceptsWriteToDatabase(psMetadata *specs, // The concept specifications 24 pmFPA *fpa, // The FPA 25 pmChip *chip, // The chip 26 pmCell *cell, // The cell 27 psDB *db,// The database handle 28 psMetadata *concepts // The concepts 38 39 /// Write concepts to the database. 40 /// 41 /// Examines the DATABASE metadata in the camera format file, and writes concepts to the database. 42 /// Warning: This function has not been tested; use at your own risk. 43 bool p_pmConceptsWriteToDatabase(const psMetadata *specs, ///< The concept specifications 44 const pmFPA *fpa, ///< The FPA 45 const pmChip *chip, ///< The chip 46 const pmCell *cell, ///< The cell 47 psDB *db,///< The database handle 48 const psMetadata *concepts ///< The concepts 29 49 ); 30 50
Note:
See TracChangeset
for help on using the changeset viewer.
