survey_to_casda

This writes the input parset for the casdaupload script.

See https://www.atnf.csiro.au/computing/software/askapsoft/sdp/docs/current/utils/casdaupload.html


Module Contents

Classes

Options

Functions

update_FITS_header(options)

fits_header_check(file_name)

update_FITS_headers(files, row, history)

arg_init()

t_string(db_time)

my_grep(file_name, txt)

get_input(file_name, key)

find_parset(root, row)

get_history(parfile)

check_files_exist(files)

pack_flag_cal(root, row)

BPCAL/calparameters_1934_bp_SB{cal_sbid}.tab/

main()

Attributes

NOFORMAT

explanation

casda_production

casda_test

got_leakage

general

image

catalogue

im_art

ca_art

ms_art

ev_art

ke_fil

ke_typ

ke_pro

ke_fmt

ke_art

# The following uses an original code by Matthew Whiting <Matthew.Whiting@csiro.au>

required_fits_keys

survey_to_casda.NOFORMAT = '{noformat}\n'[source]
survey_to_casda.explanation[source]
survey_to_casda.casda_production = '/group/casda/prd/'[source]
survey_to_casda.casda_test = '/group/casda/at'[source]
survey_to_casda.got_leakage = False[source]
survey_to_casda.general = Multiline-String[source]
Show Value
"""# General
outputdir                       = "{}"
useAbsolutePaths                = true
telescope                       = ASKAP
sbid                            = {:d}
# No other sbids provided.
obsprogram                      = RACS
writeREADYfile                  = true

"""
survey_to_casda.image[source]
survey_to_casda.catalogue[source]
survey_to_casda.im_art = Multiline-String[source]
Show Value
"""
# Images
images.artifactlist             = {}"""
survey_to_casda.ca_art = Multiline-String[source]
Show Value
"""
# Source catalogues
catalogues.artifactlist             = {}"""
survey_to_casda.ms_art = Multiline-String[source]
Show Value
"""
# Measurement sets
measurementsets.artifactlist             = {}"""
survey_to_casda.ev_art = Multiline-String[source]
Show Value
"""
# Evaluation reports
evaluation.artifactlist             = {}"""
survey_to_casda.ke_fil[source]
survey_to_casda.ke_typ[source]
survey_to_casda.ke_pro[source]
survey_to_casda.ke_fmt[source]
survey_to_casda.ke_art[source]

# The following uses an original code by Matthew Whiting <Matthew.Whiting@csiro.au> # As described below. Here the essentials are extracted as a subroutine to be called by the main racs_to_casda # # A python script to update the header keywords of FITS files. The # headers able to be updated are a small defined set: PROJECT, SBID, # DATE-OBS, DURATION. # # It also allows the specification of HISTORY statments, by giving a # list of strings following the arguments for the above # # Example Usage: # updateFITSheaders.py –project=AS034 –SBID=1234 –DATE-OBS=”2017-01-20T12:34:45” –DURATION=12345.6 “Made by me” “Not by you” # # # @copyright (c) 2017 CSIRO # Australia Telescope National Facility (ATNF) # Commonwealth Scientific and Industrial Research Organisation (CSIRO) # PO Box 76, Epping NSW 1710, Australia # atnf-enquiries@csiro.au # # This file is part of the ASKAP software distribution. # # The ASKAP software distribution is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the License, # or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # @author Matthew Whiting <Matthew.Whiting@csiro.au> #

import argparse import astropy.io.fits as fits

parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument(’–fitsfile’, type=str, help=’FITS file to update’) parser.add_argument(’–telescope’, type=str, default=””, help=’TELESCOP keyword’) parser.add_argument(’–project’, type=str, default=””, help=’OPAL project ID for this observation’) parser.add_argument(’–sbid’, type=str, default=””, help=’Scheduling block ID for this observation’) parser.add_argument(’–dateobs’, type=str, default=””, help=’DATE-OBS string (YYYY-MM-DDTHH:MM:SS) for this observation’) parser.add_argument(’–duration’, type=str, default=””, help=’Length of this observation in sec’) parser.add_argument(‘history’, metavar=’hist’, type=str, default=””, nargs=’*’, help=’A HISTORY statement’) options = parser.parse_args()

survey_to_casda.required_fits_keys = ['NAXIS{:d}', 'CTYPE{:d}', 'CRVAL{:d}', 'CDELT{:d}', 'CRPIX{:d}'][source]
survey_to_casda.update_FITS_header(options)[source]
survey_to_casda.fits_header_check(file_name)[source]
class survey_to_casda.Options(fitsfile, sbid, dateobs, duration, telescope='ASKAP', project='AS110')[source]

Bases: object

survey_to_casda.update_FITS_headers(files, row, history)[source]
survey_to_casda.arg_init()[source]
survey_to_casda.t_string(db_time)[source]
survey_to_casda.my_grep(file_name, txt)[source]
survey_to_casda.get_input(file_name, key)[source]
survey_to_casda.find_parset(root, row)[source]
survey_to_casda.get_history(parfile)[source]
survey_to_casda.check_files_exist(files)[source]
survey_to_casda.pack_flag_cal(root, row)[source]

BPCAL/calparameters_1934_bp_SB{cal_sbid}.tab/ {fld}/cont_gains_cal_SB{sbid}_{fld}.beam??.tab/ diagnostics/Flagging_Summaries/scienceData_SB{sbid}_{fld}.beam??_averaged.ms.flagSummary

survey_to_casda.main()[source]