Changeset 21229
- Timestamp:
- Jan 29, 2009, 3:39:49 PM (17 years ago)
- Location:
- branches/eam_branch_20081230/ppArith/src
- Files:
-
- 6 edited
-
ppArith.c (modified) (2 diffs)
-
ppArith.h (modified) (1 diff)
-
ppArithArguments.c (modified) (7 diffs)
-
ppArithLoop.c (modified) (7 diffs)
-
ppArithReadout.c (modified) (3 diffs)
-
ppArithVersion.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20081230/ppArith/src/ppArith.c
r15571 r21229 1 /** @file ppArith.c 2 * 3 * @brief 4 * 5 * @ingroup ppArith 6 * 7 * @author IfA 8 * @version $Revision: 1.4.32.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-01-30 01:38:08 $ 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 */ 12 1 13 #ifdef HAVE_CONFIG_H 2 14 #include <config.h> … … 11 23 int main(int argc, char *argv[]) 12 24 { 13 psExit exitValue = PS_EXIT_SUCCESS; / / Exit value25 psExit exitValue = PS_EXIT_SUCCESS; /** Exit value */ 14 26 psTimerStart("ppArith"); 15 27 psLibInit(NULL); 16 28 17 pmConfig *config = pmConfigRead(&argc, argv, PPARITH_RECIPE); / / Configuration29 pmConfig *config = pmConfigRead(&argc, argv, PPARITH_RECIPE); /** Configuration */ 18 30 if (!config) { 19 31 psErrorStackPrint(stderr, "Error reading configuration."); -
branches/eam_branch_20081230/ppArith/src/ppArith.h
r15571 r21229 1 /** @file ppArith.h 2 * 3 * @brief 4 * 5 * @ingroup ppArith 6 * 7 * @author IfA 8 * @version $Revision: 1.3.32.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-01-30 01:37:55 $ 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 */ 12 13 1 14 #ifndef PP_ARITH_H 2 15 #define PP_ARITH_H 3 16 4 #define PPARITH_RECIPE "PPARITH" /// Name of the recipe to use 17 /// @addtogroup ppArith 18 /// @{ 19 #define PPARITH_RECIPE "PPARITH" /** Name of the recipe to use */ 5 20 6 21 /// Parse the arguments 7 bool ppArithArguments(int argc, char *argv[], / //< Command-line arguments8 pmConfig *config / //< Configuration22 bool ppArithArguments(int argc, char *argv[], /**< Command-line arguments */ 23 pmConfig *config /**< Configuration */ 9 24 ); 10 25 11 26 /// Parse the camera input 12 bool ppArithCamera(pmConfig *config / //< Configuration27 bool ppArithCamera(pmConfig *config /**< Configuration */ 13 28 ); 14 29 15 30 /// Loop over the FPA hierarchy 16 bool ppArithLoop(pmConfig *config / //< Configuration31 bool ppArithLoop(pmConfig *config /**< Configuration */ 17 32 ); 18 33 19 34 /// Perform arithmetic on the readout 20 bool ppArithReadout(pmReadout *output, / //< Output readout21 const pmReadout *input1, / //< Input readout22 const pmReadout *input2, / //< Input readout23 const pmConfig *config, / //< Configuration24 const pmFPAview *view / //< View of readout on which to operate35 bool ppArithReadout(pmReadout *output, /**< Output readout */ 36 const pmReadout *input1, /**< Input readout */ 37 const pmReadout *input2, /**< Input readout */ 38 const pmConfig *config, /**< Configuration */ 39 const pmFPAview *view /**< View of readout on which to operate */ 25 40 ); 26 41 27 42 /// Put the program version information into a metadata 28 void ppArithVersionMetadata(psMetadata *metadata / //< Metadata to populate43 void ppArithVersionMetadata(psMetadata *metadata /**< Metadata to populate */ 29 44 ); 30 45 46 ///@} 31 47 32 48 #endif -
branches/eam_branch_20081230/ppArith/src/ppArithArguments.c
r16189 r21229 1 /** @file ppArithArguments.c 2 * 3 * @brief 4 * 5 * @ingroup ppArith 6 * 7 * @author IfA 8 * @version $Revision: 1.4.30.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-01-30 01:38:25 $ 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 */ 12 1 13 #ifdef HAVE_CONFIG_H 2 14 #include <config.h> … … 35 47 ) 36 48 { 37 psString value = psMetadataLookupStr(NULL, arguments, argName); / / Value of interest49 psString value = psMetadataLookupStr(NULL, arguments, argName); /** Value of interest */ 38 50 if (value && strlen(value) > 0) { 39 51 return psMetadataAddStr(target, PS_LIST_TAIL, mdName, 0, NULL, value); … … 42 54 } 43 55 44 // Add a single filename to the arguments as an array, so that it can be used with pmFPAfileBindFromArgs, etc 56 /** 57 * \fn fileList 58 * Add a single filename to the arguments as an array, so that it can be used with pmFPAfileBindFromArgs, etc 59 */ 45 60 static void fileList(const char *file, // The symbolic name for the file 46 61 const char *name, // The name of the file … … 60 75 assert(config); 61 76 62 psMetadata *arguments = psMetadataAlloc(); / / Command-line arguments77 psMetadata *arguments = psMetadataAlloc(); /** Command-line arguments */ 63 78 psMetadataAddStr(arguments, PS_LIST_TAIL, "-file1", 0, "First image", NULL); 64 79 psMetadataAddStr(arguments, PS_LIST_TAIL, "-op", 0, "Operation to perform", NULL); … … 74 89 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "MASK", 0, "Produce a mask image?", isMask); 75 90 const char *inFilerule = isMask ? "PPARITH.INPUT.MASK" : "PPARITH.INPUT.IMAGE"; // Input file rule 76 const char *outFilerule = isMask ? "PPARITH.OUTPUT.MASK" : "PPARITH.OUTPUT.IMAGE"; / / Output file rule91 const char *outFilerule = isMask ? "PPARITH.OUTPUT.MASK" : "PPARITH.OUTPUT.IMAGE"; /** Output file rule */ 77 92 psMetadataAddStr(config->arguments, PS_LIST_TAIL, "FILERULE.INPUT", 0, 78 93 "File rule for input", inFilerule); … … 80 95 "File rule for output", outFilerule); 81 96 82 bool status = false; / / Status for file definition97 bool status = false; /** Status for file definition */ 83 98 84 99 // First file 85 const char *name1 = psMetadataLookupStr(NULL, arguments, "-file1"); / / Name of first image100 const char *name1 = psMetadataLookupStr(NULL, arguments, "-file1"); /** Name of first image */ 86 101 if (!name1 || strlen(name1) == 0) { 87 102 psError(PS_ERR_UNEXPECTED_NULL, true, "No input image specified."); … … 100 115 101 116 // Second file is optional (won't be one for unary operations) 102 const char *name2 = psMetadataLookupStr(NULL, arguments, "-file2"); / / Name of second image117 const char *name2 = psMetadataLookupStr(NULL, arguments, "-file2"); /** Name of second image */ 103 118 if (name2 && strlen(name2) > 0) { 104 119 fileList("INPUT2", name2, "Name of the second input image", config); -
branches/eam_branch_20081230/ppArith/src/ppArithLoop.c
r18070 r21229 1 /** @file ppArithLoop.c 2 * 3 * @brief 4 * 5 * @ingroup ppArith 6 * 7 * @author IfA 8 * @version $Revision: 1.6.28.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-01-30 01:39:11 $ 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 */ 12 1 13 #ifdef HAVE_CONFIG_H 2 14 #include <config.h> … … 16 28 PS_ASSERT_PTR_NON_NULL(config, false); 17 29 18 bool mdok; / / Status of MD lookup30 bool mdok; /** Status of MD lookup */ 19 31 const char *statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS"); // Filename for statistics 20 psMetadata *stats = NULL; / / Container for statistics21 FILE *statsFile = NULL; / / File stream for statistics32 psMetadata *stats = NULL; /** Container for statistics */ 33 FILE *statsFile = NULL; /** File stream for statistics */ 22 34 if (statsName && strlen(statsName) > 0) { 23 psString resolved = pmConfigConvertFilename(statsName, config, true, true); / / Resolved filename35 psString resolved = pmConfigConvertFilename(statsName, config, true, true); /** Resolved filename */ 24 36 statsFile = fopen(resolved, "w"); 25 37 if (!statsFile) { … … 33 45 } 34 46 35 const char *outName = psMetadataLookupStr(NULL, config->arguments, "FILERULE.OUTPUT"); / / Output filerule36 pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); / / Output file47 const char *outName = psMetadataLookupStr(NULL, config->arguments, "FILERULE.OUTPUT"); /** Output filerule */ 48 pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); /** Output file */ 37 49 assert(output); // We added it earlier 38 50 39 const char *inName = psMetadataLookupStr(NULL, config->arguments, "FILERULE.INPUT"); / / Input filerule40 pmFPAfile *input1 = NULL, *input2 = NULL; / / Input files41 psString fileRegex = NULL; // Regular expression to find input files51 const char *inName = psMetadataLookupStr(NULL, config->arguments, "FILERULE.INPUT"); /** Input filerule */ 52 pmFPAfile *input1 = NULL, *input2 = NULL; /** Input files */ 53 psString fileRegex = NULL; /** Regular expression to find input files */ 42 54 psStringAppend(&fileRegex, "^%s$", inName); 43 55 psMetadataIterator *iter = psMetadataIteratorAlloc(config->files, PS_LIST_HEAD, fileRegex); // Iterator 44 psMetadataItem *item = psMetadataGetAndIncrement(iter); / / Item from iteration56 psMetadataItem *item = psMetadataGetAndIncrement(iter); /** Item from iteration */ 45 57 input1 = item->data.V; 46 58 assert(input1); // It should be there! … … 51 63 psFree(iter); 52 64 53 pmFPAview *view = pmFPAviewAlloc(0); / / Pointer into FPA hierarchy54 pmHDU *lastHDU = NULL; / / Last HDU that was updated65 pmFPAview *view = pmFPAviewAlloc(0); /** Pointer into FPA hierarchya */ 66 pmHDU *lastHDU = NULL; /** Last HDU that was updated */ 55 67 56 68 // Iterate over the FPA hierarchy … … 59 71 } 60 72 61 pmChip *outChip; / / Output chip of interest73 pmChip *outChip; /** Output chip of interest */ 62 74 while ((outChip = pmFPAviewNextChip(view, output->fpa, 1)) != NULL) { 63 pmChip *inChip1 = pmFPAviewThisChip(view, input1->fpa); / / Input chip of interest64 pmChip *inChip2 = input2 ? pmFPAviewThisChip(view, input2->fpa) : NULL; / / Input chip of interest75 pmChip *inChip1 = pmFPAviewThisChip(view, input1->fpa); /** Input chip of interest */ 76 pmChip *inChip2 = input2 ? pmFPAviewThisChip(view, input2->fpa) : NULL; /** Input chip of interest */ 65 77 if (inChip2 && ((!inChip1->file_exists && inChip2->file_exists) || 66 78 (inChip1->file_exists && !inChip2->file_exists))) { … … 78 90 } 79 91 80 pmCell *outCell; / / Cell of interest92 pmCell *outCell; /** Cell of interest */ 81 93 while ((outCell = pmFPAviewNextCell(view, output->fpa, 1)) != NULL) { 82 pmCell *inCell1 = pmFPAviewThisCell(view, input1->fpa); / / Input cell of interest83 pmCell *inCell2 = input2 ? pmFPAviewThisCell(view, input2->fpa) : NULL; / / Input cell of interest94 pmCell *inCell1 = pmFPAviewThisCell(view, input1->fpa); /** Input cell of interest */ 95 pmCell *inCell2 = input2 ? pmFPAviewThisCell(view, input2->fpa) : NULL; /** Input cell of interest */ 84 96 if (inCell2 && ((!inCell1->file_exists && inCell2->file_exists) || 85 97 (inCell1->file_exists && !inCell2->file_exists))) { … … 110 122 return false; 111 123 } 112 pmReadout *inRO1 = pmFPAviewThisReadout(view, input1->fpa);/ / Input readout of interest124 pmReadout *inRO1 = pmFPAviewThisReadout(view, input1->fpa);/** Input readout of interest */ 113 125 pmReadout *inRO2 = input2 ? pmFPAviewThisReadout(view, input2->fpa) : 114 NULL;/ / Input readout of interest126 NULL;/** Input readout of interest */ 115 127 116 128 if (inRO2 && ((!inRO1->data_exists && inRO2->data_exists) || -
branches/eam_branch_20081230/ppArith/src/ppArithReadout.c
r21087 r21229 1 /** @file ppArithReadout.c 2 * 3 * @brief 4 * 5 * @ingroup ppArith 6 * 7 * @author IfA 8 * @version $Revision: 1.2.32.2 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-01-30 01:39:32 $ 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 */ 12 1 13 #ifdef HAVE_CONFIG_H 2 14 #include <config.h> … … 17 29 PS_ASSERT_PTR_NON_NULL(view, false); 18 30 19 bool mdok; / / Status of MD lookup31 bool mdok; /** Status of MD lookup */ 20 32 bool isMask = psMetadataLookupBool(&mdok, config->arguments, "MASK"); 21 33 22 psImage *inImage1; / / Input image 123 psImage *outImage; / / Output image34 psImage *inImage1; /** Input image 1 */ 35 psImage *outImage; /** Output image */ 24 36 if (isMask) { 25 37 inImage1 = input1->mask; … … 42 54 PS_ASSERT_IMAGE_NON_NULL(inImage1, false); 43 55 44 psImage *inImage2 = NULL; / / Input image 256 psImage *inImage2 = NULL; /** Input image 2 */ 45 57 if (input2) { 46 58 inImage2 = isMask ? input2->mask : input2->image; -
branches/eam_branch_20081230/ppArith/src/ppArithVersion.c
r15571 r21229 1 /** @file ppArithVersion.c 2 * 3 * @brief 4 * 5 * @ingroup ppArith 6 * 7 * @author IfA 8 * @version $Revision: 1.1.32.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-01-30 01:39:49 $ 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 */ 12 1 13 #ifdef HAVE_CONFIG_H 2 14 #include <config.h> … … 10 22 #include "ppArith.h" 11 23 12 static const char *cvsTag = "$Name: not supported by cvs2svn $";/ / CVS tag name24 static const char *cvsTag = "$Name: not supported by cvs2svn $";/** CVS tag name */ 13 25 14 26 psString ppArithVersion(void) 15 27 { 16 psString version = NULL; / / Version, to return28 psString version = NULL; /** Version, to return */ 17 29 psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION); 18 30 return version; … … 21 33 psString ppArithVersionLong(void) 22 34 { 23 psString version = ppArithVersion(); / / Version, to return35 psString version = ppArithVersion(); /** Version, to return */ 24 36 psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag 25 37 psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__); … … 33 45 PS_ASSERT_METADATA_NON_NULL(metadata,); 34 46 35 psString pslib = psLibVersionLong();/ / psLib version36 psString psmodules = psModulesVersionLong(); / / psModules version37 psString ppStats = ppStatsVersionLong(); / / ppStats version38 psString ppArith = ppArithVersionLong(); / / ppArith version47 psString pslib = psLibVersionLong();/** psLib version */ 48 psString psmodules = psModulesVersionLong(); /** psModules version */ 49 psString ppStats = ppStatsVersionLong(); /** ppStats version */ 50 psString ppArith = ppArithVersionLong(); /** ppArith version */ 39 51 40 psTime *time = psTimeGetNow(PS_TIME_TAI); / / The time now41 psString timeString = psTimeToISO(time); / / The time in an ISO string52 psTime *time = psTimeGetNow(PS_TIME_TAI); /** The time now */ 53 psString timeString = psTimeToISO(time); /** The time in an ISO string */ 42 54 psFree(time); 43 psString head = NULL; / / Head string55 psString head = NULL; /** Head string */ 44 56 psStringAppend(&head, "ppArith processing at %s. Component information:", timeString); 45 57 psFree(timeString);
Note:
See TracChangeset
for help on using the changeset viewer.
