Changeset 18153 for branches/cleanup/ippTools/src/dettool.c
- Timestamp:
- Jun 16, 2008, 1:49:43 PM (18 years ago)
- File:
-
- 1 edited
-
branches/cleanup/ippTools/src/dettool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cleanup/ippTools/src/dettool.c
r16868 r18153 535 535 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 536 536 537 PXOPT_LOOKUP_BOOL(randomSubset, config->args, "-random_subset", false); 538 PXOPT_LOOKUP_S32(randomLimit, config->args, "-random_limit", false, false); 539 537 540 PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false); 538 541 PXOPT_LOOKUP_TIME(time_begin, config->args, "-time_begin", false, false); … … 549 552 PXOPT_COPY_STR(config->args, where, "-select_uri", "uri", "=="); 550 553 PXOPT_COPY_TIME(config->args, where, "-select_dateobs_begin", "dateobs", ">="); 551 PXOPT_COPY_TIME(config->args, where, "-select_dateobs_end", "dateobs", "< ");554 PXOPT_COPY_TIME(config->args, where, "-select_dateobs_end", "dateobs", "<="); 552 555 PXOPT_COPY_F32(config->args, where, "-select_airmass_min", "airmass", ">="); 553 556 PXOPT_COPY_F32(config->args, where, "-select_airmass_max", "airmass", "<="); … … 557 560 PXOPT_COPY_F32(config->args, where, "-select_ccd_temp_min", "ccd_temp", ">="); 558 561 PXOPT_COPY_F32(config->args, where, "-select_ccd_temp_max", "ccd_temp", "<="); 562 PXOPT_COPY_F32(config->args, where, "-select_pon_time_min", "pon_time", ">="); 563 PXOPT_COPY_F32(config->args, where, "-select_pon_time_max", "pon_time", "<="); 559 564 PXOPT_COPY_F32(config->args, where, "-select_posang_min", "posang", ">="); 560 565 PXOPT_COPY_F32(config->args, where, "-select_posang_max", "posang", "<="); … … 584 589 psFree(detrendExps); 585 590 return true; 591 } 592 593 if (randomSubset && (randomLimit < detrendExps->n)) { 594 // generate a random-valued vector, return an index sorted by the random values 595 psVector *randomVector = psVectorAlloc(detrendExps->n, PS_TYPE_F32); // random values 596 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); 597 for (int i = 0; i < randomVector->n; i++) { 598 randomVector->data.F32[i] = psRandomUniform(rng); 599 } 600 psVector *indexVector = psVectorSortIndex(NULL, randomVector); 601 602 // accept for first n of the sequence 603 psArray *subset = psArrayAlloc (randomLimit); 604 for (int i = 0; i < randomLimit; i++ ){ 605 int j = indexVector->data.S32[i]; 606 subset->data[i] = psMemIncrRefCounter (detrendExps->data[j]); 607 } 608 psFree (detrendExps); 609 detrendExps = subset; 586 610 } 587 611
Note:
See TracChangeset
for help on using the changeset viewer.
