Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
In the following we document the publically available commands from the main tool level and at the operations, results manager and plotter levels.
The scripter is intended as both a tutorial and a means of constructing batch command scripts. It is invoked from the AIPS++ command line as:
- ds.gui() F
The Options menu "Write Script commands" must then be selected. Subsequent commands will then be written to the scripter. See other info on scripter. NOTE: The submit button on the scripter will not work since this command executes the script as a shell client which doesn't know about the tool you've created. Instead to run a stored script (default name is aips++.script.g), simply include it (include "aips++.script.g").
A means of adding new operations formally to the DISH tool (see Operation template).
mydish.addop(include_file, operation_name);
A developer tool to yield a busy cursor.
mydish.busy(T or F);
A toggle switch which determines whether commands from the GUI will be logged to the scripter.
mydish.dologging(T or F);
A toggle switch which determines whether commands operations will operate on the last viewed (the default behavior) or upon the selected item in the results manager. This gives the ability of performing bulk processing on SDIterators. Selecting will also change the GUI state of the Option 'select from rm (for SDITs)'.
mydish.doselect(T or F);
Exits and destroys the current Dish tool.
Returns a history line. It takes two arguments: 1) a string of the command executed , 2) a record of the inputs to that command. This line can then be appended to the history of an SDRecord or SDIterator.
- mydish.history('dish.ops().smooth.settype',[type='HANNING']); ok := mydish.ops().smooth.settype(type="HANNING" )
Writes a command to the scripter. logcommand uses the same syntax as history but the information is logged to the scripted rather than to the record's history.
Writes a command to the DISH GUI message entry.
Opens date (MeasurementSet or Flat Table) for use in DISH (it is loaded into the results manager and can be manipulated).
Access all of the operations and their functions (see dish operation functions).
Access the plotter and its functions (see dish plotter functions).
Access the results manager and its functions (see dish results manager functions).
Saves the state of the GUIs and plotter to a file. The default file is in the home aips++/dishstate directory called default. This may be altered with the statefile function.
Changes the location that the state of Dish's GUIs and plotter will be saved to. The full pathname is required.
mydish.statefile('mydefaultstate'); mydish.savestate(); # saves to mydefaultstate in the # current directory
A mandatory function required by the toolmanager. The type of any dish tool is 'dish'.
Dismisses the plotter.
Clears plotter.
Retrieves either the x or y data vectors for a viewed SDRecord.
mydish.plotter().get_data_vector('x'); mydish.plotter().get_data_vector('y');
An internal tool for calculation of the statistics. It can also be used easily by the user. The inputs are the x-vector, y-vector, x-inital, and x-final. For example, to get the statistics on the channels 1-25 on the currently displayed data at the command line.
- myx:=mydish.plotter().get_data_vector('x'); - myy:=mydish.plotter().get_data_vector('y'); - mydish.plotter().compute_statistics(myx,myy,myx[1],myx[25]); [mean=0.0554615276, stddev=0.104077502, x1=221122.843, x2=270078.864]
Redraws the screen.
Plots an SDRecord to the plotter. The inputs are:
mydish.plotter().plotrec(xvector,yvector,name,object,xlabel,ylabel,overlay=T or F,refocus=T or F,startChan,endChan) For example, to manually plot an SDRecord from the results manager called myrec: - mydish.plotter().plotrec(myrec.data.desc.chan_freq.value,myrec.data.arr,'dumb','Title','my x','my y') T
Gives the full range of PGPLOT commands within DISH for augmenting plots. Any command can be duplicated (NOTE: only 9 arguments are currently accepted):
- mydish.plotter().plotter_command('sci',5); - mydish.plotter().plotter_command('mtxt','t',2.0,0,0,'Hello Reno!'); - # this will write a light blue message of Hello Reno, 2 characters above - # the top line of the plotter window.
Creates a plotter frame if one doesn't already exist.
cursor_agent
register_range
clear_entry
data_exists
set_button_state
is_active
not_active
assert_range_cursor
deassert_range_cursor
prod_statistics
set_range_notify
cursorpos
b3cursorcall
compute_statistics
brief_header
full_header
view_sdrec
Add an SDRecord to the Results Manager. The syntax is:
mydish.rm().add(name,description,value,type,decorate) For example, using myrec: mydish.rm().add('myrec','something I did', myrec, type='SDRECORD');
- mydish.rm().getnames(9) myrec1
mydish.rm().setdescription(9,'my description is now different');
Copies currently viewed to the clipboard.
Pastes from the clipboard into the results manager.
Returns the SDRecord of the last viewed item in the plotter.
For a specified index value in the results manager, it will set this as the last viewed item.
Specifies whether the GUI for the Results Manager should be viewed.
Deletes and closes down the Results Manager Tool (not recommended).
wscombobox
average | function | gaussian | regrid | save | select | smooth | statistics | write | |
setweighting | getfn | setheight | setboxwidth | setws | cws | setboxwidth | setstart | setof | |
setalignment | setfn | setcenter | setdecimate | - | newworkingset | setdecimate | setstop | - | |
doselection | - | setwidth | setgausswidth | - | setcriteria | setgausswidth | - | - | |
dorestshift | - | fixheight | setgridfact | - | setws | settype | - | - | |
- | - | fixcenter | settype | - | - | - | - | - | |
- | - | fixwidth | - | - | - | - | - | - |
Perform the relevant operation. See Bulk Processing for more details.
This closes down access to the operation's functions. Generally this should *not* be done by the user.
- mydish.ops().average.getstate() [selection=T, alignment=NONE, restshift=F, weighting=NONE]
- mydish.ops().average.setweighting("RMS") T
- mydish.ops().average.setalignment("VELOCITY") T
- mydish.ops().average.dorestshift(T) T
- mydish.ops().average.doselection(T) T
If the GUI is enabled, these functions will also check the relevant button on the average GUI.
An example scripter session looks as follows:
ok := mydish.ops().average.setalignment(alignment="NONE" ) ok := mydish.ops().average.setweighting(weighting="NONE" ) ok := mydish.ops().average.apply()
- mydish.ops().baseline.settype("sinusoid") T
- mydish.ops().baseline.setaction("show") T
- mydish.ops().baseline.getaction() show
- mydish.ops().baseline.setunits("channels") T
- mydish.ops().baseline.setorder(3) T
- mydish.ops().baseline.recalculate(T) T
- mydish.ops().baseline.setamplitude(2.) T
- mydish.ops().baseline.getrange() [[1:2,] 85.861813 119.882504]
The following functions are used mainly internally but are provided as public functions as well: setrangestring, convertunits, polynomial, sinusoidal.
If the GUI is enabled, these functions will also check the relevant button on the average GUI.
An example script follows. It fits a second order polynomial over the specified range, first to see it ("show") and then to apply it ("subtract"):
ok := mydish.ops().baseline.setorder(order=2) ok := mydish.ops().baseline.setrange(newrange=[-70603.3518, -53031.125] , units="xaxis" ,changeunits=F) ok := mydish.ops().baseline.setaction(action="show" ) ok := mydish.ops().baseline.setrange(newrange=[119.882504,85.861813] , units="channels" ) ok := mydish.ops().baseline.apply() ok := mydish.ops().baseline.setaction(action="subtract" ) ok := mydish.ops().baseline.setrange(newrange=[119.882504:85.861813] , units="channels" ) ok := mydish.ops().baseline.apply()
The calculator functions are all accessible from the command line already so no special interface has been provided within DISH.
This operation will perform some function on the data array of the selected SDRecord or SDIterator. The data array is accessed directly through the variable ARR.
- mydish.ops().function.getfn() 3*ARR
- mydish.ops().function.setfn("4*ARR") T
An example scripter session looks as follows:
ok := mydish.ops().function.setfn(fn="3*ARR" ) ok := mydish.ops().function.apply()
ok := mydish.ops().gaussfit.setnumber(numgauss=1) ok := mydish.ops().gaussfit.setheight(heights="37.149597" ,fixed=F) ok := mydish.ops().gaussfit.setcenters(centers="8980.08289" ,fixed=F) ok := mydish.ops().gaussfit.setwidth(widths="18358.5081" ,fixed=F) ok := mydish.ops().gaussfit.apply()
The following are identical to the smooth operation: setboxwidth, setdecimate, setgausswidth.
This operation will store results (i.e. SDRecords) to a specified SDIterator or working set. The working set must already exist (create through the File menu, New command).
An example session would look like:
- mydish.ops().save.setws('tempsave') # Note name must be a string T - mydish.ops().save.apply() T - The currently viewed SDRecord has been appended to the selected working set
Object Name Selection --------------------- - mydish.ops().select.setws('dishparkes') T - mydish.ops().select.setcriteria(critrec=[header=[source\_name='ngc1808']]) T - mydish.ops().select.apply(F) # Note (F designates that this is not from # the GUI T Record Selection ---------------- single values,e.g., rows 1,2,4: - mydish.ops().select.setcriteria(critrec=[row=array([1,1,2,2,4,4],2,3)]); ranges,e.g., rows 1-4: - mydish.ops().select.setcriteria(critrec=[row=array([1,4],2,1)]); Scan Selection -------------- single values,e.g., scans 2,20: mydish.ops().select.setcriteria(critrec=[header=[scan_number=array([2,2,20,20],2,2)]]); ranges,e.g., scans 14-16: - mydish.ops().select.setcriteria(critrec=[header=[scan_number=array([14,16],2,1)]]); Date Selection -------------- mydish.ops().select.setws('working_set1'); mydish.ops().select.setcriteria(critrec=[header=[date='1997-04-14']]); mydish.ops().select.apply(F); UTC Selection - in seconds since date ------------- mydish.ops().select.setws('dishparkes1'); mydish.ops().select.setcriteria(critrec=[header=[ut=array([310.5],2,1)]]); mydish.ops().select.apply(F); Rest Freq. (Hz) Selection -------------------------- mydish.ops().select.setws('dishparkes1'); mydish.ops().select.setcriteria(critrec=[data=[desc=[restfrequency=array([1.102014e11,1.102015e11],2,1)]]]); mydish.ops().select.apply(F); # the F designates that it is not from the GUI
This operation will write the abscissa and ordinate of an SDRecord to a specified ASCII file.
- mydish.ops().write.setof('myspectrum') T
An example script looks as follows:
ok := mydish.ops().write.setof(ofname="myspectrum" ) ok := mydish.ops().write.apply()