Last change
on this file since 2828 was 2676, checked in by Malte Marquarding, 12 years ago |
Add inital estimate for fit
|
File size:
1.2 KB
|
Rev | Line | |
---|
[2481] | 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 |
|
---|
[2522] | 16 | class TestHobart(object):
|
---|
[2481] | 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)
|
---|
[2676] | 25 | f.set_parameters(params=[2,11,1])
|
---|
[2481] | 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.