Changeset 18561 for trunk/ippTools/src/warptool.c
- Timestamp:
- Jul 15, 2008, 10:30:59 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/warptool.c (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/warptool.c
r18336 r18561 109 109 { 110 110 PS_ASSERT_PTR_NON_NULL(config, false); 111 112 // required options 113 PXOPT_LOOKUP_S64(fake_id, config->args, "-fake_id", true, false); 114 PXOPT_LOOKUP_STR(mode, config->args, "-mode", true, false); 115 // check mode 116 if (mode && !isValidMode(config, mode)) { 117 psError(PS_ERR_UNKNOWN, false, "invalud mode"); 118 return false; 119 } 120 PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); 121 122 // optional 111 112 PXOPT_LOOKUP_S64(fake_id, config->args, "-fake_id", true, false); // required 113 PXOPT_LOOKUP_STR(mode, config->args, "-mode", true, false); // required 114 PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); // required 123 115 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 124 116 PXOPT_LOOKUP_STR(dvodb, config->args, "-dvodb", false, false); 125 117 PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", false, false); 126 118 PXOPT_LOOKUP_STR(end_stage, config->args, "-end_stage", false, false); 127 128 // default129 119 PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false); 130 120 PXOPT_LOOKUP_BOOL(magiced, config->args, "-magiced", false); 131 121 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 122 123 // check mode 124 if (mode && !isValidMode(config, mode)) { 125 psError(PS_ERR_UNKNOWN, false, "invalid mode"); 126 return false; 127 } 132 128 133 129 warpRunRow *warpRun = warpRunRowAlloc( … … 190 186 PXOPT_COPY_STR(config->args, where, "-reduction", "reduction", "=="); 191 187 PXOPT_COPY_STR(config->args, where, "-filter", "filter", "=="); 192 193 PXOPT_COPY_F64(config->args, where, "-airmass_min", "airmass", ">="); 194 PXOPT_COPY_F64(config->args, where, "-airmass_max", "airmass", "<"); 188 PXOPT_COPY_F32(config->args, where, "-airmass_min", "airmass", ">="); 189 PXOPT_COPY_F32(config->args, where, "-airmass_max", "airmass", "<"); 195 190 PXOPT_COPY_F64(config->args, where, "-ra_min", "ra", ">="); 196 191 PXOPT_COPY_F64(config->args, where, "-ra_max", "ra", "<"); … … 211 206 PXOPT_COPY_F64(config->args, where, "-az_min", "az", ">="); 212 207 PXOPT_COPY_F64(config->args, where, "-az_max", "az", "<"); 213 PXOPT_COPY_F 32(config->args, where, "-ccd_temp_min", "ccd_temp", ">=");214 PXOPT_COPY_F 32(config->args, where, "-ccd_temp_max", "ccd_temp", "<");208 PXOPT_COPY_F64(config->args, where, "-ccd_temp_min", "ccd_temp", ">="); 209 PXOPT_COPY_F64(config->args, where, "-ccd_temp_max", "ccd_temp", "<"); 215 210 PXOPT_COPY_F64(config->args, where, "-posang_min", "posang", ">="); 216 211 PXOPT_COPY_F64(config->args, where, "-posang_max", "posang", "<"); … … 262 257 PS_ASSERT_PTR_NON_NULL(config, false); 263 258 259 psMetadata *where = psMetadataAlloc(); 260 PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "=="); 261 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 262 264 263 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 265 264 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); … … 272 271 } 273 272 274 if ( config->where) {275 psString whereClause = psDBGenerateWhereConditionSQL( config->where, "warpRun");273 if (psListLength(where->list)) { 274 psString whereClause = psDBGenerateWhereConditionSQL(where, "warpRun"); 276 275 psStringAppend(&query, " AND %s", whereClause); 277 276 psFree(whereClause); 278 277 } 278 psFree(where); 279 279 280 280 // treat limit == 0 as "no limit" … … 331 331 PS_ASSERT_PTR_NON_NULL(config, false); 332 332 333 psMetadata *where = psMetadataAlloc(); 334 PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "=="); 335 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 336 333 337 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 334 338 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); … … 341 345 } 342 346 343 if ( config->where) {344 psString whereClause = psDBGenerateWhereConditionSQL( config->where, "warpRun");347 if (psListLength(where->list)) { 348 psString whereClause = psDBGenerateWhereConditionSQL(where, "warpRun"); 345 349 psStringAppend(&query, " AND %s", whereClause); 346 350 psFree(whereClause); 347 351 } 352 psFree(where); 348 353 349 354 // treat limit == 0 as "no limit" … … 400 405 PS_ASSERT_PTR_NON_NULL(config, false); 401 406 407 psMetadata *where = psMetadataAlloc(); 408 PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "=="); 409 402 410 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 403 411 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); … … 410 418 } 411 419 412 if ( config->where) {413 psString whereClause = psDBGenerateWhereConditionSQL( config->where, "warpRun");420 if (psListLength(where->list)) { 421 psString whereClause = psDBGenerateWhereConditionSQL(where, "warpRun"); 414 422 psStringAppend(&query, " AND %s", whereClause); 415 423 psFree(whereClause); 416 424 } 425 psFree(where); 417 426 418 427 // treat limit == 0 as "no limit" … … 571 580 PS_ASSERT_PTR_NON_NULL(config, false); 572 581 582 psMetadata *where = psMetadataAlloc(); 583 PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "=="); 584 PXOPT_COPY_STR(config->args, where, "-skycell_id", "skycell_id", "=="); 585 PXOPT_COPY_STR(config->args, where, "-tess_id", "tess_id", "=="); 586 573 587 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 574 588 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); … … 581 595 } 582 596 583 if ( config->where) {584 psString whereClause = psDBGenerateWhereConditionSQL( config->where, "warpSkyCellMap");597 if (psListLength(where->list)) { 598 psString whereClause = psDBGenerateWhereConditionSQL(where, "warpSkyCellMap"); 585 599 psStringAppend(&query, " AND %s", whereClause); 586 600 psFree(whereClause); 587 601 } 602 psFree(where); 588 603 589 604 // treat limit == 0 as "no limit" … … 635 650 } 636 651 637 638 652 static bool towarpedMode(pxConfig *config) 639 653 { 640 654 PS_ASSERT_PTR_NON_NULL(config, false); 655 656 psMetadata *where = psMetadataAlloc(); 657 PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "=="); 641 658 642 659 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); … … 650 667 } 651 668 652 if ( config->where) {653 psString whereClause = psDBGenerateWhereConditionSQL( config->where, "warpSkyCellMap");669 if (psListLength(where->list)) { 670 psString whereClause = psDBGenerateWhereConditionSQL(where, "warpSkyCellMap"); 654 671 psStringAppend(&query, " AND %s", whereClause); 655 672 psFree(whereClause); 656 673 } 674 psFree(where); 657 675 658 676 // treat limit == 0 as "no limit" … … 891 909 PS_ASSERT_PTR_NON_NULL(config, false); 892 910 911 psMetadata *where = psMetadataAlloc(); 912 PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "=="); 913 PXOPT_COPY_STR(config->args, where, "-skycell_id", "skycell_id", "=="); 914 PXOPT_COPY_STR(config->args, where, "-tess_id", "tess_id", "=="); 915 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 916 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 917 893 918 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 894 919 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); … … 901 926 } 902 927 903 if ( config->where) {904 psString whereClause = psDBGenerateWhereConditionSQL( config->where, "warpSkyfile");928 if (psListLength(where->list)) { 929 psString whereClause = psDBGenerateWhereConditionSQL(where, "warpSkyfile"); 905 930 psStringAppend(&query, " AND %s", whereClause); 906 931 psFree(whereClause); 907 932 } 933 psFree(where); 908 934 909 935 // treat limit == 0 as "no limit" … … 962 988 psMetadata *where = psMetadataAlloc(); 963 989 PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "=="); 990 PXOPT_COPY_STR(config->args, where, "-skycell_id", "skycell_id", "=="); 991 PXOPT_COPY_STR(config->args, where, "-tess_id", "tess_id", "=="); 964 992 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 965 993 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 966 994 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 967 PXOPT_COPY_STR(config->args, where, "-skycell_id", "skycell_id", "==");968 PXOPT_COPY_STR(config->args, where, "-tess_id", "tess_id", "==");969 995 970 996 // XXX These may need to be updated with the table name? … … 980 1006 PXOPT_COPY_STR(config->args, where, "-filter", "filter", "=="); 981 1007 982 PXOPT_COPY_F 64(config->args, where, "-airmass_min", "airmass", ">=");983 PXOPT_COPY_F 64(config->args, where, "-airmass_max", "airmass", "<");1008 PXOPT_COPY_F32(config->args, where, "-airmass_min", "airmass", ">="); 1009 PXOPT_COPY_F32(config->args, where, "-airmass_max", "airmass", "<"); 984 1010 PXOPT_COPY_F64(config->args, where, "-ra_min", "ra", ">="); 985 1011 PXOPT_COPY_F64(config->args, where, "-ra_max", "ra", "<"); … … 1000 1026 PXOPT_COPY_F64(config->args, where, "-az_min", "az", ">="); 1001 1027 PXOPT_COPY_F64(config->args, where, "-az_max", "az", "<"); 1002 PXOPT_COPY_F 32(config->args, where, "-ccd_temp_min", "ccd_temp", ">=");1003 PXOPT_COPY_F 32(config->args, where, "-ccd_temp_max", "ccd_temp", "<");1028 PXOPT_COPY_F64(config->args, where, "-ccd_temp_min", "ccd_temp", ">="); 1029 PXOPT_COPY_F64(config->args, where, "-ccd_temp_max", "ccd_temp", "<"); 1004 1030 PXOPT_COPY_F64(config->args, where, "-posang_min", "posang", ">="); 1005 1031 PXOPT_COPY_F64(config->args, where, "-posang_max", "posang", "<"); … … 1007 1033 PXOPT_COPY_F32(config->args, where, "-solang_min", "solang", ">="); 1008 1034 PXOPT_COPY_F32(config->args, where, "-solang_max", "solang", "<"); 1009 //PXOPT_COPY_S16(config->args, where, "-code", "fault", "==");1035 PXOPT_COPY_S16(config->args, where, "-code", "fault", "=="); 1010 1036 1011 1037 if (!psListLength(where->list)
Note:
See TracChangeset
for help on using the changeset viewer.
