Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
R. W. Garwood, J. P. McMullin
14 September 1999
A postscript version of this note is available.DISH is a collection of Glish scripts and clients which provide an environment within AIPS++ intended to be used for single dish radioastronomy data analysis. Its initial aim is to be a worthy replacement for traditional single dish analysis programs such as UniPOPS. Eventually it will provide access to more advanced data calibration and imaging utilities which will share the same basic design as the sythesis calibration and imaging utilities in AIPS++.
To start DISH, you must type the following at the glish command line after starting AIPS++:
include "dish.g"
In DISH, wherever practical, what you see is what you are operating on. So, for example, when you press the ``Apply'' button in the ``Baselines'' graphical user interface (GUI) frame of DISH, a baseline will be fit to whatever is currently plotted in the DISH plotter. Results appear in the results manager and, when appropriate, are immediately displayed on the plotter. Results can be moved between the results manager, the calculator, and the browser through the use of a menu which appears when the user presses the right mouse button in one of these frames.
The current state of DISH (the contents of the results manager, the settings of all of the operations, the contents of the calculator, and any active browsers) can be saved at any time either to the default state file or to a location of the user's choosing. DISH can be restored to a previously saved state. By default, DISH saves its state upon exit from glish and restores itself to that same state when DISH is started in a new Glish session.
In this release DISH only uses data in AIPS++ tables which have been filled from FITS binary tables which follow the single dish FITS convention (SDFITS) described in Appendix C. Future versions will interact directly with AIPS++ MeasurementSets containing single dish data.
Converting from UniPOPS SDD data to an AIPS++ table readable by DISH currently requires three steps:
Use the UniPOPS utility uni2fits to convert the SDD data to FITS binary format. To use the program, you must be logged onto a Sun workstation where UniPOPS has previously been installed and have your path include:
export popsdir=~unipops/test/ export PATH=$popsdir/sunbin:$popsdir/utilities:$PATH
Use the AIPS++ utility uni2sdfits to convert the data file. The syntax is:
uni2sdfits input=unipops_fits_file output=sdfits_file
fits2table input=sdfits_file output=aips2_table [which_hdu=#]where ``sdfits_file'' is the name of the SDFITS file and ``aips2_table'' is the desired name of the new AIPS++ table created by this step. The third argument, ``which_hdu'', is optional. Use this to specify a specific FITS header data unit (hdu) other than the first one after the primary hdu. For example, if you have a FITS file which has three tables following the primary hdu and the second table is a valid SDFITS table then you would use
which_hdu=2
to indicate that that hdu is
the one to be converted to the indicated output AIPS++ table.
The following sections detail the major graphical compenents of DISH.
The Results Manager is the heart of DISH. All results which DISH creates in response to user actions are stored in the results manager and listed in the Results window. These results are all available at the Glish command line as glish variables of the same name for the user to interact with. DISH immediately plots the currently selected result if it can be plotted. A description is associated with each result. The user can change the description or the name of the result if they choose to do so. Certain results can also be browsed. Since each result is also a glish variable of the same name, new names are limited to be a valid glish variable name.
Results can be copied to and from the clipboard or to the calculator. This Copy/Paste facility is activated by pressing the right mouse button when the mouse pointer is over the Results window. A popup menu appears with the three possible options. The current selection is copied to the chosen destination when a copy option is selected. The contents of the cliboard is pasted into the results manager when that option is selected.
Results are either working sets (also known as sditerators), SDRECORD, and anything else.
A working set is a collection of SDRECORDs. Specifically, it is an sditerator tool. When you open a data set through the File menu (either a new one or an existing one) the result is a working set which will be shown in the results manager. The other way to create a working set is to use the ``Apply'' button in the ``Selection'' operation. When you make a selection this way the result is also a working set. It does not make a copy of the selected data, rather it makes a reference to the selected data in the underlying data. This means that if you change the underlying data, the reference in the selected data is also changed. Working sets can be browsed. See the Reference Manual for more information on the Sditerator tool.
An SDRECORD is a Glish record which has the structure described in Appendix A. It is data (generally spectra at this point in DISH development) plus some standard header values, any non-standard header values, and a history of what has been done to that particular SDRECORD. SDRECORDs can be browsed and plotted.
Anything may appear in the results manager. If it isn't a working set or an SDRECORD it can not be browsed or plotted.
New data files are created, existing data files are opened, the state of
DISH is saved, a previously saved state is restored, and DISH is reset to
its default initial state through the
File menu. The GUI panels for each available operation are enabled
and dismissed through the Operations menu. The Options menu
has two options which can be turned on or off. The ``Write to Script'' option,
when turned on, causes DISH to echo the
underlying glish commands to the AIPS++ defaultscripter (ds) tool when a GUI
operation occurs in DISH. This can be a way to learn more about what
DISH is doing behind the scenes and write glish scripts to do operations
not yet available in DISH. When the ``Save when done'' option is turned on,
the state of DISH is saved to the current state file when the
``done'' function is invoked (e.g. dish.done()
). The ``done''
function is always invoked whenever you exit glish. Because DISH can
not be restarted after ``done'' has been called it is best not to
do that unless you are about to exit glish. This deficiency will be
corrected in the next release.
The Message Line is the text immediately below the Results Manager. These messages are also echoed to the AIPS++ logger for longer term storage.
A working set within the results manager can be 'browsed' or examined by hitting the 'Browse' button. This brings up a frame which lists all of the scan numbers and objects, record by record, within the working set. Each SDRECORD can also be browsed to examine all of the contents (e.g., all of the header information and data).
When browsing a working set, individual records can be copied to the clipboard or to the results manager. This copy facility is activated by pressing the right mouse button when the mouse pointer is over the browser window. A popup menu appears with the three possible options. The current selection is copied to the chosen destination when one of the copy options is selected.
Inspecting is another way of viewing the values of the results within the results manager. It lists all of the contents of the selected result. These may be accessed via the Glish command line by the names shown while inspecting.
Currently there are eleven operations pre-defined within Dish. These operations are general utilities available from the basic Dish Gui. All operations have two basic buttons: a green Apply button which will execute the given operation and a yellow Dismiss button which will close the operation frame but retain all information in that frame for subsequent use.
The Averaging operation offers several options for performing the averaging (Figure 1). Alignment which may be either None, By Velocity, or By X-Axis, 2) Rest Frequency, which allows shifting to match the first in the average (for example, for averaging spectra from transients), 3) Weighting which may be None, Tsys and Time or by RMS, and 4) which will use any selections chosen from the Selection Operation prior to averaging.
The Baseline operation allows either a polynomial fit or a sinusoid fit. The baseline regions may be typed into the regions entry box at the bottom of the frame, or selected via cursor (the Plot Ranges and Cursor Active buttons should both be checked). The baseline operation frame can be seen in Figure 2.
The default action is to calculate the baseline and show it. Once the fit seems satisfactory, the 'Subtract' button must be checked and the fit 'Apply'd. This will remove the baseline and display the resultant spectrum. The baseline fit may be viewed from the results manager. The current ranges selected will be displayed in the entry field. A history of these is preserved within a cache which can be viewed by clicking on the down-arrow button. The RMS of the fit is displayed to the right of the frame. Units for ranges or fit parameters (sinusoid only) may be converted between channels and X-Axis units using the Convert button.
The Calculator operation is a general tool for manipulating spectra in ways not facilitated by the basic set of operations. Spectra may be transferred into the calculator stack through the use of the Copy/Paste to Clipboard facility.
The Copy/Paste facility is activated by the right mouse button. A popup menu appears with a two copy options and a paste option. ``Copy to clibpoard'' will copy whatever is selected in the Calculator stack listbox to the Clipboard; the Clipboard is simply a convenient virtual storage area. ``Copy to results manager'' copy whatever is selected in the Calculator stack listbox to the results manager. ``Paste from clipboard'' retrieves whatever was most recently sent to the clipboard. For example, in Figure 3, the Results Manager spectrum ``average3'' was copied into the Calculator stack. An ``_1'' designation was added to the label to distinguish it from the same value in the Results Manager. The spectrum was then multiplied by a factor, producing ``average3_1_2''. The additional id tag is an underscore and the stack number.
The available functions may be seen in the figure. In addition, it works as any standard Reverse Polish Notation calculator. Numbers, vectors and arrays may be typed into the entry field. The calculator will only work with SDRECORDs, numbers, vectors and arrays.
The Function on Data operation is another means of manipulating the displayed data. The string typed in the entry box of this operation is evaluated by glish after any of the standard macros are replaced by their equivalent glish. The result of this evaluation is then reassigned to the data array of the last viewed SDRECORD. The standard macros and their meanings are:
Since whatever this text evaluates to after macro substituion is reassigned to the data array, it must have the exact same shape as the data array initial had.
Basic scaling or manipulations can be obtained by typing expressions that operate on ARR. For example, a simple scaling can be obtained by typing the function ``ARR*1.5'', and then pressing ``Apply''. Any function available from within Glish or known at the command line (e.g. a function defined by the user during the run of Dish), can be accessed and used in these expressions.
The Multi-Operation Frame allows the user to group sequences of commands that will be used repeatedly within a working set on spectra into a single operation. In Figure 4, an Average, Baseline and Smoothing operation are grouped under the cache name of 'mylist'. Hitting the Apply button will execute the sequence of commands in their given order. The combination of the Add and Delete buttons allows easy manipulation of the command list caches.
The Re-gridding operation is a more generalized version of the Smoothing Operation as it allows both finer and coarser adjustments of the grids. Currently, it allows Hanning, Boxcar and Gaussian smoothing along with Spline and Fourier Transform Interpolations.
The Saving operation allows the user to store and organize spectra into named working sets. The working set must first be defined through the File Menu option ``Open'' (selecting on Read and Write). Once the working set is defined, any displayed spectrum may be written to the working set on disk.
The Selection operation allows a number of selection criteria to be chosen to create new working sets which are subsets of existing working sets. The recognized terms are: Object Name, Record, Scan, Date, LST, and Rest Frequency. Typing into any of the entry fields is allowed but the selection will only be used if the check box on the right is marked. A history of selected ranges or names will be preserved. For numerical selections, ranges may be made as follows:
Record,Scan Entry: 8,9,10 # Select scans 8, 9 and 10 8,[10:13],17 # Select scans 8, 10, 11, 12, 13, and 17
The 'All' button will select all relevant values for the given selection criteria.
The Smoothing operation is a more specific tool than the Re-gridding operation. It offers easy Hanning, Boxcar and Gaussian smoothing.
The Statistics operation calculates basic statistics on an interval of the spectrum. The interval must be defined by the cursor (activate the Plot Range and Cursor Active buttons) and then left click on the left and right regions of the spectrum which are of interest. The region will appear in the Range entry field. The units may be converted between X-Axis units and channels through the convert button (similar to the Baseline operation capability). The Apply button will calculate the Peak value, the location of the peak, the Area over the region, the location of the centroid (half area), the rms, and the minimum. These values may be written as a record to the clipboard through the ``Copy to CB'' button. The record looks as follows:
- statrec:=dcb.paste() - statrec [peak=2.09596825, area=29425582.1, min=-0.26479581, rms=0.580018938, scan=20, ce ntroid=2.22369707e+10, vpeak=2.22353317e+10] -
In addition, the data may be written to a file through the ``Print to File'' button. This pulls up a frame which prompts the user for a filename. If the file exists, it will append the values to the end of the file. The file looks as follows:
scan start stop atPeak Centroid 20 2.2225160e+10 2.2245390e+10 2.2235332e+10 2.2236971e+10 Peak Area Mininum rms 2.0959682e+00 2.9425582e+07 -2.6479581e-01 5.8001894e-01
This operation allows convenient output to a disk file in the current directory. It automatically defaults to the file name of ``scan_number.spc''; for example if you Write to File while looking at scan 20, the file will be "20.spc". The file looks as follows:
FREQ other axis Hz other unit 22203023360.000000 -3.907563 22203086216.617188 -4.986684 22203149073.234375 -4.020397 22203211929.851562 -4.558375 22203274786.468750 -4.556173 22203337643.085938 -3.856671 22203400499.703125 -4.001695 22203463356.320312 -3.464213 22203526212.937500 -4.438780 22203589069.554688 -3.296077 ...etc.
If you do nothing, a file called default will be created within
the $HOME/aips++/dishstate
directory upon exiting from a DISH session.
The file is created automatically and dish will be restored to the
state saved in that file automatically
upon startup. The dish state file
contains all of the values known to the results manager as well as the
various settings for each GUI element and operation. So, by default
a record is kept of the state of DISH after each use of DISH and
DISH is restored to this state the next time DISH is used.
There are several ways in which you can alter this default behavior.
dish.done()
is
invoked (which
happens which you exit glish) can be turned off by toggling that option
in the Options menu.
.aipsrc
file.
$HOME/aips++/dishstate/default
All of the values in the DISH results manager can be manipulated at the Glish command line. These results can then be returned to the DISH results manager. Please see Recipe 1 for an example.
The Dish Plotter is the familiar AIPS++ pgplotter tool, modified for additional utilities and capabilities. Any activity or task within Dish which produces a plottable result, will automatically have the result displayed in the Dish Plotter; for example, selecting entries within the Results Manger, the SDRecord Browser, or Calculator Operation stack will plot the selection chosen. The plotter is arrayed as shown in Figure 8.
This is the standard pgplotter File menu. Open...: This operation will read in an plot file on disk written by the Save command. Save: This operation will write a vector plot file of the displayed image to disk. Save will write to the file specified in feature L (defaults to dish.plot). Preview...: This operation brings up a ghostview session with the currently displayed plot shown. This feature allows you to see how such a plot will look printed out on a page. Print: This operation will print the current spectrum. Save...: This operation will also write a vector plot file of the displayed image but allows you to specify the file name unlike the 'Save' feature and the quicksave button (feature L). Exit: Exits from the Dish Plotter; closes the frame.
This is the standard pgplotter Edit menu. Add commands...: This allows additional PGPLOT commands to be added to the existing plot. For example, additional labeling or fiducial lines may be easily added. The Add commands brings up a frame with a list of all of the available PGPLOT commands. Selecting one brings up a brief explanation along with the various arguments required. An example frame is shown in Figure 9.
Change commands...: This allows already executed commands to be altered. A frame is brought up with the existing list of PGPLOT commands which produced the displayed frame. Again selecting a command brings up a small explanation along with the arguments used in its execution. Cut, Copy, and Paste features are available to duplicate and add additional commands. An example session is shown in Figure 10.
This menu allows selection of four different plot styles: 1) Line (default), 2) Histogram, 3) Points and 4) Connected Points. This feature operates on the active (most recently displayed) plot in the frame.
This menu allows selection of five different line styles. This feature is only effective if the Line Plot Style is selected. The five line styles are: 1) Solid, 2) Dashed, 3) Dotted, 4) Dot-Dash, and 5) Dash-dot-dot-dot.
The header menu offers four levels of header information on each plot: 1) None (the default), 2) Stats which will give the rms and mean of the displayed plot and, if available, the rms and mean of selected baseline regions on the plot, 3) Brief which gives only information on the Source name, scan number, date and time, and 4) Full, which renders all of the above information plus values for the position, altitude, azimuth, frequency, channel resolution. MORE
The color menu currently offers only two options. Normal which is the default black background and Reverse, which is a white background.
Four options for labeling the X-axis of a plot: 1) X-axis units: this will default to displaying whatever the default units of the plot are. In the case of the figure this is frequency, 2) Channel units: this will label the X-axis by channel number, 3) X-axis-Channel: this will label the bottom X-axis with the default units of the spectrum while the top will indicate the channel number, 4) Channel-X-axis: this is the reverse of three.
The overlays menu is a simple toggle switch between On and Off. In the Off mode, all new plot results or selections will clear the screen before plotting the new result. The only exceptions to this are the Baseline operation in Show mode, which will overplot the calculated baseline over the spectrum, and multi-channel data which will plot as many channels as found on the same screen. In the On mode, all new selections and results will be overplotted; the axes will be scaled, if necessary, to accomodate all overlayed plots.
Currently this menu offers only an unzoom feature. The unzoom handles the Dish Plotter zooming capability (the middle mouse button zoom), not the standard pgplotter zoom capability found in the Tools Menu. The middle mouse button zoom is required to appropriately handle overlayed plots; the pgplotter zoom will only zoom the active plot which is the last one plotted. This isn't generally a problem unless the axes for overlayed plots differ.
There are two tools offered. Zoom which is the standard pgplotter zoom capability. You may select either a boxed region or an X-axis or Y-axis zoom. Another button restores the plot to the full range.
The second tool is called LineID. This tool browses an aips++ table version of the Poynter and Pickett molecular line catalog, and plots any lines found that fall within the frequency range of the displayed plot. Line positions are plotted with short tick marks along the top of the plot while the corresponding molecular name tag is plotted vertically along the bottom.
Standard pgplotter help menu. The options are: 1) PGPlotter: this will drive your netscape browser to the help section on the PGPlotter. 2) Reference Manual: this will drive the browser to the Reference Manual main page. 3) About Aips++...: This provides basic information about the AIPS++ version being used.
This is the filename that the Save option in the File menu will save to by default. The default plotfile name is dish.plot.
Clears all currently displayed plots. Resets most plot parameters to their defaults. The color of displayed data resets to red, but line styles and plot styles previously selected will be retained.
The Redraw essentially re-executes all of the cached plot commands again. This becomes important if the plot has deviated from the original through, for example, command line additions.
Whenever the cursor is within the Dish Plotter frame, the cursor positions will be continuously read back. The coordinates shown are the X and Y position as defined by the X and Y axes' units. The channel number and Y-value of the cursor position are also displayed.
Dismisses or closes the Dish Plotter frame. The frame will be automatically re-opened if an action occurs which produces a plottable result, i.e., if a spectrum is selected, a new Dish Plotter frame will be initialized to display the selection.
The sdimager tool is an added utility to the DISH analysis environment which can perform simple imaging tasks using the DISH Plotter; it is designed to use SD working sets so it's use is exclusive to DISH.
sdimager may be summoned through either (1) the tool manager or from (2) the command line. From the tool manager, select "Packages, Modules, Tools, and Functions" bar, selecting the DISH package and the sdimager tool. This brings up a constructor gui which lets you name your version of the sdimager (the default is mysdimager). Hitting "Create", makes the tool and brings up a GUI showing the available functions. Selecting on a function brings up the entry fields with their default values (See Figure reffig:looktool). There is also an sdimager tool created upon entry into DISH, called dishsdi, which can be used immediately from the command line. For example:
- field_names(dishsdi) *agent* type done lookmap spectramap contourmap otfmap clumpfind - dishsdi.lookmap('w49n_bl1',-180,180,-180,180,0,0,410,F,'Test','Test2','Test3') T -
This creates the same output as seen in Figure reffig:looktool.
In addition, this object can be used to either create the sdimager contructor GUI or to go directly to one of the function GUIs. For example:
- tm.show('dishsdi') # use the toolmanager to call the constructor T # GUI for the sdimager - tm.show('dishsdi.lookmap') # use the toolmanager to call up the GUI for F # the lookmap function -
Currently, there are three working functions within sdimager with plans for two more (an otfmap utility and a clumpfind utility for spectral line data cubes are both planned for late summer).
The lookmap function plots either crosses or scan numbers at the locations where they were obtained relative to a selected reference scan. The inputs for the function are:
The spectramap function plots spectra at the locations where they were obtained relative to a selected reference scan. The inputs for the function are:
The contourmap function plots contours of integrated intensity over a region specified by the map boundaries relative to a reference scan. Currently this function expects regularly gridded maps and performs no interpolation. This should be remedied soon but it serves as a quick look facility. In addition, contour map arrays may be written out as image files to be displayed in the more sophisticated AIPS++ viewer (not yet implemented). The inputs for the function are:
Goal: To reduce an on/off total power scan pair by extracting the 'on' and the 'off' source scans from an opened data set, constructing a difference scan from them, and inserting the result into the DISH results manager.
Assume: You have a data set named rawdata opened and available in the dish results manager. An 'on' scan is located at the first record in rawdata and an 'off' scan is located at the third record in rawdata.
AIPS++/Glish commands and results Purpose and Background rawdata.setlocation(1) Move the rawdata pointer so that it points at the first record, where the 'on' scan is located. on:=rawdata.get() Get that scan and assign it to a variable named on. on is a glish record having a known structure. For example, the data and its description (axis type, value, etc.) is in a subrecord, data, and a subfield of that, arr, contains the data array. rawdata.setlocation(3) Move the pointer to point at the 'off' scan location. off:=rawdata.get() Get it and assign it to 'off'. result:=off; Set result initially to 'off' so that it is a complete SDRECORD. Now adjust the the data array... result.data.arr:=(on.data.arr - Subtract the 'on' data array from the 'off' off.data.arr)/off.data.arr data array and divide the result by the 'off' data array. Additional operations to appropriately scale the data and adjust relevant header words would be done here. dish.rm().add('result','Difference Add this result to the DISH results of rows 1 and 3',result, manager. The final argument tells the 'SDRECORD') results manager that this is an SDRECORD something the results manager knows how to display and interact with.
Currently, the gaussian fit operation is available only as a command line option. For this example, we use data obtained at the NRAO-12 meter telescope of methanol emission from Comet Hale-Bopp (the resultant figure of this operation may be seen in Figure 8.
Goal: To apply multiple gaussian fits to observed lines.
- field_names(dish) done dismiss gui rm gaufit ops addop normalcursor busycursor savestate restorestate debug open showscript message plotter - dish.gaufit() How many gaussians to fit? >> 3 please enter: height, width and center (separated by commas), for gaussian 1 >> 0.08,1100.,-42048. please enter: height, width and center (separated by commas), for gaussian 2 >> 0.045,1500.,-29794. please enter: height, width and center (separated by commas), for gaussian 3 >> 0.02,1100.,-22484. [0.08 0.045 0.02] [1100 1500 1100] [-42048 -29794 -22484] lengths of others are 3 3 3 Warning: fit has not converged # Note the lines in this case appear # to be non-gaussian, hence the fit # doesn't converge with our initial # estimates. Errors in the fit are # presented below. fit result: ----------- [converged=F, currentIteration=0, maxIter=15, criteria=0.00100000005, height=[0.08 0.045 0.02] , center=[-42048 -29794 -22484] , width=[1100 1500 1100] , height_error=[0.91675759 0.780412991 0.912533633] , center_error=[40.9339062 0.216167586 274.088285] , width_error=[-5922.02412 -10144.8242 -23016.1549] , chisq=0.0108240801] mean of residuals: -9.10550447e-05 rms of residuals: 0.00919536679 F
DISH is intrinsically enabled for extensibility. Currently, any files of the type dishops_xxxxx.gp (where xxxxx can be any string, e.g. dishops_cli.gp is used for the gaufit operation to indicate it is a command-line-interface operation), within the working directory will be automatically loaded. Functions within these files will be added to the those naturally available within dish. A simple template example is the following:
# dishops_template.gp -- template file for adding command line operations # to dish # Copyright (C) 1999,2000 # Associated Universities, Inc. Washington DC, USA. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published by # the Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This library is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public # License for more details. # # You should have received a copy of the GNU Library General Public License # along with this library; if not, write to the Free Software Foundation, # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. # # Correspondence concerning AIPS++ should be addressed as follows: # Internet email: aips2-request@nrao.edu. # Postal address: AIPS++ Project Office # National Radio Astronomy Observatory # 520 Edgemont Road # Charlottesville, VA 22903-2475 USA # pragma include once; dishops_template:=[=]; dishops_template.attach := function(ref public) { # now add whatever command line operation needed # for a specific example look at dishops_cli.gp which includes # the gaufit operation # Add your functions here vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv public.myfunction := function(input1='yes',input2=3.1415926) { print 'This is my function and it will do whatever I want'; print 'My arguments are: ',input1,input2; print 'If these are yes and 3.1415925 then I used the defaults'; print 'I can have as many arguments as needed.'; return; } # End of your function ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # you can add as many functions as you desire return T; # to indicate the attachment went successfully }
Running this operation within dish looks like the following:
- field_names(dish) done dismiss gui rm ops addop normalcursor busycursor savestate restorestate debug open showscript message plotter gaufit myfunction - dish.myfunction() This is my function and it will do whatever I want My arguments are: yes 3.1415926 If these are yes and 3.1415926 then I used the defaults I can have as many arguments as needed. F
The SDRecord is the fundamental data atom of dish.
The current sdrecord structure was arrived at early in the design process. The next version of the sdrecord will more closely resemble individual rows of the MeasurementSet.
Unless otherwise stated, the units of all values in an SDRecord are SI units. Angles are expressed in degrees. This structure was arrived at before Measures and coordinates were fully supported in Glish. As a result, temporary fields in an SDRecord are used to hold sufficient information to indicate the coordinate system and reference frame where appropriate. All of the fields described below are required unless stated otherwise.
The value of a field is undefined in the following circumstances:
An SDRecord is a Glish record having the following structure:
I, Q, U, V, RR, RL, LR, LL, XX, XY, YX, YY, RX, RY, LX, LY, XR, XL YR, YL, PP, PQ, QP, QQFor a typical single dish telescope, raw data will have stokes = ("XX", "YY") or ("RR", "LL").
In addition to the fixed structure described above. An SDRecord may contain an optional ns_header field. This is a Glish record which can contain any additional information not found in the fixed portion of an SDRecord. This field will typically be used for telescope-dependent information.
The x-axis can be easily constructed from the data field by the following simple Glish function:
make_xaxis := function(ref data) { x := data.crval; x +:= ([1:data::Shape[1]] - data.desc.crpix)*data.desc.cdelt; return x; }
To summarize, in pseudo-Glish an SDRecord looks like this:
sdrecord := [data=[=], header=[=], hist=[=], ns_header=[=]]; sdrecord.data := [arr=[...], flag=[...], desc=[=], weight=[...]]; sdrecord.data.desc := [units=,stokes=,ctype=,crpix=,crval=,cdelt=]; sdrecord.header := [time=,scan_number=,object=,etc.]; sdrecord.hist := ["# useful history","# as a vector","# etc. etc."]; sdrecord.ns_header := [non-standard fields] ns_header is optional
Additional information can be found in the Reference Manual section on the get function of the Sditerator tool. See also the is_sdrecord function.
SDFITS is a convention for the use FITS binary tables to store single dish data. This appendix will eventually be turned into a full fledged note. At the present time, it is simply a summary of the various rules regarding the interpretation of keywords and columns which, taken together, constute the Single Dish FITS convention.
A FITS binary table is also a SDFITS binary table if it follows these rules.
EXTNAME = 'SINGLE DISH'The EXTNAME keyword must have a value of ``SINGLE DISH''. A table having this value for EXTNAME is assumed to be fully compliant with this convention.
There are a few exceptions to this rule. FITS keywords which are
required to describe the structure of the table are not virtual
columns. These include NAXIS, NAXIS1, NAXIS2, BITPIX, XTENSION,
[0]EXTNAME, EXTVER, EXTLEVEL, PCOUNT, GOUNT, TFIELDS, TFORM, TTYPE, TUNIT, TNULL,
and TDISP. The TDIMnnn keyword is the only table description keyword
which may be a column as described elsewhere in this appendix.
DATAMAX and DATAMIN are special keywords. When used as keywords it is most likely that the writer of that table meant them to reflect the range of all of the data found in that table and not to be used on a row-by-row sense. If the writer feels a need to supply row-by-row values for these two keywords, they should explicitly make them true columns.
When creating a table, a column may be made virtual if it's value can be represented as a single keyword (if it is constant over all rows) and if that constant value is NOT an IEEE special value (it has a standard ASCII representation) and the name of the column is 8 character or less.
If a column exists which has the same name as a keyword, the column values should be assumed to take precedence (writers should attempt to ensure that this confusing situation does not happen).
TDIMnnn = '(n1,n2,n3,n4...)'
TMATXnnn = T
.
It is assumed that TMATXnnn = T
for the DATA column even when not
present. The use of TMATXnnn = F
for the DATA column is an error.
Axes descriptor keywords/columns include (not all need be present for each axis):
Due to the virtual column convention, the following conflict may arrise:
TTYPE10 = 'CDELT4' TFORM1 = '1E' TUNIT10 = 'radian' CUNIT4 = 'degree'Writers should avoid this conflict. Readers encountering such a conflict should report this as an error in the FITS table. However, readers may also choose to proceed by arbitrarily resolving the conflict so that some attempt may be made within the anaysis package to deal with this error. It is recommended that the CUNITxxx specification take precedence over any TUNITxxx specification. In any case, this conflict and the readers resolution of the conflict (if at all) should be reported to the user.
The other standard FITS Image axis keywords may be used here. This will include all of the WCS convention keywords when they become accepted as part of the FITS standard.
Defined axis types (CTYPEnnn values) for this convention (others are allowed but their values may be ignored by readers) are: