Last change
on this file since 2490 was 2481, checked in by Malte Marquarding, 13 years ago |
Added and updated test scripts; e.g. hobart data
|
File size:
1.1 KB
|
Line | |
---|
1 | #!/usr/bin/env python
|
---|
2 | import os
|
---|
3 | from asap import *
|
---|
4 | from nose.tools import assert_almost_equals
|
---|
5 | rcParams['verbose'] = 0
|
---|
6 | rcParams['plotter.gui'] = 0
|
---|
7 | # HOBART specific
|
---|
8 | rcParams["scantable.reference"] = ".*(e|w|_R|\+R|\-R)$"
|
---|
9 |
|
---|
10 | if not os.path.exists("output"):
|
---|
11 | os.makedirs("output")
|
---|
12 |
|
---|
13 | DATA=os.path.join(os.path.split(__file__)[0], "..", "data",
|
---|
14 | "hobart.rpf")
|
---|
15 |
|
---|
16 | class TestMopra(object):
|
---|
17 | def setup(self):
|
---|
18 | self.st = scantable(DATA)
|
---|
19 |
|
---|
20 | def _plotfit(self, scan, polno):
|
---|
21 | scan.set_selection(pols=[polno])
|
---|
22 | f = fitter()
|
---|
23 | f.set_scan(scan)
|
---|
24 | f.set_function(gauss=1) # fit gaussian(s)
|
---|
25 | f.fit()
|
---|
26 | f.plot(filename='output/hobartfit_pol%d.png' % polno)
|
---|
27 | fp = f.get_parameters()
|
---|
28 | assert True
|
---|
29 |
|
---|
30 | def test_reduction(self):
|
---|
31 | q = self.st.auto_quotient()
|
---|
32 | q.set_unit("km/s") # set the unit to be used from now on
|
---|
33 | q.set_freqframe("LSRK") # set frequency frame
|
---|
34 | q.auto_poly_baseline(insitu=True, order=1)
|
---|
35 | q.set_selection(scans=[0])
|
---|
36 | for polno in q.getpolnos():
|
---|
37 | self._plotfit(q, polno)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.