Extracting scripts from these tutorials: Difference between revisions
No edit summary |
|||
Line 1: | Line 1: | ||
The series of commands shown in each tutorial can be | The series of commands shown in each tutorial can be written to a single casapy script using the CASA Guides script extractor. The script extractor is described here. | ||
__TOC__ | |||
== Introduction == | |||
The script extractor will produce a Python script that can be invoked inside casapy. The extractor ignores all CASA Guide source code that is not Python. Special UNIX commands (such as 'ls' and 'less') supported by casapy but not by Python are commented out, and interactive pauses are inserted when GUIs are invoked. (The interactive pause is necessary to avoid table lock errors that are produced when multiple tasks are run simultaneously.) | |||
== How to Get the Script Extractor == | == How to Get the Script Extractor == | ||
Line 26: | Line 14: | ||
This Python module is maintained in a github repository as part of a simple, automated benchmark testing system. You can browse the whole repository at https://github.com/jaredcrossley/CASA-Guides-Script-Extractor. | This Python module is maintained in a github repository as part of a simple, automated benchmark testing system. You can browse the whole repository at https://github.com/jaredcrossley/CASA-Guides-Script-Extractor. | ||
The older, pre-github version of the script extractor can be obtianed from ftp://ftp.cv.nrao.edu:/NRAO-staff/jgallimo/extractCASAscript.py. | ''The older, pre-github version of the script extractor can be obtianed from ftp://ftp.cv.nrao.edu:/NRAO-staff/jgallimo/extractCASAscript.py.'' | ||
== How to Use the Script Extractor == | == How to Use the Script Extractor == | ||
Make your newly acquired | Make your newly acquired Python script executable. | ||
<source lang="bash"> | <source lang="bash"> | ||
Line 37: | Line 25: | ||
</source> | </source> | ||
To run it, issue the | To run it, issue the Python script name and give the URL as the argument. For example: | ||
<source lang="bash"> | <source lang="bash"> | ||
Line 51: | Line 39: | ||
</source> | </source> | ||
This command will automatically generate a script called <tt>CalibratingaVLA5GHzcontinuumsurvey.py</tt>. | This command will automatically generate a script called <tt>CalibratingaVLA5GHzcontinuumsurvey.py</tt>. This script can be run in casapy: | ||
<source lang="python"> | |||
# in CASA | |||
execfile('CalibratingaVLA5GHzcontinuumsurvey.py') | |||
</source> | |||
== Support == | |||
Questions and bug reports should be submitted to either the [https://help.nrao.edu/ NRAO] or [https://help.almascience.org/ ALMA] helpdesks. |
Revision as of 16:18, 30 May 2012
The series of commands shown in each tutorial can be written to a single casapy script using the CASA Guides script extractor. The script extractor is described here.
Introduction
The script extractor will produce a Python script that can be invoked inside casapy. The extractor ignores all CASA Guide source code that is not Python. Special UNIX commands (such as 'ls' and 'less') supported by casapy but not by Python are commented out, and interactive pauses are inserted when GUIs are invoked. (The interactive pause is necessary to avoid table lock errors that are produced when multiple tasks are run simultaneously.)
How to Get the Script Extractor
For most uses, the single-module script extractor is all you will need. You can download it from https://raw.github.com/jaredcrossley/CASA-Guides-Script-Extractor/master/extractCASAscript.py.
This Python module is maintained in a github repository as part of a simple, automated benchmark testing system. You can browse the whole repository at https://github.com/jaredcrossley/CASA-Guides-Script-Extractor.
The older, pre-github version of the script extractor can be obtianed from ftp://ftp.cv.nrao.edu:/NRAO-staff/jgallimo/extractCASAscript.py.
How to Use the Script Extractor
Make your newly acquired Python script executable.
# in bash
chmod u+x extractCASAscript.py
To run it, issue the Python script name and give the URL as the argument. For example:
# in bash
./extractCASAscript.py http://casaguides.nrao.edu/index.php?title=Calibrating_a_VLA_5_GHz_continuum_survey
In csh, you need quotes around the URL:
# in csh
./extractCASAscript.py 'http://casaguides.nrao.edu/index.php?title=Calibrating_a_VLA_5_GHz_continuum_survey'
This command will automatically generate a script called CalibratingaVLA5GHzcontinuumsurvey.py. This script can be run in casapy:
# in CASA
execfile('CalibratingaVLA5GHzcontinuumsurvey.py')
Support
Questions and bug reports should be submitted to either the NRAO or ALMA helpdesks.