Commits
Wataru Kawasaki authored 1fdf53d17a9
563 563 | self.assertTrue((abs(rdiff) < allowdiff), |
564 564 | msg='row %s: coefficient for order %s is different' % (irow, ic)) |
565 565 | print('') |
566 566 | |
567 567 | |
568 568 | class sdbaseline_basicTest(sdbaseline_unittest_base): |
569 569 | """ |
570 570 | Basic unit tests for task sdbaseline. No interactive testing. |
571 571 | |
572 572 | List of tests: |
573 - | test000 --- default values for all parameters |
574 - | test001 --- polynominal baselining with no mask (maskmode = 'list'). spw and pol specified. |
575 - | test002 --- Chebyshev baselining with no mask (maskmode = 'list'). spw and pol specified. |
576 - | test003 --- cubic spline baselining with no mask (maskmode = 'list'). spw and pol specified. |
577 - | test004 --- sinusoidal baselining with no mask (maskmode = 'list'). spw and pol specified. |
578 - | test050 --- existing file as outfile with overwrite=False (raises an exception) |
579 - | test051 --- no data after selection (raises an exception) |
580 - | test060 --- blparam files should be overwritten when overwrite=True in fit mode |
581 - | test061 --- blparam files should not exist when overwrite=False in fit mode |
582 - | test062 --- blparam files should not be removed in apply mode |
583 - | test070 --- no output MS when dosubtract=False |
584 - | test071 --- dosubtract=False and blformat is empty (raises an exception) |
585 - | test080 --- existent outfile is not overwritten if dosubtract=False |
573 + | test000 : default values for all parameters |
574 + | test001 : polynominal baselining with no mask (maskmode = 'list'). spw and pol specified. |
575 + | test002 : Chebyshev baselining with no mask (maskmode = 'list'). spw and pol specified. |
576 + | test003 : cubic spline baselining with no mask (maskmode = 'list'). spw and pol specified. |
577 + | test004 : sinusoidal baselining with no mask (maskmode = 'list'). spw and pol specified. |
578 + | test050 : existing file as outfile with overwrite=False (raises an exception) |
579 + | test051 : no data after selection (raises an exception) |
580 + | test060 : blparam files should be overwritten when overwrite=True in fit mode |
581 + | test061 : blparam files should not exist when overwrite=False in fit mode |
582 + | test062 : blparam files should not be removed in apply mode |
583 + | test070 : no output MS when dosubtract=False |
584 + | test071 : dosubtract=False and blformat is empty (raises an exception) |
585 + | test080 : existent outfile is not overwritten if dosubtract=False |
586 586 | |
587 587 | Note: The input data 'OrionS_rawACSmod_calave.ms' is generated |
588 588 | from a single dish regression data 'OrionS_rawACSmod' as follows: |
589 589 | |
590 590 | default(sdcal) |
591 591 | sdcal(infile='OrionS_rawACSmod',scanlist=[20,21,22,23], |
592 592 | calmode='ps',tau=0.09,outfile='temp.asap') |
593 593 | default(sdcal) |
594 594 | sdcal(infile='temp.asap',timeaverage=True, |
595 595 | tweight='tintsys',outfile='temp2.asap') |
997 997 | self.assertEqual(sta_in[k], sta_out[k]) |
998 998 | else: |
999 999 | self.assertAlmostEqual(sta_in[k], sta_out[k]) |
1000 1000 | |
1001 1001 | |
1002 1002 | class sdbaseline_maskTest(sdbaseline_unittest_base): |
1003 1003 | """ |
1004 1004 | Tests for various mask selections. No interactive testing. |
1005 1005 | |
1006 1006 | List of tests: |
1007 - | test100 --- with masked ranges at the edges of spectrum. blfunc is cspline. |
1008 - | test101 --- with masked ranges not touching spectrum edge |
1007 + | test100 : with masked ranges at the edges of spectrum. blfunc is cspline. |
1008 + | test101 : with masked ranges not touching spectrum edge |
1009 1009 | |
1010 1010 | Note: input data is generated from a single dish regression data, |
1011 1011 | 'OrionS_rawACSmod', as follows: |
1012 1012 | default(sdcal) |
1013 1013 | sdcal(infile='OrionS_rawACSmod',scanlist=[20,21,22,23], |
1014 1014 | calmode='ps',tau=0.09,outfile='temp.asap') |
1015 1015 | default(sdcal) |
1016 1016 | sdcal(infile='temp.asap',timeaverage=True, |
1017 1017 | tweight='tintsys',outfile='temp2.asap') |
1018 1018 | sdsave(infile='temp2.asap',outformat='MS2', |
1118 1118 | return str(valrange[0]) + '~' + str(valrange[1]) |
1119 1119 | else: |
1120 1120 | return False |
1121 1121 | |
1122 1122 | |
1123 1123 | class sdbaseline_sinusoidTest(sdbaseline_unittest_base): |
1124 1124 | """ |
1125 1125 | Tests for sinusoidal baseline fitting. No interactive testing. |
1126 1126 | |
1127 1127 | List of tests: |
1128 - | test000 --- addwn as integer |
1129 - | test001 --- addwn as list of an integer |
1130 - | test002 --- addwn as list of integers |
1131 - | test003 --- addwn as tuple of an integer |
1132 - | test004 --- addwn as tuple of integers |
1133 - | test005 --- addwn as string (single wave number) |
1134 - | test006 --- addwn as string (comma-separated wave numbers) |
1135 - | test007 --- addwn as string (wave number range specified with '-') |
1136 - | test008 --- addwn as string (wave number range specified with '~') |
1137 - | test009 --- addwn as string (less or equal pattern 1) |
1138 - | test010 --- addwn as string (less or equal pattern 2) |
1139 - | test011 --- addwn as string (less or equal pattern 3) |
1140 - | test012 --- addwn as string (less or equal pattern 4) |
1141 - | test013 --- addwn as string (less pattern 1) |
1142 - | test014 --- addwn as string (less pattern 2) |
1143 - | test015 --- addwn as string (greater or equal pattern 1) |
1144 - | test016 --- addwn as string (greater or equal pattern 2) |
1145 - | test017 --- addwn as string (greater or equal pattern 3) |
1146 - | test018 --- addwn as string (greater or equal pattern 4) |
1147 - | test019 --- addwn as string (greater pattern 1) |
1148 - | test020 --- addwn as string (greater pattern 2) |
1149 - | test021 --- specify fftthresh by 'sigma' + checking residual rms |
1150 - | test022 --- specify fftthresh by 'top' + checking residual rms |
1151 - | test023 --- sinusoid-related parameters with default values |
1152 - | test024 --- addwn has too large value but rejwn removes it |
1153 - | |
1154 - | test021_uppercase_params --- specify fftthresh by 'SIGMA' + checking residual rms |
1155 - | test022_uppercase_params --- specify fftthresh by 'TOP' + checking residual rms |
1156 - | test025_uppercase_params --- specify fftmethod by 'FFT' |
1157 - | |
1158 - | test100 --- no effective wave number set (addwn empty list, applyfft=False) |
1159 - | test101 --- no effective wave number set (addwn empty list, applyfft=True) |
1160 - | test102 --- no effective wave number set (addwn empty tuple, applyfft=False) |
1161 - | test103 --- no effective wave number set (addwn empty tuple, applyfft=True) |
1162 - | test104 --- no effective wave number set (addwn empty string, applyfft=False) |
1163 - | test105 --- no effective wave number set (addwn empty string, applyfft=True) |
1164 - | test106 --- no effective wave number set (addwn and rejwn identical, applyfft=False) |
1165 - | test107 --- no effective wave number set (addwn and rejwn identical, applyfft=True) |
1166 - | test108 --- no effective case (rejwn covers wider range than that of addwn, applyfft=False) |
1167 - | test109 --- no effective case (rejwn covers wider range than that of addwn, applyfft=True) |
1168 - | test110 --- wn range greater than upper limit |
1169 - | test111 --- explicitly specify wn (greater than upper limit) |
1170 - | test112 --- explicitly specify wn (negative) |
1171 - | test113 --- explicitly specify wn (addwn has negative and greater than upper limit) |
1172 - | test114 --- explicitly specify wn (both addwn/rejwn have negative and greater than upper limit) |
1173 - | test115 --- wrong fftthresh (as list) |
1174 - | test116 --- wrong fftthresh (as string 'asigma') |
1175 - | test117 --- wrong fftthresh (as string 'topa') |
1176 - | test118 --- wrong fftthresh (as string 'top3sigma') |
1177 - | test119 --- wrong fftthresh (as string 'a123') |
1178 - | test120 --- wrong fftthresh (as string '') |
1179 - | test121 --- wrong fftthresh (as string '-3.0') |
1180 - | test122 --- wrong fftthresh (as string '0.0') |
1181 - | test123 --- wrong fftthresh (as string '-3') |
1182 - | test124 --- wrong fftthresh (as string '0') |
1183 - | test125 --- wrong fftthresh (as string '-3.0sigma') |
1184 - | test126 --- wrong fftthresh (as string '0.0sigma') |
1185 - | test127 --- wrong fftthresh (as string '-3sigma') |
1186 - | test128 --- wrong fftthresh (as string '0sigma') |
1187 - | test129 --- wrong fftthresh (as string 'top-3') |
1188 - | test130 --- wrong fftthresh (as string 'top0') |
1189 - | test131 --- wrong fftthresh (as string 'top1.5') |
1190 - | test132 --- wrong fftthresh (as float -3.0) |
1191 - | test133 --- wrong fftthresh (as float 0.0) |
1192 - | test134 --- wrong fftthresh (as int -3) |
1193 - | test135 --- wrong fftthresh (as int 0) |
1128 + | test000 : addwn as integer |
1129 + | test001 : addwn as list of an integer |
1130 + | test002 : addwn as list of integers |
1131 + | test003 : addwn as tuple of an integer |
1132 + | test004 : addwn as tuple of integers |
1133 + | test005 : addwn as string (single wave number) |
1134 + | test006 : addwn as string (comma-separated wave numbers) |
1135 + | test007 : addwn as string (wave number range specified with '-') |
1136 + | test008 : addwn as string (wave number range specified with '~') |
1137 + | test009 : addwn as string (less or equal pattern 1) |
1138 + | test010 : addwn as string (less or equal pattern 2) |
1139 + | test011 : addwn as string (less or equal pattern 3) |
1140 + | test012 : addwn as string (less or equal pattern 4) |
1141 + | test013 : addwn as string (less pattern 1) |
1142 + | test014 : addwn as string (less pattern 2) |
1143 + | test015 : addwn as string (greater or equal pattern 1) |
1144 + | test016 : addwn as string (greater or equal pattern 2) |
1145 + | test017 : addwn as string (greater or equal pattern 3) |
1146 + | test018 : addwn as string (greater or equal pattern 4) |
1147 + | test019 : addwn as string (greater pattern 1) |
1148 + | test020 : addwn as string (greater pattern 2) |
1149 + | test021 : specify fftthresh by 'sigma' + checking residual rms |
1150 + | test022 : specify fftthresh by 'top' + checking residual rms |
1151 + | test023 : sinusoid-related parameters with default values |
1152 + | test024 : addwn has too large value but rejwn removes it |
1153 + | |
1154 + | test021_uppercase_params : specify fftthresh by 'SIGMA' + checking residual rms |
1155 + | test022_uppercase_params : specify fftthresh by 'TOP' + checking residual rms |
1156 + | test025_uppercase_params : specify fftmethod by 'FFT' |
1157 + | |
1158 + | test100 : no effective wave number set (addwn empty list, applyfft=False) |
1159 + | test101 : no effective wave number set (addwn empty list, applyfft=True) |
1160 + | test102 : no effective wave number set (addwn empty tuple, applyfft=False) |
1161 + | test103 : no effective wave number set (addwn empty tuple, applyfft=True) |
1162 + | test104 : no effective wave number set (addwn empty string, applyfft=False) |
1163 + | test105 : no effective wave number set (addwn empty string, applyfft=True) |
1164 + | test106 : no effective wave number set (addwn and rejwn identical, applyfft=False) |
1165 + | test107 : no effective wave number set (addwn and rejwn identical, applyfft=True) |
1166 + | test108 : no effective case (rejwn covers wider range than that of addwn, applyfft=False) |
1167 + | test109 : no effective case (rejwn covers wider range than that of addwn, applyfft=True) |
1168 + | test110 : wn range greater than upper limit |
1169 + | test111 : explicitly specify wn (greater than upper limit) |
1170 + | test112 : explicitly specify wn (negative) |
1171 + | test113 : explicitly specify wn (addwn has negative and greater than upper limit) |
1172 + | test114 : explicitly specify wn (both addwn/rejwn have negative and greater than upper limit) |
1173 + | test115 : wrong fftthresh (as list) |
1174 + | test116 : wrong fftthresh (as string 'asigma') |
1175 + | test117 : wrong fftthresh (as string 'topa') |
1176 + | test118 : wrong fftthresh (as string 'top3sigma') |
1177 + | test119 : wrong fftthresh (as string 'a123') |
1178 + | test120 : wrong fftthresh (as string '') |
1179 + | test121 : wrong fftthresh (as string '-3.0') |
1180 + | test122 : wrong fftthresh (as string '0.0') |
1181 + | test123 : wrong fftthresh (as string '-3') |
1182 + | test124 : wrong fftthresh (as string '0') |
1183 + | test125 : wrong fftthresh (as string '-3.0sigma') |
1184 + | test126 : wrong fftthresh (as string '0.0sigma') |
1185 + | test127 : wrong fftthresh (as string '-3sigma') |
1186 + | test128 : wrong fftthresh (as string '0sigma') |
1187 + | test129 : wrong fftthresh (as string 'top-3') |
1188 + | test130 : wrong fftthresh (as string 'top0') |
1189 + | test131 : wrong fftthresh (as string 'top1.5') |
1190 + | test132 : wrong fftthresh (as float -3.0) |
1191 + | test133 : wrong fftthresh (as float 0.0) |
1192 + | test134 : wrong fftthresh (as int -3) |
1193 + | test135 : wrong fftthresh (as int 0) |
1194 1194 | |
1195 1195 | Note: The input data 'sinusoidal.ms' has just two spectral data, |
1196 1196 | which are actually identical and described as |
1197 1197 | spec[i] = sin(i*2*PI/8191) + 4 * sin(i*2*PI/8191*3) |
1198 1198 | + 8 * sin(i*2*PI/8191*5) + 2 * sin(i*2*PI/8191*12). |
1199 1199 | addwn='1,3,5,12' will be enough to perfectly fit this spectrum, but |
1200 1200 | applyfft=True and fftthresh='top4' will also do. |
1201 1201 | """ |
1202 1202 | # Input and output names |
1203 1203 | infile = 'sinusoidal.ms' |
2061 2061 | |
2062 2062 | # this class is not included in the suite, skip the tests (needed for CASA6) |
2063 2063 | class sdbaseline_multi_IF_test(sdbaseline_unittest_base): |
2064 2064 | """ |
2065 2065 | Unit tests for task sdbaseline. No interactive testing. |
2066 2066 | |
2067 2067 | This test intends to check whether sdbaseline task works fine |
2068 2068 | for data that has multiple IFs whose nchan differ each other. |
2069 2069 | |
2070 2070 | List of tests: |
2071 - | test200 --- test multi IF data input |
2071 + | test200 : test multi IF data input |
2072 2072 | """ |
2073 2073 | # Input and output names |
2074 2074 | infile = 'testMultiIF.asap' |
2075 2075 | blparamfile_suffix = '_blparam.txt' |
2076 2076 | outroot = os.path.join(sdbaseline_unittest_base.taskname, '_multi') |
2077 2077 | refblparamfile = 'refblparam_multiIF' |
2078 2078 | |
2079 2079 | def setUp(self): |
2080 2080 | if os.path.exists(self.infile): |
2081 2081 | shutil.rmtree(self.infile) |
2128 2128 | for ifno in [5, 7]: |
2129 2129 | currstat = self._getStats(outfile, ifno) |
2130 2130 | self._compareStats(currstat, reference[ifno]) |
2131 2131 | |
2132 2132 | |
2133 2133 | class sdbaseline_outbltableTest(sdbaseline_unittest_base): |
2134 2134 | """ |
2135 2135 | Tests for outputting baseline table |
2136 2136 | |
2137 2137 | List of tests |
2138 - | test301 --- blmode='fit', bloutput!='', dosubtract=True, blfunc='poly'/'chebyshev'/'cspline' |
2138 + | test301 : blmode='fit', bloutput!='', dosubtract=True, blfunc='poly'/'chebyshev'/'cspline' |
2139 2139 | (poly/chebyshev/cspline fit in MS, bltable is written) |
2140 - | test302 --- blmode='fit', bloutput!='', dosubtract=True, blfunc='variable' |
2140 + | test302 : blmode='fit', bloutput!='', dosubtract=True, blfunc='variable' |
2141 2141 | (variable fit in MS, bltable is written) |
2142 2142 | testing 3 cases: |
2143 2143 | (1) blparam contains values for all spectra |
2144 2144 | (2) no values for a spectrum (row=2,pol=1), which is to be skipped |
2145 2145 | (3) values commented out for a spectrum (row=2,pol=1), which is to be skipped |
2146 - | test303 --- blmode='fit', bloutput!='', dosubtract=True, blfunc='poly','chebyshev','cspline' |
2146 + | test303 : blmode='fit', bloutput!='', dosubtract=True, blfunc='poly','chebyshev','cspline' |
2147 2147 | testing if bltable is shortened |
2148 2148 | testing 3 cases: |
2149 2149 | (1) all spectra in row 2 are flagged entirely |
2150 2150 | (2) in row 2, entirely flagged for pol 0, also pol 1 is unselected |
2151 2151 | (3) in row 2, entirely flagged for pol 1, also pol 0 is unselected |
2152 - | test304 --- same as test303, but for blfunc='variable' |
2152 + | test304 : same as test303, but for blfunc='variable' |
2153 2153 | |
2154 2154 | Note: input data is generated from a single dish regression data, |
2155 2155 | 'OrionS_rawACSmod', as follows: |
2156 2156 | default(sdcal) |
2157 2157 | sdcal(infile='OrionS_rawACSmod',scanlist=[20,21,22,23], |
2158 2158 | calmode='ps',tau=0.09,outfile='temp.asap') |
2159 2159 | default(sdcal) |
2160 2160 | sdcal(infile='temp.asap',timeaverage=True, |
2161 2161 | tweight='tintsys',outfile='temp2.asap') |
2162 2162 | sdsave(infile='temp2.asap',outformat='MS2', |
2452 2452 | shutil.rmtree(self.infile) |
2453 2453 | os.system('rm -rf ' + self.outroot + '*') |
2454 2454 | |
2455 2455 | |
2456 2456 | class sdbaseline_applybltableTest(sdbaseline_unittest_base): |
2457 2457 | """ |
2458 2458 | Tests for applying baseline table |
2459 2459 | (blmode='apply' mode) |
2460 2460 | |
2461 2461 | List of tests |
2462 - | test400 --- MS with no all-channel-flagged, bltable with apply=True for all spectra |
2463 - | test401 --- MS with one spectrum with all channels flagged, while apply=True throughout bltable |
2464 - | test402 --- MS with no all-channel-flagged, while apply=False for one spectrum in bltable |
2465 - | test403 --- MS with no all-channel-flagger, while bltable lacks one row (irow=2) |
2462 + | test400 : MS with no all-channel-flagged, bltable with apply=True for all spectra |
2463 + | test401 : MS with one spectrum with all channels flagged, while apply=True throughout bltable |
2464 + | test402 : MS with no all-channel-flagged, while apply=False for one spectrum in bltable |
2465 + | test403 : MS with no all-channel-flagger, while bltable lacks one row (irow=2) |
2466 2466 | |
2467 2467 | Note: for tests401-403, the spectrum with all channels flagged, or the corresponding |
2468 2468 | data in baseline table has apply=False or is inexist, should not be subtracted baseline. |
2469 2469 | """ |
2470 2470 | # Input and output names |
2471 2471 | infile = 'OrionS_rawACSmod_calave.ms' |
2472 2472 | outroot = sdbaseline_unittest_base.taskname + '_bltabletest' |
2473 2473 | reffile = outroot + '.ms' |
2474 2474 | blmode = 'apply' |
2475 2475 | bltable = outroot + '.bltable' |
2825 2825 | if os.path.exists(self.infile + '_blparam.btable'): |
2826 2826 | shutil.rmtree(self.infile + '_blparam.btable') |
2827 2827 | |
2828 2828 | |
2829 2829 | class sdbaseline_bloutputTest(sdbaseline_unittest_base): |
2830 2830 | """ |
2831 2831 | Basic unit tests for task sdbaseline. No interactive testing. |
2832 2832 | |
2833 2833 | List of tests: |
2834 2834 | |
2835 - | test000 --- no bloutput cases |
2835 + | test000 : no bloutput cases |
2836 2836 | |
2837 - | test010 --- single bloutput cases |
2838 - | test011 --- single bloutput cases (blformat with extra empty elements) |
2837 + | test010 : single bloutput cases |
2838 + | test011 : single bloutput cases (blformat with extra empty elements) |
2839 2839 | |
2840 - | test020 --- double bloutput cases |
2841 - | test021 --- double bloutput cases (blformat with an extra empty element) |
2840 + | test020 : double bloutput cases |
2841 + | test021 : double bloutput cases (blformat with an extra empty element) |
2842 2842 | |
2843 - | test030 --- triple bloutput cases |
2843 + | test030 : triple bloutput cases |
2844 2844 | |
2845 - | test100 --- sinusoid test for finite wavenumber patterns |
2846 - | test101 --- sinusoid test for infinite wavenumber pattern |
2845 + | test100 : sinusoid test for finite wavenumber patterns |
2846 + | test101 : sinusoid test for infinite wavenumber pattern |
2847 2847 | """ |
2848 2848 | |
2849 2849 | infile = 'OrionS_rawACSmod_calave.ms' |
2850 2850 | outfile = 'test.ms' |
2851 2851 | blparam = 'analytic_variable_blparam.txt' |
2852 2852 | |
2853 2853 | blfuncs = ['poly', 'cspline', 'sinusoid', 'variable'] |
2854 2854 | blout_exts = {'text': '.txt', 'csv': '.csv', 'table': '.bltable'} |
2855 2855 | blout_fmts_short = ['text', 'csv'] |
2856 2856 | wns = ['0', '02', '1'] |
3579 3579 | colnames_out = tb.colnames() |
3580 3580 | outfile_no_wspec = 'WEIGHT_SPECTRUM' not in colnames_out |
3581 3581 | self.assertTrue(outfile_no_wspec, |
3582 3582 | msg='WEIGHT_SPECTRUM is not removed.') |
3583 3583 | |
3584 3584 | |
3585 3585 | class sdbaseline_updateweightTest2(sdbaseline_unittest_base): |
3586 3586 | """ |
3587 3587 | Tests for updateweight=True cases |
3588 3588 | |
3589 - | test000 --- updateweight=False - WEIGHT column must not be updated |
3590 - | test010 --- updateweight=True, sigmavalue=default('stddev') |
3591 - | test011 --- updateweight=True, sigmavalue=default('stddev'), channels 4500~6500 flagged |
3592 - | test012 --- updateweight=True, sigmavalue=default('stddev'), spw to flag channels 4500-6499 |
3593 - | test020 --- updateweight=True, sigmavalue='stddev' |
3594 - | test021 --- updateweight=True, sigmavalue='stddev', channels 4500~6500 flagged in input data |
3595 - | test022 --- updateweight=True, sigmavalue='stddev', spw to flag channels 4500-6499 |
3596 - | test030 --- updateweight=True, sigmavalue='rms' |
3597 - | test031 --- updateweight=True, sigmavalue='rms', channels 4500~6500 flagged in input data |
3598 - | test032 --- updateweight=True, sigmavalue='rms', spw to flag channels 4500-6499 |
3599 - | test040 --- blfunc='variable' |
3600 - | test041 --- blfunc='variable', channels 4500~6500 flagged in input data |
3601 - | test042 --- blfunc='variable', spw to flag channels 4500-6499 |
3602 - | test050 --- blmode='apply' |
3603 - | test051 --- blmode='apply', channels 4500~6500 flagged in input data |
3604 - | test052 --- blmode='apply', spw to flag channels 4500-6499 |
3605 - | test060 --- confirm that the clipping result (mask) is correctly used to compute weights |
3589 + | test000 : updateweight=False - WEIGHT column must not be updated |
3590 + | test010 : updateweight=True, sigmavalue=default('stddev') |
3591 + | test011 : updateweight=True, sigmavalue=default('stddev'), channels 4500~6500 flagged |
3592 + | test012 : updateweight=True, sigmavalue=default('stddev'), spw to flag channels 4500-6499 |
3593 + | test020 : updateweight=True, sigmavalue='stddev' |
3594 + | test021 : updateweight=True, sigmavalue='stddev', channels 4500~6500 flagged in input data |
3595 + | test022 : updateweight=True, sigmavalue='stddev', spw to flag channels 4500-6499 |
3596 + | test030 : updateweight=True, sigmavalue='rms' |
3597 + | test031 : updateweight=True, sigmavalue='rms', channels 4500~6500 flagged in input data |
3598 + | test032 : updateweight=True, sigmavalue='rms', spw to flag channels 4500-6499 |
3599 + | test040 : blfunc='variable' |
3600 + | test041 : blfunc='variable', channels 4500~6500 flagged in input data |
3601 + | test042 : blfunc='variable', spw to flag channels 4500-6499 |
3602 + | test050 : blmode='apply' |
3603 + | test051 : blmode='apply', channels 4500~6500 flagged in input data |
3604 + | test052 : blmode='apply', spw to flag channels 4500-6499 |
3605 + | test060 : confirm that the clipping result (mask) is correctly used to compute weights |
3606 3606 | """ |
3607 3607 | |
3608 3608 | datapath = ctsys_resolve('unittest/sdbaseline/') |
3609 3609 | infile = 'analytic_order3_withoffset.ms' |
3610 3610 | outroot = sdbaseline_unittest_base.taskname + '_updateweighttest' |
3611 3611 | outfile = outroot + '.ms' |
3612 3612 | spw = '*:0~4499;6500~8191' |
3613 3613 | params = {'infile': infile, 'outfile': outfile, |
3614 3614 | 'intent': 'OBSERVE_TARGET#ON_SOURCE', |
3615 3615 | 'datacolumn': 'float_data'} |
4031 4031 | |
4032 4032 | def test021(self): |
4033 4033 | """clipping does run but actually no data clipped (no spike)""" |
4034 4034 | self._run_test(thres=3.0, spikes=[], ifclipped=False) |
4035 4035 | |
4036 4036 | |
4037 4037 | class sdbaseline_helperTest(sdbaseline_unittest_base): |
4038 4038 | """ |
4039 4039 | Tests for helper functions |
4040 4040 | |
4041 - | test000 --- tests for is_empty() |
4042 - | test010 --- tests for parse_wavenumber_param() |
4043 - | test020 --- tests for check_fftthresh() |
4041 + | test000 : tests for is_empty() |
4042 + | test010 : tests for parse_wavenumber_param() |
4043 + | test020 : tests for check_fftthresh() |
4044 4044 | """ |
4045 4045 | |
4046 4046 | def test000(self): |
4047 4047 | """tests for is_empty()""" |
4048 4048 | print("Testing a helper function is_empty() with") |
4049 4049 | |
4050 4050 | # right cases |
4051 4051 | blformats = [None, '', [], ['', '', '']] |
4052 4052 | for blformat in blformats: |
4053 4053 | print(f" blformat='{blformat}'...") |