Changeset 1644 for trunk/python
- Timestamp:
- 10/04/09 00:53:18 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asaplinefind.py
r929 r1644 41 41 42 42 def set_options(self,threshold=1.7320508075688772,min_nchan=3, 43 avg_limit=8,box_size=0.2 ):43 avg_limit=8,box_size=0.2,noise_box='all',noise_stat='mean80'): 44 44 """ 45 45 Set the parameters of the algorithm … … 55 55 this parameter can be averaged to search for 56 56 broad lines. Default is 8. 57 box_size A running mean box size specified as a fraction57 box_size A running mean/median box size specified as a fraction 58 58 of the total spectrum length. Default is 1/5 59 noise_box Area of the spectrum used to estimate noise stats 60 Both string values and numbers are allowed 61 Allowed string values: 62 'all' use all the spectrum (default) 63 'box' noise box is the same as running mean/median 64 box 65 Numeric values are defined as a fraction from the 66 spectrum size. Values should be positive. 67 (noise_box == box_size has the same effect as 68 noise_box = 'box') 69 noise_stat Statistics used to estimate noise, allowed values: 70 'mean80' use the 80% of the lowest deviations 71 in the noise box (default) 72 'median' median of deviations in the noise box 73 59 74 Note: For bad baselines threshold should be increased, 60 75 and avg_limit decreased (or even switched off completely by … … 62 77 undulations instead of real lines. 63 78 """ 64 self.finder.setoptions(threshold,min_nchan,avg_limit,box_size) 79 if noise_stat.lower() not in ["mean80",'median']: 80 raise RuntimeError, "noise_stat argument in linefinder.set_options can only be mean80 or median" 81 nStat = (noise_stat.lower() == "median") 82 nBox = -1. 83 if isinstance(noise_box,str): 84 if noise_box.lower() not in ['all','box']: 85 raise RuntimeError, "string-valued noise_box in linefinder.set_options can only be all or box" 86 if noise_box.lower() == 'box': 87 nBox = box_size 88 else: 89 nBox = float(noise_box) 90 self.finder.setoptions(threshold,min_nchan,avg_limit,box_size,nBox,nStat) 65 91 return 66 92
Note:
See TracChangeset
for help on using the changeset viewer.