Changeset 1838


Ignore:
Timestamp:
08/03/10 16:49:55 (14 years ago)
Author:
Malte Marquarding
Message:

update mopra test script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/mopra.py

    r1273 r1838  
    1414q.convert_flux() # K -> Jy
    1515msk = q.create_mask([-70,20], [20,70]) # line free region - two windows
    16 rms = q.stats("rms",msk)
    17 med = q.stats("median",msk)
    18 
    19 print "Fitter test..."
    20 # select IF1
    21 selection = selector()
    22 selection.set_ifs(1)
    23 q.set_selection(selection)
     16rms = q.stats("rms", msk)
     17med = q.stats("median", msk)
    2418
    2519rcParams['plotter.gui'] = 0
    26 f = fitter()
    27 f.set_scan(q)
    28 f.set_function(gauss=2) # fit two gaussians
    29 f.fit()
    30 f.plot(filename='output/moprafit.png')
    31 fp = f.get_parameters()
     20
     21def plotfit(scan, ifno):
     22    print "Fitter test for IF%d..." % ifno
     23    # select IF
     24    scan.set_selection(ifs=ifno)
     25    f = fitter()
     26    f.set_scan(scan)
     27    f.set_function(gauss=ifno+1) # fit gaussian(s)
     28    f.fit()
     29    f.plot(filename='output/moprafit_if%d.png' % ifno)
     30    fp = f.get_parameters()
     31
     32for ifno in q.getifnos():
     33    plotfit(q, ifno)
     34
    3235print "Mopra Test successful"
Note: See TracChangeset for help on using the changeset viewer.