casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
Classes | Functions | Variables
sdutil Namespace Reference

Classes

class  sdtask_interface
class  sdtask_template
class  sdtask_template_imaging
class  sdtask_engine
class  parameter_registration
class  scantable_restore_interface
class  scantable_restore_null
class  scantable_restore_impl

Functions

def finalize
 if hasattr(self, 'outfile') and len(self.outfile) > 0: assert_outfile_canoverwrite_or_nonexistent(self.outfile,self.outform,self.overwrite)
def initialize_scan
def parameter_check
def save
def cleanup
def get_selector
def set_to_scan
def get_abspath
def expand_path
def assert_infile_exists
def get_default_outfile_name
def assert_outfile_canoverwrite_or_nonexistent
def get_listvalue
def get_selector
def get_restfreq_in_Hz
def normalise_restfreq
 def get_restfreq_in_Hz(s_restfreq): value = 0.0 unit = "" s = s_restfreq.replace(" ","")
def set_restfreq
def set_spectral_unit
def set_doppler
def set_freqframe
def set_fluxunit
def save
def doopacity
def dochannelrange
def doaverage
def plot_scantable
def scantable_restore_factory
def interactive_mask
def init_interactive_mask
def get_interactive_mask
def finalize_interactive_mask
def process_exception
def get_plotter
def get_nx_ny
def get_cellx_celly
def get_map_center
def __to_quantity_string
def get_subtable_name

Variables

tuple qatl
tuple plotter
 visible = (plotlevel > 0) if plotlevel else sd.rcParams['plotter.gui']
 specunit

Function Documentation

def sdutil.__to_quantity_string (   v,
  unit = 'arcsec' 
) [private]

Definition at line 828 of file sdutil.py.

Referenced by get_cellx_celly().

def sdutil.assert_infile_exists (   infile = None)

Definition at line 280 of file sdutil.py.

References get_abspath().

Referenced by sdutil.sdtask_template.initialize().

def sdutil.assert_outfile_canoverwrite_or_nonexistent (   outfile = None,
  outform = None,
  overwrite = None 
)

Definition at line 298 of file sdutil.py.

References get_abspath().

Referenced by task_sdimaging.sdimaging_worker.parameter_check(), and save().

def sdutil.cleanup (   self)

Definition at line 104 of file sdutil.py.

def sdutil.doaverage (   s,
  scanaverage,
  timeaverage,
  tweight,
  polaverage,
  pweight,
  averageall = False,
  docopy = False 
)
def sdutil.dochannelrange (   s,
  channelrange 
)

Definition at line 585 of file sdutil.py.

References doaverage().

Referenced by task_sdcal.sdcal_worker.execute().

def sdutil.doopacity (   s,
  tau 
)

Definition at line 578 of file sdutil.py.

Referenced by task_sdcal.sdcal_worker.execute().

def sdutil.expand_path (   filename)

Definition at line 277 of file sdutil.py.

Referenced by get_abspath().

def sdutil.finalize (   self)

if hasattr(self, 'outfile') and len(self.outfile) > 0: assert_outfile_canoverwrite_or_nonexistent(self.outfile,self.outform,self.overwrite)

Definition at line 85 of file sdutil.py.

Definition at line 763 of file sdutil.py.

Referenced by interactive_mask().

def sdutil.get_abspath (   filename)
def sdutil.get_cellx_celly (   c,
  unit = 'arcsec' 
)

Definition at line 790 of file sdutil.py.

References __to_quantity_string().

Referenced by task_sdplot.sdplot_worker.__get_grid_parameters().

def sdutil.get_default_outfile_name (   infile = None,
  outfile = None,
  suffix = None 
)

Definition at line 290 of file sdutil.py.

def sdutil.get_interactive_mask (   obj,
  purpose = None 
)

Definition at line 758 of file sdutil.py.

Referenced by task_sdfit.sdfit_worker._set_linelist_interact(), and interactive_mask().

def sdutil.get_listvalue (   value)

Definition at line 306 of file sdutil.py.

References asap.utils._to_list(), and get_selector().

Referenced by get_selector().

def sdutil.get_map_center (   c,
  frame = 'J2000',
  unit = 'rad' 
)

Definition at line 805 of file sdutil.py.

Referenced by task_sdplot.sdplot_worker.__get_grid_parameters().

def sdutil.get_nx_ny (   n)

Definition at line 781 of file sdutil.py.

References asap.utils._to_list().

def sdutil.get_plotter (   plotlevel = 0)

Definition at line 770 of file sdutil.py.

Referenced by task_sdfit.sdfit_worker.__init_plot().

def sdutil.get_restfreq_in_Hz (   s_restfreq)

Definition at line 328 of file sdutil.py.

Referenced by normalise_restfreq().

def sdutil.get_selector (   self)

Definition at line 108 of file sdutil.py.

Referenced by get_listvalue().

def sdutil.get_selector (   in_scans = None,
  in_ifs = None,
  in_pols = None,
  in_field = None,
  in_beams = None,
  in_rows = None 
)

Definition at line 310 of file sdutil.py.

References get_listvalue().

Definition at line 834 of file sdutil.py.

def sdutil.init_interactive_mask (   s,
  masklist,
  invert = False 
)

Definition at line 751 of file sdutil.py.

Referenced by task_sdfit.sdfit_worker._set_linelist_interact(), and interactive_mask().

def sdutil.initialize_scan (   self)

Definition at line 92 of file sdutil.py.

def sdutil.interactive_mask (   s,
  masklist,
  invert = False,
  purpose = None 
)
def sdutil.normalise_restfreq (   in_restfreq)

def get_restfreq_in_Hz(s_restfreq): value = 0.0 unit = "" s = s_restfreq.replace(" ","")

for i in range(len(s))[::-1]: if s[i].isalpha(): unit = s[i] + unit else: value = float(s[0:i+1]) break

if (unit == "") or (unit.lower() == "hz"): return value elif (len(unit) == 3) and (unit[1:3].lower() == "hz"): unitprefix = unit[0] factor = 1.0

if (unitprefix == "a"): factor = 1.0e-18 elif (unitprefix == "f"): factor = 1.0e-15 elif (unitprefix == "p"): factor = 1.0e-12 elif (unitprefix == "n"): factor = 1.0e-9 elif (unitprefix == "u"): factor = 1.0e-6 elif (unitprefix == "m"): factor = 1.0e-3 elif (unitprefix == "k"): factor = 1.0e+3 elif (unitprefix == "M"): factor = 1.0e+6 elif (unitprefix == "G"): factor = 1.0e+9 elif (unitprefix == "T"): factor = 1.0e+12 elif (unitprefix == "P"): factor = 1.0e+15 elif (unitprefix == "E"): factor = 1.0e+18

return value*factor else: mesg = "wrong unit of restfreq." raise Exception, mesg

Definition at line 389 of file sdutil.py.

References get_restfreq_in_Hz().

Referenced by set_restfreq().

def sdutil.parameter_check (   self)

Definition at line 96 of file sdutil.py.

def sdutil.plot_scantable (   s,
  pltfile,
  plotlevel,
  comment = None 
)
def sdutil.save (   self)

Definition at line 100 of file sdutil.py.

Referenced by save().

def sdutil.save (   s,
  outfile,
  outform,
  overwrite 
)
def sdutil.scantable_restore_factory (   s,
  infile,
  fluxunit,
  specunit,
  frame,
  doppler,
  restfreq = '' 
)

Definition at line 678 of file sdutil.py.

References asap.scantable.is_scantable().

def sdutil.set_doppler (   s,
  doppler 
)

Definition at line 441 of file sdutil.py.

Referenced by task_sdplot.sdplot_worker.plot_grid(), and set_to_scan().

def sdutil.set_fluxunit (   s,
  fluxunit,
  telescopeparm,
  insitu = True 
)
def sdutil.set_freqframe (   s,
  frame 
)

Definition at line 451 of file sdutil.py.

Referenced by task_sdplot.sdplot_worker.plot_grid(), and set_to_scan().

def sdutil.set_restfreq (   s,
  restfreq 
)

Definition at line 432 of file sdutil.py.

References normalise_restfreq().

def sdutil.set_spectral_unit (   s,
  specunit 
)

Definition at line 437 of file sdutil.py.

Referenced by task_sdplot.sdplot_worker.plot_grid(), and set_to_scan().

def sdutil.set_to_scan (   self)

Definition at line 117 of file sdutil.py.

References set_doppler(), set_fluxunit(), set_freqframe(), and set_spectral_unit().


Variable Documentation

visible = (plotlevel > 0) if plotlevel else sd.rcParams['plotter.gui']

Definition at line 778 of file sdutil.py.

tuple sdutil.qatl

Definition at line 12 of file sdutil.py.

Definition at line 128 of file sdutil.py.