Tutorial: LoadASCIIFile function

The function reads/imports data from an ASCII file.
 

Input parameters:

  • FileName: path and name of an ASCII or a FITS file.

  • NumHeaderLines (has to be defined only for ASCII files): number of header lines, which are ignored (default: 0).

  • RestFreq (has to be defined only for ASCII files): rest frequency in MHz (default: 0). (If this parameter is set to zero, the intensity is plotted against frequency (in MHz) otherwise against velocity (in km s-1).

  • vLSR (has to be defined only for ASCII files): velocity (local standard of rest) in km s-1 (default: 0), only used, if RestFreq != 0. (velocity(Frequency = RestFreq) = vLSR)

Output parameters:

  • ASCIIdata: contents of the ASCII (FITS) file (as an python array, e.g. ASCIIdata[0] contains the data of the first data point). For FITS files, the first n columns of the python array describe the coordinates, e.g. rectascension, declination, and frequency, whereas the last column describe the corresponding intensity (in e.g. Jy/beam or Kelvin).
     

Examples:

  • import data from an ASCII file

    # In CASA:
    FileName = "Observational-File.dat"
    NumHeaderLines = 0
    RestFreq = 0.0
    vLSR = 0.0
    ASCIIdata = LoadASCIIFile()