Changes between Version 1 and Version 2 of FitAsciiData
- Timestamp:
- 05/17/07 12:10:09 (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FitAsciiData
v1 v2 1 == Correct for negative values in the MOPS bandpass == 1 {{{ 2 def readxy(filename=None): 3 f = file(filename,'r') 4 x = [] 5 y = [] 6 lines = f.readlines() 7 f.close() 8 for l in lines: 9 vals = l.split() 10 x.append(float(vals[0])) 11 y.append(float(vals[1])) 12 return x,y 13 x,y=readxy("spec.txt") 14 f =fitter() 15 f.set_data(x,y) 16 f.set_function(gauss=1) 17 f.fit() 18 f.plot() 2 19 3 Go to this page source:trunk/plugins/vanvleck_flag.py and click on one of the links at the bottom '''Download in other formats'''4 5 6 To enable the functionality you have two options.7 8 9 a)10 {{{11 cat vanvleck_flag.py >> ~/.asap/asapuserfuncs.py12 20 }}} 13 This will make it available automatically.14 15 b)16 17 copy the script somewhere.18 19 Then each time you start asap or at the top of and asap script.20 {{{21 execfile("sommewhere/vanvleck_flag.py")22 }}}23 Usage:24 {{{25 s = scantable("my_dodgey_MOPS_file.rpf")26 s.vanvleck_flag() # with an an optional level below which to flag ( default 5.0)27 }}}28 This is applied to the data "insitu"29 30 Hopefully this problem will be rectified by Warwick in time for the next observing season.