Changeset 25870 for branches/eam_branches/20090820/ippTools/src/pxadd.c
- Timestamp:
- Oct 18, 2009, 10:23:28 AM (17 years ago)
- Location:
- branches/eam_branches/20090820
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippTools/src/pxadd.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090820
-
branches/eam_branches/20090820/ippTools/src/pxadd.c
r25766 r25870 29 29 #include "pxadd.h" 30 30 31 bool pxaddSetSearchArgs (psMetadata *md) { 32 33 psMetadataAddS64(md, PS_LIST_TAIL, "-add_id", 0, "search by add_id", 0); 34 psMetadataAddS64(md, PS_LIST_TAIL, "-cam_id", 0, "search by cam_id", 0); 35 36 /* psMetadataAddStr(md, PS_LIST_TAIL, "-exp_name", 0, "search by exp_name", NULL); */ 37 /* psMetadataAddStr(md, PS_LIST_TAIL, "-inst", 0, "search for camera", NULL); */ 38 /* psMetadataAddStr(md, PS_LIST_TAIL, "-telescope", 0, "search for telescope", NULL); */ 39 /* psMetadataAddTime(md, PS_LIST_TAIL, "-dateobs_begin", 0, "search for exposures by time (>=)", NULL); */ 40 /* psMetadataAddTime(md, PS_LIST_TAIL, "-dateobs_end", 0, "search for exposures by time (<)", NULL); */ 41 /* psMetadataAddStr(md, PS_LIST_TAIL, "-exp_tag", 0, "search by exp_tag", NULL); */ 42 /* psMetadataAddStr(md, PS_LIST_TAIL, "-exp_type", 0, "search by exp_type", NULL); */ 43 /* psMetadataAddStr(md, PS_LIST_TAIL, "-comment", 0, "search by comment", NULL); */ 44 /* psMetadataAddStr(md, PS_LIST_TAIL, "-filelevel", 0, "search by filelevel", NULL); */ 45 /* psMetadataAddStr(md, PS_LIST_TAIL, "-filter", 0, "search for filter", NULL); */ 46 /* psMetadataAddF64(md, PS_LIST_TAIL, "-airmass_min", 0, "define min airmass", NAN); */ 47 /* psMetadataAddF64(md, PS_LIST_TAIL, "-airmass_max", 0, "define max airmass", NAN); */ 48 /* psMetadataAddF64(md, PS_LIST_TAIL, "-ra_min", 0, "define min RA (degrees) ", NAN); */ 49 /* psMetadataAddF64(md, PS_LIST_TAIL, "-ra_max", 0, "define max RA (degrees) ", NAN); */ 50 /* psMetadataAddF64(md, PS_LIST_TAIL, "-decl_min", 0, "define min DEC (degrees)", NAN); */ 51 /* psMetadataAddF64(md, PS_LIST_TAIL, "-decl_max", 0, "define max DEC (degrees)", NAN); */ 52 /* psMetadataAddF32(md, PS_LIST_TAIL, "-exp_time_min", 0, "define min exposure time", NAN); */ 53 /* psMetadataAddF32(md, PS_LIST_TAIL, "-exp_time_max", 0, "define max exposure time", NAN); */ 54 /* psMetadataAddF32(md, PS_LIST_TAIL, "-sat_pixel_frac_min", 0, "define max fraction of saturated pixels", NAN); */ 55 /* psMetadataAddF32(md, PS_LIST_TAIL, "-sat_pixel_frac_max", 0, "define max fraction of saturated pixels", NAN); */ 56 /* psMetadataAddF64(md, PS_LIST_TAIL, "-bg_min", 0, "define min background", NAN); */ 57 /* psMetadataAddF64(md, PS_LIST_TAIL, "-bg_max", 0, "define max background", NAN); */ 58 /* psMetadataAddF64(md, PS_LIST_TAIL, "-bg_stdev_min", 0, "define min background standard deviation", NAN); */ 59 /* psMetadataAddF64(md, PS_LIST_TAIL, "-bg_stdev_max", 0, "define max background standard deviation", NAN); */ 60 /* psMetadataAddF64(md, PS_LIST_TAIL, "-bg_mean_stdev_min", 0, "define min background mean standard deviation (across imfiles)", NAN); */ 61 /* psMetadataAddF64(md, PS_LIST_TAIL, "-bg_mean_stdev_max", 0, "define max background mean standard deviation (across imfiles)", NAN); */ 62 /* psMetadataAddF64(md, PS_LIST_TAIL, "-alt_min", 0, "define min altitude", NAN); */ 63 /* psMetadataAddF64(md, PS_LIST_TAIL, "-alt_max", 0, "define max altitude", NAN); */ 64 /* psMetadataAddF64(md, PS_LIST_TAIL, "-az_min", 0, "define min azimuth ", NAN); */ 65 /* psMetadataAddF64(md, PS_LIST_TAIL, "-az_max", 0, "define max azimuth ", NAN); */ 66 /* psMetadataAddF32(md, PS_LIST_TAIL, "-ccd_temp_min", 0, "define min ccd tempature", NAN); */ 67 /* psMetadataAddF32(md, PS_LIST_TAIL, "-ccd_temp_max", 0, "define max ccd tempature", NAN); */ 68 /* psMetadataAddF64(md, PS_LIST_TAIL, "-posang_min", 0, "define min rotator position angle", NAN); */ 69 /* psMetadataAddF64(md, PS_LIST_TAIL, "-posang_max", 0, "define max rotator position angle", NAN); */ 70 /* psMetadataAddStr(md, PS_LIST_TAIL, "-object", 0, "search by exposure object", NULL); */ 71 /* psMetadataAddF32(md, PS_LIST_TAIL, "-sun_angle_min", 0, "define min solar angle", NAN); */ 72 /* psMetadataAddF32(md, PS_LIST_TAIL, "-sun_angle_max", 0, "define max solar angle", NAN); */ 73 74 return true; 75 } 76 77 bool pxaddGetSearchArgs (pxConfig *config, psMetadata *where) { 78 79 PXOPT_COPY_S64(config->args, where, "-add_id", "addRun.add_id", "=="); 80 /* PXOPT_COPY_S64(config->args, where, "-cam_id", "camRun.cam_id", "=="); */ 81 /* PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "=="); */ 82 /* PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "=="); */ 83 /* PXOPT_COPY_STR(config->args, where, "-exp_name", "rawExp.exp_name", "=="); */ 84 /* PXOPT_COPY_STR(config->args, where, "-inst", "rawExp.camera", "=="); */ 85 /* PXOPT_COPY_STR(config->args, where, "-telescope", "rawExp.telescope", "=="); */ 86 /* PXOPT_COPY_TIME(config->args, where, "-dateobs_begin", "rawExp.dateobs", ">="); */ 87 /* PXOPT_COPY_TIME(config->args, where, "-dateobs_end", "rawExp.dateobs", "<="); */ 88 /* PXOPT_COPY_STR(config->args, where, "-exp_tag", "rawExp.exp_tag", "=="); */ 89 /* PXOPT_COPY_STR(config->args, where, "-exp_type", "rawExp.exp_type", "=="); */ 90 /* PXOPT_COPY_STR(config->args, where, "-comment", "rawExp.comment", "LIKE"); */ 91 /* PXOPT_COPY_STR(config->args, where, "-filelevel", "rawExp.filelevel", "=="); */ 92 /* PXOPT_COPY_STR(config->args, where, "-filter", "rawExp.filter", "=="); */ 93 /* PXOPT_COPY_F64(config->args, where, "-airmass_min", "rawExp.airmass", ">="); */ 94 /* PXOPT_COPY_F64(config->args, where, "-airmass_max", "rawExp.airmass", "<"); */ 95 /* PXOPT_COPY_RADEC(config->args, where, "-ra_min", "rawExp.ra", ">="); */ 96 /* PXOPT_COPY_RADEC(config->args, where, "-ra_max", "rawExp.ra", "<"); */ 97 /* PXOPT_COPY_RADEC(config->args, where, "-decl_min", "rawExp.decl", ">="); */ 98 /* PXOPT_COPY_RADEC(config->args, where, "-decl_max", "rawExp.decl", "<"); */ 99 /* PXOPT_COPY_F32(config->args, where, "-exp_time_min", "rawExp.exp_time", ">="); */ 100 /* PXOPT_COPY_F32(config->args, where, "-exp_time_max", "rawExp.exp_time", "<"); */ 101 /* PXOPT_COPY_F32(config->args, where, "-sat_pixel_frac_min", "rawExp.sat_pixel_frac", ">="); */ 102 /* PXOPT_COPY_F32(config->args, where, "-sat_pixel_frac_max", "rawExp.sat_pixel_frac", "<"); */ 103 /* PXOPT_COPY_F64(config->args, where, "-bg_min", "rawExp.bg", ">="); */ 104 /* PXOPT_COPY_F64(config->args, where, "-bg_max", "rawExp.bg", "<"); */ 105 /* PXOPT_COPY_F64(config->args, where, "-bg_stdev_min", "rawExp.bg_stdev", ">="); */ 106 /* PXOPT_COPY_F64(config->args, where, "-bg_stdev_max", "rawExp.bg_stdev", "<"); */ 107 /* PXOPT_COPY_F64(config->args, where, "-bg_mean_stdev_min", "rawExp.bg_mean_stdev", ">="); */ 108 /* PXOPT_COPY_F64(config->args, where, "-bg_mean_stdev_max", "rawExp.bg_mean_stdev", "<"); */ 109 /* PXOPT_COPY_F64(config->args, where, "-alt_min", "rawExp.alt", ">="); */ 110 /* PXOPT_COPY_F64(config->args, where, "-alt_max", "rawExp.alt", "<"); */ 111 /* PXOPT_COPY_F64(config->args, where, "-az_min", "rawExp.az", ">="); */ 112 /* PXOPT_COPY_F64(config->args, where, "-az_max", "rawExp.az", "<"); */ 113 /* PXOPT_COPY_F32(config->args, where, "-ccd_temp_min", "rawExp.ccd_temp", ">="); */ 114 /* PXOPT_COPY_F32(config->args, where, "-ccd_temp_max", "rawExp.ccd_temp", "<"); */ 115 /* PXOPT_COPY_F64(config->args, where, "-posang_min", "rawExp.posang", ">="); */ 116 /* PXOPT_COPY_F64(config->args, where, "-posang_max", "rawExp.posang", "<"); */ 117 /* PXOPT_COPY_STR(config->args, where, "-object", "rawExp.object", "=="); */ 118 /* PXOPT_COPY_F32(config->args, where, "-sun_angle_min", "rawExp.sun_angle", ">="); */ 119 /* PXOPT_COPY_F32(config->args, where, "-sun_angle_max", "rawExp.sun_angle", "<"); */ 120 121 return true; 122 } 123 124 bool pxaddRunSetState(pxConfig *config, psS64 add_id, const char *state, psS64 magicked) 31 bool pxaddRunSetState(pxConfig *config, psS64 add_id, const char *state) 125 32 { 126 33 PS_ASSERT_PTR_NON_NULL(config, false); … … 134 41 } 135 42 136 char *query = "UPDATE addRun SET state = '%s', magicked = %" PRId64 " WHERE add_id = %" PRId64; 137 if (!p_psDBRunQueryF(config->dbh, query, state, magicked, add_id)) { 138 psError(PS_ERR_UNKNOWN, false, 139 "failed to change state for add_id %" PRId64, add_id); 43 char *query = "UPDATE addRun SET state = '%s' WHERE add_id = %" PRId64; 44 if (!p_psDBRunQueryF(config->dbh, query, state, add_id)) { 45 psError(PS_ERR_UNKNOWN, false, "failed to change state for add_id %" PRId64, add_id); 140 46 return false; 141 47 } … … 216 122 } 217 123 218 // Need to think more about this to see what we want it to do. BROKEN219 124 bool pxaddQueueByCamID(pxConfig *config, 220 125 psS64 cam_id, 221 126 char *workdir, 127 char *reduction, 222 128 char *label, 223 char *recipe, 224 char *dvodb) 129 char *data_group, 130 char *dvodb, 131 char *note, 132 bool image_only) 225 133 { 226 134 PS_ASSERT_PTR_NON_NULL(config, false); … … 236 144 } 237 145 } 238 // fprintf(stderr,"%s",query); 146 239 147 // queue the exp 240 // XXX chip_id is being cast here work around psS64 have a different type241 // differenton 32/64148 // Note: cam_id is being cast here work around psS64 have a different type different 149 // on 32/64 242 150 if (!p_psDBRunQueryF(config->dbh, query, 243 151 "new", // state 244 workdir ? workdir : "NULL",152 workdir ? workdir : "NULL", 245 153 "dirty", //workdir_state 246 label ? label : "NULL", 247 dvodb ? dvodb : "NULL", 248 (long long)cam_id 154 reduction? reduction : "NULL", 155 label ? label : "NULL", 156 data_group ? data_group : "NULL", 157 dvodb ? dvodb : "NULL", 158 note ? note : "NULL", 159 image_only, 160 (long long) cam_id 249 161 )) { 250 162 psError(PS_ERR_UNKNOWN, false, "database error");
Note:
See TracChangeset
for help on using the changeset viewer.
