Changeset 25086
- Timestamp:
- Aug 16, 2009, 9:18:31 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sj_branches/sj_ippTests_branch_20080929/ippTests/compIPPphoto.py
r25085 r25086 619 619 def goodValBool(col): 620 620 """Return a bool array that contains True where 621 col 1doesn't have NaNs nor SDSS "no-value" and621 col doesn't have NaNs nor SDSS "no-value" and 622 622 "no-error" flags -9999 and -1000.""" 623 623 from numpy import isfinite,array … … 632 632 "no-error" flags -9999 and -1000 filtered out.""" 633 633 from numpy import isfinite,logical_and,array 634 goodcondition = isfinite(col1) & isfinite(col2) 635 for val in [-9999,-1000]: 636 goodcondition &= (col1 != val) 637 goodcondition &= (col2 != val) 634 goodcondition = goodValBool(col1) & goodValBool(col2) 638 635 col1 = col1[goodcondition] 639 # For some reason, the following line used to be640 # col2_good = col2[goodcondition]641 # which looks like an error642 636 col2 = col2[goodcondition] 643 637 return col1,col2 644 #645 #... so I'm doing this:646 good1_l = []647 good2_l = []648 for v1,v2 in zip(col1,col2):649 if isfinite(v1) and isfinite(v2) and v1 not in [-9999,-1000] and v2 not in [-9999,-1000]:650 good1_l.append(v1)651 good2_l.append(v2)652 return array(good1_l),array(good2_l)653 638 654 639 def filterGoodVal3(col1,col2,col3): … … 656 641 col1 and col2 have NaNs and SDSS "no-value" and 657 642 "no-error" flags -9999 and -1000 filtered out.""" 658 from numpy import isfinite,array 659 # 660 #... so I'm doing this: 661 good1_l = [] 662 good2_l = [] 663 good3_l = [] 664 for i in range(len(col1)): 665 v1 = col1[i] 666 v2 = col2[i] 667 v3 = col3[i] 668 if isfinite(v1) and isfinite(v2) and isfinite(v3) and \ 669 v1 not in [-9999,-1000] and v2 not in [-9999,-1000] and \ 670 v3 not in [-9999,-1000]: 671 good1_l.append(v1) 672 good2_l.append(v2) 673 good3_l.append(v3) 674 return array(good1_l),array(good2_l),array(good3_l) 643 from numpy import isfinite,logical_and,array 644 goodcondition = goodValBool(col1) & goodValBool(col2) & goodValBool(col3) 645 col1 = col1[goodcondition] 646 col2 = col2[goodcondition] 647 col3 = col3[goodcondition] 648 return col1,col2,col3 675 649 676 650 def matchSdssPs1(SDSSfpObjc,PS1cmf,xoff=0.5,yoff=0.5,matchrad=0.7,skipMatch=False):
Note:
See TracChangeset
for help on using the changeset viewer.
