Changeset 2889
- Timestamp:
- 12/27/13 18:22:06 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r2887 r2889 363 363 return (res1, res2) 364 364 365 def get_frequency_by_velocity(restfreq, vel ):365 def get_frequency_by_velocity(restfreq, vel, doppler): 366 366 # vel is in unit of km/s 367 367 … … 371 371 import math 372 372 r = vel / vel_c 373 return restfreq * math.sqrt((1.0 - r) / (1.0 + r)) 373 374 if doppler.lower() == 'radio': 375 return restfreq * (1.0 - r) 376 if doppler.lower() == 'optical': 377 return restfreq / (1.0 + r) 378 else: 379 return restfreq * math.sqrt((1.0 - r) / (1.0 + r)) 374 380 375 381 … … 1932 1938 if len(spw_list) == 0: 1933 1939 raise ValueError("No valid spw in given range.") 1934 """1935 no_valid_spw = True1936 for spw in spw_list:1937 print spw_list1938 if spw in valid_ifs:1939 no_valid_spw = False1940 else:1941 spw_list.remove(spw)1942 1943 if no_valid_spw:1944 raise ValueError("No valid spw in given range.")1945 """1946 1940 1947 1941 # parse channel expression and store the result in crange_list. … … 2012 2006 restf = self.get_restfreqs().values()[0][0] 2013 2007 (expr_v0, expr_v1) = get_velocity_by_string(expr0, expr1) 2014 expr_f0 = get_frequency_by_velocity(restf, expr_v0 )2015 expr_f1 = get_frequency_by_velocity(restf, expr_v1 )2008 expr_f0 = get_frequency_by_velocity(restf, expr_v0, doppler) 2009 expr_f1 = get_frequency_by_velocity(restf, expr_v1, doppler) 2016 2010 expr_p0 = coord.to_pixel(expr_f0) 2017 2011 expr_p1 = coord.to_pixel(expr_f1) … … 2080 2074 2081 2075 return res 2082 2076 # doppler 2083 2077 ################################## 2084 2078
Note:
See TracChangeset
for help on using the changeset viewer.