casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
Functions | Variables
recipes.lsms Namespace Reference

Functions

def lsms
def print_ms
def string_from_list_or_set
def find_needed_items
def matchingMSes
def checkMSes
def termprops
def rowscols

Variables

dictionary mstables
tuple possible_subtables
string mspat
list musthave

Function Documentation

def recipes.lsms.checkMSes (   holderdict,
  dir,
  files 
)
Updates holderdict['msdict'] with a list of MSes in dir that match
holderdict['musthave'] and holderdict['mspat'] as in
lsms(musthave, mspat, combine, sortfirst, remind).

If holderdict['doprint']=True a blurb about each ms will be printed as
it is found, using holderdict['remind'] like remind in lsms().

If holderdict['freemem']=True holderdict['msdict'] will NOT be updated.
Note that usually you want holderdict['freemem'] == holderdict['doprint'].

Definition at line 531 of file lsms.py.

References recipes.lsms.print_ms().

Referenced by recipes.lsms.matchingMSes().

def recipes.lsms.find_needed_items (   musthave = set([]),
  listall = False 
)
Given the set of "must have" items, fill out needed_subtables and needed_items,
and determine whether or not to use tb.

Definition at line 426 of file lsms.py.

References gprof2dot.add(), and recipes.lsms.matchingMSes().

Referenced by recipes.lsms.matchingMSes().

def recipes.lsms.lsms (   musthave = [],
  mspat = "*[-_.][Mm][Ss]",
  combine = 'or',
  remind = True,
  sortfirst = False 
)
Summarize measurement sets matching certain criteria.

Arguments:

musthave:  A list of columns, subtables, or keywords that must be in the MS.
           If [] (default), the list of optional columns, subtables, and
           keywords of each MS will be printed.  Any entries will be
           internally uppercased.

mspat:     A filename pattern, relative to the current directory, that the
           directory names matching of the MSes must match.
           Default: '*[-_.][Mm][Ss]'
           Tip: Try '**/*.ms' to find *.ms in . and all its subdirectories.

combine :  Controls whether the conditions of musthave are combined with
           'or' (default) or 'and'.

remind:    If True (default), print all columns and keywords of optional
           subtables, not just the optional ones.

sortfirst: If sortfirst=True, print the matching MSes in alphabetical order.
           Otherwise, print each one as soon as it is found.

Note that to fit in better with *sh behavior the argument order is reversed
when calling from a non-python shell.  i.e. if you enter
  lsms \*_MS source polarization
in a *sh session, it will run with
  mspat='*_MS' and musthave=['SOURCE', 'POLARIZATION'].
(remember to quote wildcards to avoid sh expansion)

Definition at line 13 of file lsms.py.

References recipes.lsms.matchingMSes(), and recipes.lsms.print_ms().

def recipes.lsms.matchingMSes (   musthave = [],
  mspat = "*.ms",
  combine = 'or',
  doprint = False,
  freemem = False,
  remind = True 
)
Returns a dict of MSes that match musthave and mspat as in
lsms(musthave, mspat, combine, sortfirst, remind), and whether or not it
found the tb tool.

If doprint=False a blurb about each ms will be printed as it is found,
using remind as in lsms().

If freemem=True the return dict will NOT be updated.  Note that usually
you want freemem == doprint.

Definition at line 487 of file lsms.py.

References recipes.lsms.checkMSes(), and recipes.lsms.find_needed_items().

Referenced by recipes.lsms.find_needed_items(), and recipes.lsms.lsms().

def recipes.lsms.print_ms (   currms,
  msdict,
  listall = False,
  use_tb = False,
  remind = True 
)
Prints the blurb in msdict, which is nominally about currms.

Definition at line 70 of file lsms.py.

References recipes.lsms.string_from_list_or_set().

Referenced by recipes.lsms.checkMSes(), and recipes.lsms.lsms().

def recipes.lsms.rowscols (   n,
  nc 
)

Definition at line 670 of file lsms.py.

Definition at line 140 of file lsms.py.

References tests.test_imcontsub.list.

Referenced by recipes.lsms.print_ms().

def recipes.lsms.termprops (   stream)
Return whether or not stream supports colors, and a guess at its number of
columns (in characters).

Definition at line 648 of file lsms.py.


Variable Documentation

Definition at line 676 of file lsms.py.

Definition at line 149 of file lsms.py.

Definition at line 677 of file lsms.py.

Definition at line 423 of file lsms.py.