|
|||
NRAO Home > CASA > CASA Cookbook and User Reference Manual |
|
H.1 The XML file
The key to getting your task into casapy is constructing a task interface description XML file.
Some XML basics, an xml element begins with <element> and ends with </element>. If an XML element contains no other XML element you may specify it via <element/>. An XML element may have zero or more attributes which are specified by attribute=”attribute value”. You must put the attribute value in quotes, i.e. <element myattribute=”attribute value”>.
All task xml files must start with this header information.
<?xml-stylesheet type="text/xsl" ?>
<casaxml xmlns="http://casa.nrao.edu/schema/psetTypes.html"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd
file:///opt/casa/code/xmlcasa/xml/casa.xsd">
and the file must have the end tag
Inside a <task> tags you will need to specify the following elements.
- <task>
- Attributes
- type required, allowed value is ”function”
- name required
- Subelements
- shortdescription
- required
- description
- required
- input
- optional
- output
- optional
- returns
- optional
- constraints
- optional
- <shortdescription>
- - required by <task>; A short one-line description describing your
task
- Attributes
- None
- Subelements
- None
- <description>
- - required] by <task>, Also used by <param>a; A longer description describing your
task with multiple lines
- Attributes
- None
- Subelements
- None
- <input>
- - optional element used by <task>; An input block specifies which parameters are used for
input
- Attributes
- None
- Subelements
- <param>
- , optional
- <output> - optional
- An output element that contains a list of parameters that are ”returned” by the
task.
- Attributes
- None
- Subelements
- <param>
- , optional
- <returns> - optional
- Value returned by the task
- Attributes
- type
- optional; as specfied in <param>
- Subelements
- <description>
- , optional
- <constraints> - optional
- A constraints element that lets you constrain params based on the values of
other params.
- Attributes
- None
- Subelements
- <when>
- , required.
- <param> - optional
- The input and output elements consist of param elements.
- Attributes
- type
- , required; allowed values are record, variant, string int, double, bool, intArray, doubleArray, boolArray, stringArray
- name
- , required;
- subparam
- , optional; allowed values True, False, Yes or No.
- kind
- , optional;
- mustexist
- , optional; allowed values True, False, Yes or No.
All param elements require name and type attributes.
- Subelements
- <description>
- , required;
- <value>
- , optional;
- <allowed>
- , optional;
- <value> - optional
- Value returned by the task
- Attributes
- type
- , required; as specified in <param> attributes.
- Subelements
- <value>
- , optional
- <allowed>
- - optional; Block of allowed values
- Attributes
- enum
- , required; maybe enum or range. If specfied as enum only specific values are allowed If specified as range then the value tags may have min and max attributes.
- Subelements
- <value>
- , optional
- <when> - optional
- When blocks allow value specific handling for parameters
- Attributes
- param
- , required; Specifies special handling for a <param>
- Subelements
- <equals>
- , optional
- <notequals>
- , optional
- <equals> - optional
- Reset parameters if equal to the specified value
- Attributes
- value
- , required; the value of the parameter
- Subelements
- <default>
- , required
- <notequals> - optional
- Reset specified parameters if not equal to the specified value
- Attributes
- value
- , required; The value of the parameter
- Subelements
- <default>
- , optional
- <default> - optional
- Resets default values for specified parameters
- Attributes
- param
- , required; Name of the <param> to be reset.
- Subelements
- <value>
- , required, the revised value of the <param>.
- <example> - optional
- An example block, typically in python
- Attributes
- lang optional; specifies the language of the example, defaults to python.
- Subelements
- None
More information about CASA may be found at the
CASA web page
Copyright © 2010 Associated Universities Inc., Washington, D.C.
This code is available under the terms of the GNU General Public Lincense
Home |
Contact Us |
Directories |
Site Map |
Help |
Privacy Policy |
Search