casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
task_help.py
Go to the documentation of this file.
00001 from tasksinfo import *
00002 def startup():
00003     # startup guide
00004     """ Start up screen for CASA """
00005     print """___________________________________________________________________
00006     For help use the following commands:
00007     tasklist               - Task list organized by category
00008     taskhelp               - One line summary of available tasks
00009     help taskname          - Full help for task
00010     toolhelp               - One line summary of available tools
00011     help par.parametername - Full help for parameter name
00012 ___________________________________________________________________"""
00013 
00014 def taskhelp(scrap=None):
00015     """ Briefly describe all tasks with scrap in their name or one-line description. """
00016     if scrap:
00017         scrap = str(scrap)
00018         foundtasks = [ft for ft in tasksum.keys() if ft.find(scrap) > -1 or tasksum[ft].find(scrap) > -1]
00019         if not foundtasks:
00020             print "No tasks were found with '%s' in their name or description." % scrap
00021         return
00022     else:
00023         print 'Available tasks: \n'
00024         foundtasks = tasksum.keys()
00025         foundtasks.sort()   # Already sorted?!
00026         widestftlen = max([len(ft) for ft in foundtasks])
00027         fmt = "%%-%ds : %%s" % widestftlen
00028         for ft in foundtasks:
00029             print fmt % (ft, tasksum[ft])            
00030 def toolhelp():
00031     """ List all tools with one-line description: """
00032     print ' '
00033     print 'Available tools: \n'
00034     print ' af : Agent flagger utilities'
00035     print ' at : Juan Pardo ATM library'
00036     print ' ca : Calibration analysis utilities'
00037     print ' cb : Calibration utilities'
00038     print ' cl : Component list utilities'
00039     print ' cp : Cal solution plotting utilities'
00040     print ' cs : Coordinate system utilities'
00041     print ' cu : Class utilities'
00042     print ' dc : Deconvolver utilities'
00043     print ' fg : Flagging/Flag management utilities'
00044     print ' fi : Fitting utilities'
00045     print ' fn : Functional utilities'
00046     print ' ia : Image analysis utilities'
00047     print ' im : Imaging utilities'
00048     print ' me : Measures utilities'
00049     print ' ms : MeasurementSet (MS) utilties'
00050     print ' msmd : MS metadata accessors'
00051     print ' mp : MS plotting (data (amp/phase) versus other quantities)'
00052     print ' qa : Quanta utilities'
00053     print ' pm : PlotMS utilities'
00054     print ' po : Imagepol utilities'
00055     print ' rg : Region manipulation utilities'
00056     print ' sl : Spectral line import and search'
00057     print ' sm : Simulation utilities'
00058     print ' tb : Table utilities (selection, extraction, etc)'
00059     print ' tp : Table plotting utilities'
00060     print ' vp : Voltage pattern/primary beam utilties'
00061     print ' ---'
00062     print ' pl : pylab functions (e.g., pl.title, etc)'
00063     print ' sd : Single dish utilities'
00064     print ' ---'
00065 
00066 def tasklist():
00067     """ List tasks, organized by catagory """
00068     print 'Available tasks, organized by category (experimental tasks in parens ()'
00069     print '  deprecated tasks in curly brackets {}).'
00070     print ''
00071     for i in range(0,3):
00072         col1 = thecats[i*4]
00073         col2 = thecats[i*4+1]
00074         col3 = thecats[i*4+2]
00075         col4 = thecats[i*4+3]
00076         count1 = len(allcat[col1])
00077         count2 = len(allcat[col2])
00078         count3 = len(allcat[col3])
00079         count4 = len(allcat[col4])
00080         maxcount = max([count1, count2, count3, count4])
00081         taskrow = ''
00082         print
00083         print '%-18.18s  %-18.18s  %-18.18s  %-18.18s'% (col1.capitalize(), col2.capitalize(), col3.capitalize(), col4.capitalize())
00084         print '------------------  ------------------  ------------------  ------------------'
00085         for i in range(0, maxcount) :
00086             if(i<count1) :
00087                 task1 = allcat[col1][i]
00088             else :
00089                 task1 = ' '
00090             if(i<count2) :
00091                 task2 = allcat[col2][i] 
00092             else :
00093                 task2 = ' '
00094             if(i<count3) :
00095                 task3 = allcat[col3][i]
00096             else :
00097                 task3 = ' '
00098             if(i<count4) :
00099                 task4 = allcat[col4][i]
00100             else :
00101                 task4 = ' '
00102             print '%-18.18s  %-18.18s  %-18.18s  %-18.18s'% (task1, task2, task3, task4)
00103 
00104     if globals().has_key('mytasks') :
00105         print ''
00106         print 'User defined tasks'
00107         print '------------------'
00108         for key in mytasks.keys() :
00109             print key
00110