casda_prepare

Prepare files for CASDA upload

Module Contents

Functions

cli()

Command line interface

convert_pdf(→ None)

Convert a PDF to a PNG

convert_spectra(→ str)

Convert a ascii spectrum to FITS

find_cubes(→ list)

Find Stokes I image cubelets in a directory

find_plots(→ list)

Find plots in a directory

find_spectra(→ list)

Find spectra in from cutouts directory

init_polspec(casda_dir, spectrum_table_0[, outdir])

main(polcatf[, data_dir, prep_type, do_update_cubes, ...])

Main function

make_thumbnail(cube_f, cube_dir)

update_cube(→ None)

Update cube headers and symlink to CASDA area

write_polspec(table, filename[, overwrite])

Write the polspectra to a FITS file.

Attributes

TQDM_OUT

casda_prepare.cli()[source]

Command line interface

casda_prepare.convert_pdf(pdf_file: str, plots_dir: str, spec_dir: str) None[source]

Convert a PDF to a PNG

Parameters:

pdf_file (str) – PDF file to convert

casda_prepare.convert_spectra(number: int, spectrum: str, fname_polcat_hash: str, spec_dir: str = '.') str[source]

Convert a ascii spectrum to FITS

Parameters:
  • spectrum (str) – Name of ASCII spectrum file

  • spec_dir (str, optional) – Directory to save FITS spectrum. Defaults to ‘.’.

casda_prepare.find_cubes(data_dir: str = '.') list[source]

Find Stokes I image cubelets in a directory

Parameters:

data_dir (str, optional) – Data containg cutouts directory. Defaults to “.”.

Returns:

List of cubelets

Return type:

list

casda_prepare.find_plots(data_dir: str = '.') list[source]

Find plots in a directory

Parameters:

data_dir (str, optional) – Data containg cutouts directory. Defaults to “.”.

Returns:

List of plots

Return type:

list

casda_prepare.find_spectra(data_dir: str = '.') list[source]

Find spectra in from cutouts directory

Parameters:

data_dir (str, optional) – Directory containing cutouts directory. Defaults to “.”.

Returns:

List of spectra in ascii format

Return type:

list

casda_prepare.init_polspec(casda_dir: str, spectrum_table_0: str, outdir: str = '')[source]
casda_prepare.main(polcatf: str, data_dir: str = '.', prep_type: str = 'test', do_update_cubes: bool = False, do_convert_spectra: bool = False, do_convert_plots: bool = False, verbose: bool = False, batch_size: int = 10, outdir=None)[source]

Main function

casda_prepare.make_thumbnail(cube_f: str, cube_dir: str)[source]
casda_prepare.update_cube(cube: str, cube_dir: str) None[source]

Update cube headers and symlink to CASDA area

Parameters:
  • cube (str) – Cubelet path

  • cube_dir (str) – CASDA cublet directory

casda_prepare.write_polspec(table: astropy.table.Table, filename: str, overwrite: bool = False)[source]

Write the polspectra to a FITS file. :Parameters: * table – astropy.table.Table

  • filename – str Name and relative path of the file to save to.

  • overwrite – bool [False] Overwrite the file if it already exists?

casda_prepare.TQDM_OUT[source]