ADMIT Project

Defines the Admit class.

class admit.Admit.Admit(baseDir=None, name='none', basefile=None, create=True, dataserver=False)

Container for an ADMIT project. The project is normally based on one single FITS cube (in some cases two, where the ingest stage needs a primary beam to correct the science cube with), although this is not a restriction to ADMIT.

A FITS cube results in an ADMIT directory, within which you will find an admit.xml file describing the project, it’s data products (BDP’s) and the AT’s (tasks) that generated the BDP’s.

Usage: if input file/directory are given or admit.xml is located in the current directory then they are loaded into the class, else a new (empty) class is instantiated

To Be Resolved: - in the current implementation every directory, admit or not-admit, can be made an admit directory (i.e. contain a root admit.xml)

  • we really don’t need a basefile= in the argument list

Attributes

_data_browser_port: int Port number that the localhost http server for the data browser (aka data gui) will use. This attribute is set by the operating system.
project_id: int Static project identification number

Methods

addtask(a[, stuples, dtuples]) Add an AT to the stack of AT’s this ADMIT contains
check() check all the BDP’s in this admit, and see if they have name collisions
dir() See AT.dir() but placed here for convenience as well
discover([mode, rootdir])
export(mode) prepare Admit for (archive) export. This means it has to loop over the BDP’s
find_bdp() find all bdp’s in the current admit, recursively
find_files([pattern]) Find files containing a wildcard pattern
get(key) get a global ADMIT parameter
has(key) query if a global user key exists for this admit project
load_pickle(pname) load an admit object into pickle format
mkdir(dirname) Make a directory in the ADMIT hierarchy if it doesn’t exist yet It also allows an absolute path, in the classical unix sense.
plotmode(plotmode[, plottype]) plotmode determines if plots are saved, and in what format
print_all() calls all the methods of this object
print_attributes() print all the attributes of this object and their value
print_methods() print all the methods of this object and their doc string
query_dir([here]) from here, drill down and find directories in which ADMIT exists
read()
run() This will run those pieces of the pipeline flow that were deemed out of date.
set(**kwargs) set one or more global ADMIT parameters
setdir(dirname[, create]) change directory to dirname to work in. Assumed to contain parameter file
show()
startDataServer() On a separate thread, start the http server on localhost:_data_browser_port that will allow web browsing of data products.
summary() Collects current AT summaries.
tesdir() revert back from previous setdir (sorry, not recursive yet)
walkdir(dlist)
write() write out the admit.xml file
write_pickle([name])
addtask(a, stuples=[], dtuples=[])

Add an AT to the stack of AT’s this ADMIT contains Also adjust the mapping Usually all but the first task will have ‘stuples’ (a List of Source Tuples (task-id,bdp-id))

Returns the TaskID

check()

check all the BDP’s in this admit, and see if they have name collisions of their BDPs, and identify orphaned branches of the tree A topological sort is needed as well, if they are not in the correct execution order. See also the unix tsort(1) program

dir()

See AT.dir() but placed here for convenience as well

discover(mode=None, rootdir='.')
export(mode)

prepare Admit for (archive) export. This means it has to loop over the BDP’s and decide which items are going to copied over to admit.userData{}, as admit.xml is the only file external agents should have to look at.

find_bdp()

find all bdp’s in the current admit, recursively Returns a list of *.bdp files within the admit hierarchy

find_files(pattern='*.fits')

Find files containing a wildcard pattern

get(key)

get a global ADMIT parameter @todo this method should mirror the way we do this in the AT (setkey/getkey)

has(key)

query if a global user key exists for this admit project Returns True/False.

load_pickle(pname)

load an admit object into pickle format since admit stores many objects in deeply nested structures (the AT’s and BDP’s) they are duplicated. After a pickle.load() these should be re-pointed?

mkdir(dirname)

Make a directory in the ADMIT hierarchy if it doesn’t exist yet It also allows an absolute path, in the classical unix sense.

plotmode(plotmode, plottype='png')

plotmode determines if plots are saved, and in what format These are based on simple matplotlib diagrams Common output formats are png and pdf.

print_all()

calls all the methods of this object

print_attributes()

print all the attributes of this object and their value

print_methods()

print all the methods of this object and their doc string

project_id = 0
query_dir(here=None)

from here, drill down and find directories in which ADMIT exists

read()
run()

This will run those pieces of the pipeline flow that were deemed out of date. After the run, the flow tasks gather their summary into ADMIT’s summaryData, ensuring that summaryData always is consistent with the current flow, and does not contain remnants from orphans.

set(**kwargs)

set one or more global ADMIT parameters @todo *args vs. **kwargs cf. the set() function in the AT, which is still a single ‘key=val’

setdir(dirname, create=True)

change directory to dirname to work in. Assumed to contain parameter file if the directory doesn’t exist yet, create it See pushd()/popd() for a better version - deprecate this. @todo deprecate, the new mkdir() and self.baseDir are the way to work in ADMIT

show()
startDataServer()

On a separate thread, start the http server on localhost:_data_browser_port that will allow web browsing of data products. When this method returns, the variable self._data_browser_port will have the value of the port returned by the OS.

summary()

Collects current AT summaries.

Returns:None
tesdir()

revert back from previous setdir (sorry, not recursive yet) See pushd()/popd() for a better version @todo deprecate

walkdir(dlist)
write()

write out the admit.xml file

write_pickle(name=None)
admit.Admit.casa_argv(argv)

process the argv from a casarun script to a classic argv list such that the returned argv[0] is the casarun scriptname Does not depend on CASA being present.

This Page