Changeset 2936 for trunk


Ignore:
Timestamp:
04/25/14 14:01:44 (10 years ago)
Author:
WataruKawasaki
Message:

New Development: No

JIRA Issue: Yes CAS-6485

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s): sd

Description: modified sd.scantable.parse_spw_selection() so that spectral windows will be selected if center values of their frequency/velocity ranges fall in the range specified.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r2935 r2936  
    18351835                           '0~1:2~6,8' = channels 2 to 6 in spws 0,1, and
    18361836                                         all channels in spw8
    1837                            '1.3~1.5GHz' = all spws that fall in or have at
    1838                                           least some overwrap with frequency
    1839                                           range between 1.3GHz and 1.5GHz.
    1840                            '1.3~1.5GHz:1.3~1.5GHz' = channels that fall
     1837                           '1.3~1.5GHz' = all spws whose central frequency
     1838                                          falls in frequency range between
     1839                                          1.3GHz and 1.5GHz.
     1840                           '1.3~1.5GHz:1.3~1.5GHz' = channels which fall
    18411841                                                     between the specified
    18421842                                                     frequency range in spws
    1843                                                      that fall in or have
    1844                                                      overwrap with the
    1845                                                      specified frequency
    1846                                                      range.
     1843                                                     whose central frequency
     1844                                                     falls in the specified
     1845                                                     frequency range.
    18471846                           '1:-200~250km/s' = channels that fall between the
    18481847                                              specified velocity range in
     
    19911990                            # 'a~b*Hz'
    19921991                            (expr_f0, expr_f1) = get_freq_by_string(expr0, expr1)
     1992                            expr_fmin = min(expr_f0, expr_f1)
     1993                            expr_fmax = max(expr_f0, expr_f1)
    19931994                            no_valid_spw = True
    19941995                           
    19951996                            for coord in self._get_coordinate_list():
     1997                                spw = coord['if']
     1998                               
     1999                                """
    19962000                                expr_p0 = coord['coord'].to_pixel(expr_f0)
    19972001                                expr_p1 = coord['coord'].to_pixel(expr_f1)
     
    19992003                                expr_pmax = max(expr_p0, expr_p1)
    20002004                               
    2001                                 spw = coord['if']
    20022005                                pmin = 0.0
    20032006                                pmax = float(self.nchan(spw) - 1)
    2004                                
     2007
    20052008                                if ((expr_pmax - pmin)*(expr_pmin - pmax) <= 0.0):
    20062009                                    spw_list.append(spw)
    20072010                                    no_valid_spw = False
    2008 
     2011                                """
     2012
     2013                                fhead = coord['coord'].to_frequency(0)
     2014                                ftail = coord['coord'].to_frequency(self.nchan(spw) - 1)
     2015                                fcen  = (fhead + ftail) / 2.0
     2016
     2017                                if ((expr_fmin <= fcen) and (fcen <= expr_fmax)):
     2018                                    spw_list.append(spw)
     2019                                    no_valid_spw = False
     2020                               
    20092021                            if no_valid_spw:
    20102022                                raise ValueError("No valid spw in range ('" + str(expr0) + "~" + str(expr1) + "').")
     
    20192031                            for coord in self._get_coordinate_list():
    20202032                                spw = coord['if']
    2021                                
     2033
     2034                                """
    20222035                                pmin = 0.0
    20232036                                pmax = float(self.nchan(spw) - 1)
     
    20302043
    20312044                                if ((expr_vmax - vmin)*(expr_vmin - vmax) <= 0.0):
     2045                                    spw_list.append(spw)
     2046                                    no_valid_spw = False
     2047                                """
     2048
     2049                                vhead = coord['coord'].to_velocity(0)
     2050                                vtail = coord['coord'].to_velocity(self.nchan(spw) - 1)
     2051                                vcen  = (vhead + vtail) / 2.0
     2052
     2053                                if ((expr_vmin <= vcen) and (vcen <= expr_vmax)):
    20322054                                    spw_list.append(spw)
    20332055                                    no_valid_spw = False
Note: See TracChangeset for help on using the changeset viewer.