Restoring the calibrated measurement set
Calibration is the first step of processing interferometric data. Many users will want to recreate the calibrated measurement set and perform the second step (imaging) using their own scripts, or by modifying an imaging script provided with the data.
In order to obtain your calibrated data, you first need to obtain the raw data in ASDM format from the request handler.
If you downloaded and untarred all available files for this delivery as described in the notification email, then you will already see (in addition to the directories shown in the tree listing above) a directory "raw" containing your raw data in subdirectories named "uid*.asdm.sdm" and no further action is necessary. If you do not have a raw directory, you will need to download and untar the tar balls of the raw data belonging to this delivery and make sure they are put into the "raw" directory in your "member_ouss_..." directory.
For the next step, you will need the right version of CASA to be installed. Please find the line starting with "CASA version used for reduction:" in your QA2 report or README. The version indicated there is what you need to use for running the scriptForPI.
You can also see the article "What CASA version was used for QA2?'
Once the raw data is in place, cd into directory "script", start
(For more information on the execution of the pipeline please refer to the ALMA Science Pipeline User's Guide available at http://almascience.org/documents-and-tools/pipeline-documentation-archive )
Running the scriptForPI will result in one or more calibrated measurement sets (MSs) ready for imaging. You can use the uid_*.ms directly, keeping in mind that the calibrated data is stored in the CORRECTED data column, and all sources (including calibrators) are in the MS. If you want to run the imaging pipeline, you should run it from this point, without changing the uid_*.ms.
(Notes: [i] the ALMA archive may prepend the script name with the MOUS UID as in member.uid___Axxx_Xxxx_Xxxx.scriptForPI.py . You will need to use the prepended name in those cases. [ii] For some versions, CASA is released without pipeline. If your CASA version is not one with the ALMA pipeline included, the "--pipeline" switch is not available. Check in the "script" directory of your delivery package to see if it contains a file named "PPR*.xml". If there is no such file, you will be able to run the calibration without the pipeline.)
The script directory may also include a scriptForImaging.py. If the data were imaged by the pipeline, this contains only a comment line stating that the images and cubes were made by the pipeline. If the data was imaged by the pipeline, but supplemental imaging was needed, a manual_imaging.tgz will contain the imaging scripts. If manual imaging was performed, the scriptForImaging.py contains commands that can be used to recreate the image products from the calibrated MS. The "scriptForImaging.py" may partially be interactive (for masking) and should be executed by copy and paste.
Images made by the pipeline can be reproduced by running the casa_pipescript, which will reprocess the MS from the beginning, including both calibration and imaging. A simple way to do this is to move the casa_piperestorescript.py out of the script directory and then run scriptForPI. Alternatively, the calibrated measurement set produced above can be used as the basis for running only the imaging tasks in the pipeline. See the ALMA Imaging Pipeline Reprocessing CASA Guide for details.
1) If you want to force scriptForPI.py to split out the science SPWs, you need to edit or create the file *scriptForImagingPrep.py (the ALMA archive might have prepended the name by the MOUS UID) and put at least one line into it that does _not_ contain a "#" (the Python comment character). The scriptForPI will then regard this as a non-trivial imaging script and proceed with the splitting.
2) The scriptForPI will usually run the casa_piperestorescript, which applies the calibration tables to the
raw MS, restoring a calibrated MS. If this is not available (as can be the case for pipeline-calibrated TP datasets, or manually-calibrated datasets), the scriptForPI will instead run the entire calibration pipeline on the raw measurement set using the "casa_pipescript". You can force the execution of the casa_pipescript instead of the casa_piperestorescript by moving the casa_piperestorescript.py out of the script directory. Rerunning the pipeline can be useful if you want to tweak its parameters. Otherwise the restore is faster.
3) The scriptForPI offers some global variables for your convenience. You can find an explanation in this Knowledgbase Article: What global variables are available in scriptForPI.py?