Jeff Mangum's Gildas Tips
Last Update: JeffMangum - 02 March 2011
Really just a collection of tips-and-tricks learned over the (many) years using CLASS, GreG, etc.
Use the COMPUTE command:
[SIC\]COMPUTE OutString EXTRACT InString Start End
Character string handling: extraction of a sub-string. Returns in Out-String the sub-string InString(Start:End) (in Fortran notation...)
VTYPE Values and Use Within CLASS
VTYPE is a scalar integer value which can be one of the following:
- integer, parameter :: vel_unk = 0 ! Unsupported referential :: planetary...)
- integer, parameter :: vel_lsr = 1 ! LSR referential
- integer, parameter :: vel_hel = 2 ! Heliocentric referential
- integer, parameter :: vel_obs = 3 ! Observatory referential
- integer, parameter :: vel_ear = 4 ! Earth-Moon barycenter referential
- integer, parameter :: vel_aut = -1 ! Take referential from data
VTYPE is used in Class for 2 purposes:
- Convert (if needed) the velocities to the type ruled by the command SET VELOCITY. This is typically done when the observation is read from the file.
LAS90> help set velo
LAS\SET VELOCITY mode
L[sr] Forces the velocity axis values to Lsr values
H[eliocentric] Forces the velocity axis values to Heliocentric values
A[utomatic] Reverts to the default mode where the velocity type is
taken from the header of the spectrum.
- Compute the Doppler factor if (and only if) it was not provided in the header of the observation. The Doppler factor is not set if it has a value of -1 (0 being a legal value).
Note, though, that as of 2011-03-02 there is a bug (which has been fixed in CVS) in the display
of the VTYPE in the header when one issues a query to the header (using HEADER, for example). VTYPEs 3, 4, and 5 display as "UnEq", but are in fact set correctly in the header. One can EXAMINE the SIC variable R%HEAD%SPE%VTYPE to find out what VTYPE is really set to.
To summarize (content from Stephane Guilloteau):
- CLASS transmits the information about VTYPE faithfully in all cases.
- If the Doppler information is not available, and the observatory is known, CLASS can attempt to re-compute the velocity information from the coordinates and time. The VTYPE is handled correctly in that case.
- Known observatories are built-in to CLASS (well, ASTRO, in fact). The 'GBT' is a known observatory.
- However, if you want to convert from one velocity type to another, there is some inconsistency. The only supported conversion is between LSR and HEL. Although the same code used for the Doppler re-computing could be also employed for converting BAR type velocities, this is not done so far. The good news, though, is that CLASS does that LOUDLY, with a clear message!
- Moreover, the LSR to HEL conversion is approximate. It can become incorrect for large offsets.