Changeset 2818 for trunk/test


Ignore:
Timestamp:
07/02/13 10:38:18 (11 years ago)
Author:
Malte Marquarding
Message:

Issue #291: added scantable.set_sourcename to overwrite sourcename to allow freq_align to work. Exposed 'SOURCE' averaging to python api. Added some logging to freq_align refering to the sources it aligns to

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/test_scantable.py

    r2802 r2818  
    149149                          'Orion_SiO', 'Orion_SiO'])
    150150
     151    def test_set_sourcename(self):
     152        s = self.st.copy()
     153        newname = "TEST"
     154        s.set_sourcename(newname)
     155        assert_equal(s.get_sourcename(), [newname]*4)
     156
    151157    def test_get_azimuth(self):
    152158        assert_almost_equal(self.st.get_azimuth()[0], 5.628767013)
     
    194200        assert_almost_equal(q1.stats(stat='max')[0], 2.66563416)
    195201
     202
     203    def test_average_time_weight(self):
     204        weights = {'none': 236.61423,
     205                   'var' : 232.98752,
     206                   'tsys' : 236.37482,
     207                   'tint' : 236.61423,
     208                   'tintsys' : 236.37485,
     209                   'median' : 236.61423,
     210                   }
     211
     212        for k,v in weights.items():
     213            yield self.av_weight, k, v
     214
     215    def av_weight(self, weight, result):
     216        out = self.st.average_time(weight=weight)
     217        assert_almost_equals(max(out.get_spectrum(0)), result, 5)
     218
    196219    @with_setup(tempdir_setup, tempdir_teardown)
    197220    def test_save(self):
     
    203226                   (fname % 'txt', 'ASCII', False),
    204227                   ]
    205         for format in formats:
    206             yield self.save, format
     228        for fmt in formats:
     229            yield self.save, fmt
    207230
    208231    def save(self, args):
Note: See TracChangeset for help on using the changeset viewer.