Coverage for /home/warp/casa/atejeda/coverage/build/linux-x86_64/python/2.7/__casac__/spectralline : 0%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# This file was automatically generated by SWIG (http://www.swig.org). # Version 2.0.4 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead.
from sys import version_info if version_info >= (2,6,0): def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module('_spectralline', [dirname(__file__)]) except ImportError: import _spectralline return _spectralline if fp is not None: try: _mod = imp.load_module('_spectralline', fp, pathname, description) finally: fp.close() return _mod _spectralline = swig_import_helper() del swig_import_helper else: import _spectralline del version_info try: _swig_property = property except NameError: pass # Python < 2.2 doesn't have 'property'. def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name): if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError(name)
def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try: _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0
class spectralline(_object): """Proxy of C++ casac::spectralline class""" __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, spectralline, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, spectralline, name) __repr__ = _swig_repr def __init__(self): """__init__(self) -> spectralline""" this = _spectralline.new_spectralline() try: self.this.append(this) except: self.this = this __swig_destroy__ = _spectralline.delete_spectralline __del__ = lambda self : None; def splattotable(self, *args, **kwargs): """ splattotable(self, filenames = std::vector< string >(1, ""), table = string("")) -> spectralline
Summary Convert a downloaded Splatalogue spectral line list to a casa table.
Description
This method reads a spectral line list(s) downloaded from Splatalogue (www.splatalogue.net) and loads it into a CASA table which can be queried via eg this tool's search function.
REQUIRMENTS OF THE DOWNLOADED FILES
The downloaded files must be in a specific format for this method to succeed. The columns are the important things; one can filter the results as one desires using Splatalogue, but the particular columns must be present as described below. The columns which must be present in the downloaded file in this exact order are: 'Species', 'NRAO Recommended', 'Chemical Name', 'Freq in GHz', 'Resolved QNs', 'CDMS/JPL Intensity', 'Sij\^2; (D2)', 'Log10 (Aij)', 'EL (K)', 'EU (K)', 'Linelist'. In order to get these columns in this order, one should select exactly the following items on the Splatalogue search interface. Under 'Specify Ranges' one should select 'GHz' for the frequency unit. Under 'Line Strength Display' select exactly 'CDMS/JPL Intensity', 'Sij u2', and 'Aij'. Under 'Energy Levels', one should select exactly 'Elower (K)' and 'Eupper (K)'. Under 'Miscellaneous', one should select exactly 'Display Ordered Frequency ONLY' and 'Display NRAO Recommended Frequencies'. One should then initiate the search and on the resulting page, one should select the Tab Field Separator and then export the list. The resulting list should be in the proper format for importing into CASA.
RETURN VALUE This method returns an open spectralline tool which references the new table. The new table can also be opened by a spectralline tool using the open method (eg sl.open(tablename)).
Input Parameters: filenames Files containing Splatalogue dumps table Output table name.
Example:
newsl = sl.splattotable('mysplatlist.txt', 'mynewsl.tbl') # search the new spectral line tool newsl.search([0,1000])
--------------------------------------------------------------------------------
""" return _spectralline.spectralline_splattotable(self, *args, **kwargs)
def open(self, *args, **kwargs): """ open(self, table = string("")) -> bool
Summary Open a spectralline tool using the specified table.
Description
This method opens a CASA Splatalogue spectral line table. The table should have been created with splattotable(), search(), or any other sl method which creates a new CASA spectral line table. If no table name is supplied, the default CASA spectral line table included in the system will be opened. The opened tool can then be used to query the table via eg the sl.search() method. This method returns true if the table was successfully opened.
Input Parameters: table CASA table containing Splatalogue data.
Example:
# open user created spectral line table isopen = sl.open('mysplat.tbl') if (isopen) sl.search([0,1000])
# open system default spectral line table isopen = sl.open() if (isopen) sl.search([0,1000])
--------------------------------------------------------------------------------
""" return _spectralline.spectralline_open(self, *args, **kwargs)
def close(self): """ close(self) -> bool
Summary close the spectralline tool
Description
The associated table is closed inside casapy and is no longer available for use.
Example:
sl.close()
--------------------------------------------------------------------------------
""" return _spectralline.spectralline_close(self)
def done(self): """ done(self) -> bool
Summary End the spectralline tool
Description
Effectively a synonym for function close.
Example:
sl.done()
--------------------------------------------------------------------------------
""" return _spectralline.spectralline_done(self)
def search(self, *args, **kwargs): """ search(self, outfile = string(""), freqrange = initialize_vector(1, (double)0), species = initialize_variant(""), reconly = False, chemnames = initialize_variant(""), qns = std::vector< string >(1, ""), intensity = initialize_vector(1, (double)-1), smu2 = initialize_vector(1, (double)-1), loga = initialize_vector(1, (double)-1), el = initialize_vector(1, (double)-1), eu = initialize_vector(1, (double)-1), rrlinclude = True, rrlonly = False, verbose = True, logfile = string(""), append = False) -> spectralline
Summary Search a Splatalogue table that has been converted to a casa table
Description
Search the table associated with this tool. The return value is a spectralline tool with a new table containing the search results. This new table can be written to disk by specifying its name in the outfile parameter. If outfile is not specified (ie outfile=''), the resulting table is held in memory and deleted upon a call to close() or done() for the newly created tool or upon exiting casapy. Because Splatalogue does not have values for intensity, smu2, loga, el, and eu for radio recombination lines (rrls), one must specify to include rrls in the specified frequency range in the output. In this case, RRLs will be included ignoring any filters on intensity, smu2, loga, el, and eu. One can also specify to list only RRLs. One can specify to list the search results to the logger via the verbose parameter. If verbose is false, no logger output is listed, although the results can be listed later by running the list() method on the newly created spectral line tool. If verbose=true, one can also specify that the results be listed to a logfile and if this file already exists, one can specify that the results be appended to it or to overwrite it with the results.
Input Parameters: outfile Results table name. Blank means do not write the table to disk. freqrange Frequency range in GHz. 0 species Species to search for. reconly List only NRAO recommended frequencies. false chemnames Chemical names to search for. qns Resolved quantum numbers to search for. intensity CDMS/JPL intensity range. -1 -\& do not use an intensity range. -1 smu2 S*mu*mu range in Debye**2. -1 -\& do not use an S*mu*mu range. -1 loga log(A) (Einstein coefficient) range. -1 -\& do not use a loga range. -1 el Lower energy state range in Kelvin. -1 -\& do not use an el range. -1 eu Upper energy state range in Kelvin. -1 -\& do not use an eu range. -1 rrlinclude Include RRLs in the result set? true rrlonly Include only RRLs in the result set? false verbose List result set to logger (and optionally logfile)? true logfile List result set to this logfile (only used if verbose=true). append If true, append to logfile if it already exists, if false overwrite logfile it it exists. Only used if verbose=true and logfile not blank. false
Example:
sl.open('myspectrallines.tbl') # do a search postponing listing the results to the logger. slrestool = sl.search(outfile='myresults.tbl', freqrange = [200,300], species=['HOCN', 'HOCO+']) # now list the results slrestool.list() # or one could also do the following after exiting and restarting casapy sl.open('myresults.tbl') sl.list()
--------------------------------------------------------------------------------
""" return _spectralline.spectralline_search(self, *args, **kwargs)
def list(self): """ list(self)
Summary List the spectral lines in the associated table to the logger.
Description
List the spectral lines in the associated table to the logger. Note that listing tables containing more than 10,000 spectral lines can take quite a bit of time.
--------------------------------------------------------------------------------
""" return _spectralline.spectralline_list(self)
def torecord(self): """ torecord(self) -> record
Summary Return data on the spectral lines in the table as a record.
Description
Return data on the spectral lines in the table as a record.
--------------------------------------------------------------------------------
""" return _spectralline.spectralline_torecord(self)
def species(self, *args, **kwargs): """ species(self, verbose = False, logfile = string(""), append = False) -> record
Summary List the unique species in the associated table to the logger.
Description
Return the unique species in the associated table as a list.
Input Parameters: verbose List result set to logger (and optionally logfile)? false logfile List result set to this logfile (only used if verbose=true). append If true, append to logfile if it already exists, if false overwrite logfile it it exists. Only used if show=true and logfile not blank. false
--------------------------------------------------------------------------------
""" return _spectralline.spectralline_species(self, *args, **kwargs)
def chemnames(self, *args, **kwargs): """ chemnames(self, verbose = False, logfile = string(""), append = False) -> record
Summary List the unique chemical names in the associated table to the logger.
Description
Return the unique chemical names in the associated table as a list.
Input Parameters: verbose List result set to logger (and optionally logfile)? false logfile List result set to this logfile (only used if verbose=true). append If true, append to logfile if it already exists, if false overwrite logfile it it exists. Only used if show=true and logfile not blank. false
--------------------------------------------------------------------------------
""" return _spectralline.spectralline_chemnames(self, *args, **kwargs)
def nrows(self): """ nrows(self) -> int
Summary Get the number of rows in the associated spectral line table.
Description
Get the number of rows in the associated spectral line table.
--------------------------------------------------------------------------------
""" return _spectralline.spectralline_nrows(self)
spectralline_swigregister = _spectralline.spectralline_swigregister spectralline_swigregister(spectralline)
# This file is compatible with both classic and new-style classes.
|