Changeset 11450
- Timestamp:
- Jan 30, 2007, 2:39:07 PM (19 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 2 added
- 5 edited
-
camera/pmFPAfileIO.c (modified) (1 diff)
-
config/Makefile.am (modified) (2 diffs)
-
config/pmConfigCommand.c (added)
-
config/pmConfigCommand.h (added)
-
detrend/pmDetrendDB.c (modified) (5 diffs)
-
detrend/pmDetrendDB.h (modified) (2 diffs)
-
psmodules.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAfileIO.c
r11357 r11450 233 233 234 234 psFree (file->filename); 235 file->filename = pmDetrendFile (file->filextra, extra);235 file->filename = pmDetrendFile(file->filextra, extra, config); 236 236 if (file->filename == NULL) { 237 237 psError(PS_ERR_IO, false, "failed to find a valid detrend image for detID %s : classID %s\n", file->filextra, extra); -
trunk/psModules/src/config/Makefile.am
r11253 r11450 7 7 pmConfigRecipes.c \ 8 8 pmConfigCamera.c \ 9 pmConfigCommand.c \ 9 10 pmVersion.c \ 10 11 pmErrorCodes.c … … 14 15 pmConfigRecipes.h \ 15 16 pmConfigCamera.h \ 17 pmConfigCommand.h \ 16 18 pmVersion.h \ 17 19 pmErrorCodes.h -
trunk/psModules/src/detrend/pmDetrendDB.c
r11421 r11450 7 7 #include <pslib.h> 8 8 #include "pmConfig.h" 9 #include "pmConfigCommand.h" 9 10 #include "pmFPA.h" 10 11 #include "pmFPALevel.h" … … 101 102 PS_ASSERT_PTR_NON_NULL(config->site, NULL); 102 103 103 bool mdok; // Status of MD lookup104 const char *dbserver = psMetadataLookupStr(&mdok, config->site, "DBSERVER"); // Database server105 if (!mdok || strlen(dbserver) == 0) {106 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find DBSERVER in site configuration.\n");107 return NULL;108 }109 const char *dbname = psMetadataLookupStr(&mdok, config->site, "DBNAME"); // Database name110 if (!mdok || strlen(dbname) == 0) {111 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find DBNAME in site configuration.\n");112 return NULL;113 }114 const char *dbuser = psMetadataLookupStr(&mdok, config->site, "DBUSER"); // Database user115 if (!mdok || strlen(dbuser) == 0) {116 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find DBUSER in site configuration.\n");117 return NULL;118 }119 const char *dbpassword = psMetadataLookupStr(&mdok, config->site, "DBPASSWORD"); // Database password120 if (!mdok || strlen(dbpassword) == 0) {121 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find DBPASSWORD in site configuration.\n");122 return NULL;123 }124 125 104 int status, exit_status; 126 char *line = NULL;105 psString line = NULL; 127 106 char *time = psTimeToISO (&options->time); 128 107 char *type = pmDetrendTypeToString (options->type); … … 130 109 131 110 pmDetrendSelectResults *results = pmDetrendSelectResultsAlloc(); 132 psStringAppend (&line, "detselect -search -inst %s -det_type %s -time %s " 133 "-dbserver %s -dbname %s -dbuser %s -dbpassword %s", 134 options->camera, type, time, dbserver, dbname, dbuser, dbpassword); 111 psStringAppend(&line, "detselect -search -inst %s -det_type %s -time %s", options->camera, type, time); 135 112 136 113 if (options->filter) { 137 psStringAppend (&line, " -filter %s", options->filter);114 psStringAppend(&line, " -filter %s", options->filter); 138 115 } 139 116 if (options->exptime > -1.0) { 140 psStringAppend (&line, " -exptime %f", options->exptime);117 psStringAppend(&line, " -exptime %f", options->exptime); 141 118 } 142 119 if (options->airmass > -1.0) { 143 psStringAppend (&line, " -airmass %f", options->airmass); 144 } 145 120 psStringAppend(&line, " -airmass %f", options->airmass); 121 } 122 123 pmConfigDatabaseCommand(&line, config); 124 pmConfigTraceCommand(&line); 146 125 psTrace("psModules.detrend", 5, "running %s", line); 147 126 … … 214 193 // detselect -select -detID (detID) -classID (classID) 215 194 // returns: (detID) (classID) (filename) DONE 216 char *pmDetrendFile (const char *detID, const char *classID )195 char *pmDetrendFile (const char *detID, const char *classID, const pmConfig *config) 217 196 { 218 197 unsigned int nFail; … … 222 201 223 202 bool status; 224 char *line = NULL;203 psString line = NULL; 225 204 psArray *array = NULL; 226 205 227 206 // generate the detselect command 228 207 psStringAppend (&line, "detselect -select %s -class_id %s", detID, classID); 208 pmConfigDatabaseCommand(&line, config); 209 pmConfigTraceCommand(&line); 229 210 psTrace("psModules.detrend", 5, "running %s", line); 230 211 -
trunk/psModules/src/detrend/pmDetrendDB.h
r11421 r11450 9 9 * @author EAM, IfA 10 10 * 11 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2007-01-3 0 04:46:20$11 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2007-01-31 00:35:24 $ 13 13 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii 14 14 */ … … 65 65 pmDetrendSelectResults *pmDetrendSelectResultsAlloc(); 66 66 pmDetrendSelectResults *pmDetrendSelect (const pmDetrendSelectOptions *options, const pmConfig *config); 67 char *pmDetrendFile (const char *detID, const char *classID );67 char *pmDetrendFile (const char *detID, const char *classID, const pmConfig *config); 68 68 69 69 /// @} -
trunk/psModules/src/psmodules.h
r11126 r11450 13 13 #include <pmConfig.h> 14 14 #include <pmConfigRecipes.h> 15 #include <pmConfigCamera.h> 16 #include <pmConfigCommand.h> 15 17 #include <pmVersion.h> 16 18
Note:
See TracChangeset
for help on using the changeset viewer.
