Go to the documentation of this file.00001 from asap._asap import coordinate as _coordinate
00002
00003 class coordinate(_coordinate):
00004 """Representation of the spectral coordinate of the data (frequency axis).
00005 """
00006 def to_frequency(self, pixel, unit='Hz'):
00007 """
00008 Convert a channel/pixel value to a frequency.
00009 """
00010 umap = {'GHz': 1.e9, 'MHz' : 1.e6, 'kHz': 1.e3, 'Hz': 1. }
00011 return _coordinate.to_frequency(self, pixel)/umap[unit]
00012
00013
00014 def to_velocity(self, pixel, unit='km/s'):
00015 """
00016 Convert a channel/pixel value to a velocity.
00017 """
00018 umap = {'km/s': 1, 'm/s': 1e-3}
00019 return _coordinate.to_velocity(self, pixel)/umap[unit]