Changeset 2886
- Timestamp:
- 12/25/13 14:50:26 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r2885 r2886 1814 1814 1815 1815 else: # single number 1816 try: 1817 #checking if the given number is valid for spw ID 1818 idx = valid_ifs.index(int(scs_elem)) 1819 spw_list.append(valid_ifs[idx]) 1816 #checking if the given number is valid for spw ID 1817 idx = valid_ifs.index(int(scs_elem)) 1818 spw_list.append(valid_ifs[idx]) 1820 1819 1821 except:1822 asaplog.post()1823 asaplog.push("Wrong spw number (" + scs_elem + ") given. ignored.")1824 asaplog.post("WARNING")1825 1826 1820 else: # (len_product == 2) 1827 1821 # namely, one of '<', '>' or '~' appers just once. … … 1829 1823 if (lt_sep_length == 2): # '<a' 1830 1824 if is_number(lt_sep[1]): 1825 no_valid_spw = True 1831 1826 for i in valid_ifs: 1832 1827 if (i < float(lt_sep[1])): 1833 1828 spw_list.append(i) 1829 no_valid_spw = False 1830 1831 if no_valid_spw: 1832 raise ValueError("Invalid spw selection ('<" + str(lt_sep[1]) + "').") 1834 1833 1835 1834 else: 1836 RuntimeError("Invalid spw selection.")1835 raise RuntimeError("Invalid spw selection.") 1837 1836 1838 1837 elif (gt_sep_length == 2): # '>a' 1839 1838 if is_number(gt_sep[1]): 1839 no_valid_spw = True 1840 1840 for i in valid_ifs: 1841 1841 if (i > float(gt_sep[1])): 1842 1842 spw_list.append(i) 1843 no_valid_spw = False 1844 1845 if no_valid_spw: 1846 raise ValueError("Invalid spw selection ('>" + str(gt_sep[1]) + "').") 1843 1847 1844 1848 else: 1845 RuntimeError("Invalid spw selection.")1849 raise RuntimeError("Invalid spw selection.") 1846 1850 1847 1851 else: # (ti_sep_length == 2) where both boundaries inclusive … … 1853 1857 expr_pmin = min(float(expr0), float(expr1)) 1854 1858 expr_pmax = max(float(expr0), float(expr1)) 1859 no_valid_spw = True 1860 1855 1861 for i in valid_ifs: 1856 1862 if (expr_pmin <= i) and (i <= expr_pmax): 1857 1863 spw_list.append(i) 1864 no_valid_spw = False 1865 1866 if no_valid_spw: 1867 raise ValueError("No valid spw in range ('" + str(expr_pmin) + "~" + str(expr_pmax) + "').") 1858 1868 1859 1869 elif is_number(expr0) and is_frequency(expr1): 1860 1870 # 'a~b*Hz' 1861 1871 (expr_f0, expr_f1) = get_freq_by_string(expr0, expr1) 1862 1872 no_valid_spw = True 1873 1863 1874 for coord in self._get_coordinate_list(): 1864 1875 expr_p0 = coord['coord'].to_pixel(expr_f0) … … 1873 1884 if ((expr_pmax - pmin)*(expr_pmin - pmax) <= 0.0): 1874 1885 spw_list.append(spw) 1886 no_valid_spw = False 1887 1888 if no_valid_spw: 1889 raise ValueError("No valid spw in range ('" + str(expr0) + "~" + str(expr1) + "').") 1875 1890 1876 1891 elif is_number(expr0) and is_velocity(expr1): … … 1879 1894 expr_vmin = min(expr_v0, expr_v1) 1880 1895 expr_vmax = max(expr_v0, expr_v1) 1881 1896 no_valid_spw = True 1897 1882 1898 for coord in self._get_coordinate_list(): 1883 1899 spw = coord['if'] … … 1894 1910 if ((expr_vmax - vmin)*(expr_vmin - vmax) <= 0.0): 1895 1911 spw_list.append(spw) 1912 no_valid_spw = False 1913 1914 if no_valid_spw: 1915 raise ValueError("No valid spw in range ('" + str(expr0) + "~" + str(expr1) + "').") 1896 1916 1897 1917 else: … … 2003 2023 2004 2024 return res 2025 #found 2005 2026 2006 2027 @asaplog_post_dec
Note:
See TracChangeset
for help on using the changeset viewer.