ALMA FITS Keywords: Difference between revisions

From Italian ARC
Jump to navigation Jump to search
No edit summary
No edit summary
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
The ALMA Keywords Filler  (AKF) CASA task <sup>'''1'''</sup> is build to generate and eventually ingest in the headers the new FITS keywords that we suggest could be useful for a generic ALMA archive miner.  The AKF is a Python-based script that exploits existing CASA tasks and  toolkit (https://casa.nrao.edu/docs/CasaRef/CasaRef.html) .
Detailed information on the definition of the keywords provided by the AKF is presented in the  [[Media:AKF_v1.2.pdf|AKF_v1.2_manual ]] (version under revision after referee report). <br>


The ALMA Keywords Filler (AKF) is a Python-based script that exploits existing CASA tasks and toolkit (https://casa.nrao.edu/docs/CasaRef/CasaRef.html) <br>
In the following,  the instructions to install the task are described:
Detailed information on the definition of the keywords provided by the AKF is presented in the [[Media:AKF_v1.0.pdf|AKF_v1.0_manual ]]. <br>
* check that astropy, numpy and pyfits are installed
* untar the AKF.tar file into a directory of your choice  (e.g., YourHomeDir/ITALIAN_TOOLS)
* enter in that directory (i.e. cd YourHomeDir/ITALIAN_TOOLS)
* launch CASA and run "buildmytasks" in that directory (i.e. os.system(‘buildmytasks’))
* rename mytasks.py in ITtask_AKF.py (i.e. mv mytasks.py ITtask_AKF.py)
* run the ITtask_AKF.py file (i.e. execfile(‘YourHomeDir/ITALIAN_TOOLS/ITtask_AKF.py'))
* you should be able to run the new task in CASA just doing:
inp AKF  or  tget AKF


It consists of two codes (that could eventually be called in sequence):<br>
The inputs of the task are:
* imName: it is the input image to process  and it is a mandatory parameter to provide;
* kwdlist: it consists in the list of keywords to be calculated. The allowed keywords are those of Sect. 3. If the list is not given (kwdlist=[]), all the implemented keywords will be calculated.
* outfile:  the name of disk file to write the output could be given. If no outfile name is given, the results will be written only to the terminal;
* include: it allows to ingest the calculated keywords in the FITS headers. The default is false which means that no keywords will be added to the headers.


1. AKF_v1.0_ms.py: it generates the following keywords:  It requires that (only) the  ms from which the input FITS image was produced is in the same folder as the image. Since the program browses the ms tables, it can take some minutes to run (and up to ~30 min for the biggest datasets as large as 100 Gb). However, it is possible to request the production of only specific keywords. <br>
Below the AKF CASA task <br>
[[Media:AKF_v1.2.zip |AKF_v1.2.zip]]<br>


2. AKF_v1.0_fits.py: it generates the keywords listed in Sect. 3.2. It calculates the values from the image itself and it is usually faster than the ms code. Also in this case it is possible to produce all or a selection of the keywords.<br>
The scientific application of the AKF task is wide. <br>
[[Media:lc_J0635-7516.jpg |lc_J0635-7516.jpg]]: Here an example of light curves derived using the AKF task for the blazar source J0635-7516 (Bonato et al. 2018).<br>
[[Media:code_J0635-7516.py |code_J0635-7516.py]]:  Here the Python code to produce the above light curves.


The result of the codes is a Python dictionary.
<sup>'''1'''</sup> '''Reference:''' <br>
ALMA FITS header keywords: a study from the archive User perspective.<br>
IRA internal report n. 518<br>
https://www.ira.inaf.it/Library/rapp-int/518-18.pdf<br>


 
Useful link <br>
In the following,  the instructions to launch the codes are described:
astropy installation: http://docs.astropy.org/en/stable/install.html
* enter the folder (yourDir) where your fits files and ms are stored
* launch CASA (any version > 5.0)
* define the image to process
* imageName = 'yourDir/yourImage.fits'
* define the list of keywords you want calculate
* kwdlist =['KWDi', 'KWDj',......, 'KWDk'] where KWDi,j,k are one or more keywords belong to the same category, either data acquisition or image description keywords
* launch the correct code according to the requested category of keywords with
  execfile('AKF_v1.0_ms.py') and/or execfile('AKF_v1.0_fits.py')
 
Below the codes:<br>
[[Media:AKF_v1.0_fits.py |AKF_v1.0_fits.py]]<br>
[[Media:AKF_v1.0_ms.py |AKF_v1.0_ms.py]]

Latest revision as of 17:04, 8 January 2019

The ALMA Keywords Filler (AKF) CASA task 1 is build to generate and eventually ingest in the headers the new FITS keywords that we suggest could be useful for a generic ALMA archive miner. The AKF is a Python-based script that exploits existing CASA tasks and toolkit (https://casa.nrao.edu/docs/CasaRef/CasaRef.html) . Detailed information on the definition of the keywords provided by the AKF is presented in the AKF_v1.2_manual (version under revision after referee report).

In the following, the instructions to install the task are described:

  • check that astropy, numpy and pyfits are installed
  • untar the AKF.tar file into a directory of your choice (e.g., YourHomeDir/ITALIAN_TOOLS)
  • enter in that directory (i.e. cd YourHomeDir/ITALIAN_TOOLS)
  • launch CASA and run "buildmytasks" in that directory (i.e. os.system(‘buildmytasks’))
  • rename mytasks.py in ITtask_AKF.py (i.e. mv mytasks.py ITtask_AKF.py)
  • run the ITtask_AKF.py file (i.e. execfile(‘YourHomeDir/ITALIAN_TOOLS/ITtask_AKF.py'))
  • you should be able to run the new task in CASA just doing:

inp AKF or tget AKF

The inputs of the task are:

  • imName: it is the input image to process and it is a mandatory parameter to provide;
  • kwdlist: it consists in the list of keywords to be calculated. The allowed keywords are those of Sect. 3. If the list is not given (kwdlist=[]), all the implemented keywords will be calculated.
  • outfile: the name of disk file to write the output could be given. If no outfile name is given, the results will be written only to the terminal;
  • include: it allows to ingest the calculated keywords in the FITS headers. The default is false which means that no keywords will be added to the headers.

Below the AKF CASA task
AKF_v1.2.zip

The scientific application of the AKF task is wide.
lc_J0635-7516.jpg: Here an example of light curves derived using the AKF task for the blazar source J0635-7516 (Bonato et al. 2018).
code_J0635-7516.py: Here the Python code to produce the above light curves.

1 Reference:
ALMA FITS header keywords: a study from the archive User perspective.
IRA internal report n. 518
https://www.ira.inaf.it/Library/rapp-int/518-18.pdf

Useful link
astropy installation: http://docs.astropy.org/en/stable/install.html