Commits
ksugimoto authored fa9d3ce9d22
39 39 | class sdsidebandsplitTestBase(unittest.TestCase): |
40 40 | standard_param = dict( |
41 41 | imagename = ['onepix_noiseless_shift0.image', 'onepix_noiseless_shift-102.image', |
42 42 | 'onepix_noiseless_shift8.image', 'onepix_noiseless_shift62.image', |
43 43 | 'onepix_noiseless_shift88.image', 'onepix_noiseless_shift100.image'], |
44 44 | outfile='separated.image', |
45 45 | overwrite = False, |
46 46 | signalshift = [0.0, -102, +8, +62, +88, +100], |
47 47 | imageshift = [0.0, 102, -8, -62, -88, -100], |
48 48 | getbothside = False, |
49 - | refpix = 0.0, |
49 + | refchan = 0.0, |
50 50 | refval = '805GHz', |
51 51 | otherside = False, |
52 52 | threshold = 0.2 |
53 53 | ) |
54 54 | |
55 55 | def update_task_param(self, new_param={}): |
56 56 | """ |
57 57 | Overwrite standard task parameter and return a new dictionary |
58 58 | with updated parameters. |
59 59 | Note this task does not check validity of parameter names in |
116 116 | # test signal band image |
117 117 | imagename = task_param['outfile']+'.signalband' |
118 118 | self.check_result(imagename, refcsys, refshape, reference['signal']) |
119 119 | # test image band image |
120 120 | imagename = task_param['outfile']+'.imageband' |
121 121 | if task_param['getbothside']: |
122 122 | self.assertTrue(reference.has_key('image'), |
123 123 | 'Internal Error: No valid reference value for image sideband') |
124 124 | # modify refcsys for image sideband |
125 125 | spid = refcsys.findaxisbyname('spectral') |
126 - | refcsys.setreferencepixel(task_param['refpix'], 'spectral') |
126 + | refcsys.setreferencepixel(task_param['refchan'], 'spectral') |
127 127 | myqa = qatool() |
128 128 | refcsys.setreferencevalue(myqa.convert(task_param['refval'], |
129 129 | refcsys.units()[spid])['value'], |
130 130 | 'spectral') |
131 131 | inc = refcsys.increment(format='n', type='spectral')['numeric'][0] |
132 132 | refcsys.setincrement(-inc, 'spectral') |
133 133 | |
134 134 | self.check_result(imagename, refcsys, refshape, reference['image']) |
135 135 | |
136 136 | def get_image(self, imagename, getdata=False, getmask=False): |
401 401 | def test_imageshift_from_signalshift(self): |
402 402 | """obtain imageshift from signalshift""" |
403 403 | self.run_test(self.standard_reference, imageshift=[]) |
404 404 | |
405 405 | # T-019 |
406 406 | def test_getbothside(self): |
407 407 | """getbothside = True""" |
408 408 | self.run_test(self.standard_reference, getbothside=True) |
409 409 | |
410 410 | # T-020 |
411 - | def test_refpix_negative(self): |
412 - | """refpix = -1.0""" |
413 - | self.run_test(self.standard_reference, getbothside=True, refpix=-1.0) |
411 + | def test_refchan_negative(self): |
412 + | """refchan = -1.0""" |
413 + | self.run_test(self.standard_reference, getbothside=True, refchan=-1.0) |
414 414 | |
415 415 | # T-021 |
416 - | def test_refpix_large(self): |
417 - | """refpix > nchan""" |
418 - | self.run_test(self.standard_reference, getbothside=True, refpix=5000.0) |
416 + | def test_refchan_large(self): |
417 + | """refchan > nchan""" |
418 + | self.run_test(self.standard_reference, getbothside=True, refchan=5000.0) |
419 419 | |
420 420 | # T-025 |
421 421 | def test_otherside(self): |
422 422 | """otherside = True""" |
423 423 | reference = dict(signal=(SpectralInfo(0, 1500, 2.77938, -0.198638, 2.90884, 898.4125, 29.57543, -0.12153), |
424 424 | SpectralInfo(1500, 3000, 4.74292, -0.20648, 4.88534, 2298.0446, 19.75160, -0.13152)), |
425 425 | image=(SpectralInfo(1000, 2200, 6.67820, -0.24841, 6.84674, 1599.9131, 19.75747, -0.15339), |
426 426 | SpectralInfo(2500, 3500, 1.88367, -0.11315, 1.96069, 2999.8335, 9.94222, -0.07489))) |
427 427 | for doboth in [False, True]: |
428 428 | print('getbothside = %s'% str(doboth)) |
448 448 | """ |
449 449 | standard_param = dict( |
450 450 | imagename = ['multipix_noiseless_shift0.image', 'multipix_noiseless_shift-102.image', |
451 451 | 'multipix_noiseless_shift8.image', 'multipix_noiseless_shift62.image', |
452 452 | 'multipix_noiseless_shift88.image', 'multipix_noiseless_shift100.image'], |
453 453 | outfile='separated.image', |
454 454 | overwrite = False, |
455 455 | signalshift = [0.0, -102, +8, +62, +88, +100], |
456 456 | imageshift = [0.0, 102, -8, -62, -88, -100], |
457 457 | getbothside = False, |
458 - | refpix = 0.0, |
458 + | refchan = 0.0, |
459 459 | refval = '805GHz', |
460 460 | otherside = False, |
461 461 | threshold = 0.2 |
462 462 | ) |
463 463 | |
464 464 | def compare_image_data(self, data, reference): |
465 465 | """ |
466 466 | Compare image data with reference. |
467 467 | |
468 468 | Arguments |