source: branches/casa-release-4_3-test02/test/test_observatories/test_hobart.py@ 3141

Last change on this file since 3141 was 2676, checked in by Malte Marquarding, 12 years ago

Add inital estimate for fit

File size: 1.2 KB
Line 
1#!/usr/bin/env python
2import os
3from asap import *
4from nose.tools import assert_almost_equals
5rcParams['verbose'] = 0
6rcParams['plotter.gui'] = 0
7# HOBART specific
8rcParams["scantable.reference"] = ".*(e|w|_R|\+R|\-R)$"
9
10if not os.path.exists("output"):
11 os.makedirs("output")
12
13DATA=os.path.join(os.path.split(__file__)[0], "..", "data",
14 "hobart.rpf")
15
16class TestHobart(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.set_parameters(params=[2,11,1])
26 f.fit()
27 f.plot(filename='output/hobartfit_pol%d.png' % polno)
28 fp = f.get_parameters()
29 assert True
30
31 def test_reduction(self):
32 q = self.st.auto_quotient()
33 q.set_unit("km/s") # set the unit to be used from now on
34 q.set_freqframe("LSRK") # set frequency frame
35 q.auto_poly_baseline(insitu=True, order=1)
36 q.set_selection(scans=[0])
37 for polno in q.getpolnos():
38 self._plotfit(q, polno)
Note: See TracBrowser for help on using the repository browser.