Skip to main content

Useful scripts for RACS.

Project description

RACS-tools

Useful scripts for RACS

Installation

First, numpy and a fortran compiler are required before running pip install.

conda install numpy
# or
pip install numpy

Use the package manager pip to install RACS-tools.

pip install RACS-tools

Usage

$ beamcon_2D -h
usage: beamcon_2D [-h] [-p PREFIX] [-s SUFFIX] [-o OUTDIR]
                  [--conv_mode {robust,scipy,astropy,astropy_fft}] [-v] [-d]
                  [--bmaj BMAJ] [--bmin BMIN] [--bpa BPA] [--log LOG]
                  [--logfile LOGFILE] [-c CUTOFF] [--circularise]
                  [-t TOLERANCE] [-e EPSILON] [-n NSAMPS]
                  [--ncores N_CORES | --mpi]
                  infile [infile ...]

    Smooth a field of 2D images to a common resolution.

    Names of output files are 'infile'.sm.fits



positional arguments:
  infile                Input FITS image(s) to smooth (can be a wildcard) - beam info must be in header.

optional arguments:
  -h, --help            show this help message and exit
  -p PREFIX, --prefix PREFIX
                        Add prefix to output filenames.
  -s SUFFIX, --suffix SUFFIX
                        Add suffix to output filenames [...sm.fits].
  -o OUTDIR, --outdir OUTDIR
                        Output directory of smoothed FITS image(s) [same as input file].
  --conv_mode {robust,scipy,astropy,astropy_fft}
                        Which method to use for convolution [robust].
                                'robust' uses the built-in, FFT-based method.
                                Note that other methods cannot cope well with small convolving beams.

  -v, --verbosity       Increase output verbosity
  -d, --dryrun          Compute common beam and stop [False].
  --bmaj BMAJ           Target BMAJ (arcsec) to convolve to [None].
  --bmin BMIN           Target BMIN (arcsec) to convolve to [None].
  --bpa BPA             Target BPA (deg) to convolve to [None].
  --log LOG             Name of beamlog file. If provided, save beamlog data to a file [None - not saved].
  --logfile LOGFILE     Save logging output to file
  -c CUTOFF, --cutoff CUTOFF
                        Cutoff BMAJ value (arcsec) -- Blank channels with BMAJ larger than this [None -- no limit]
  --circularise         Circularise the final PSF -- Sets the BMIN = BMAJ, and BPA=0.
  -t TOLERANCE, --tolerance TOLERANCE
                        tolerance for radio_beam.commonbeam.
  -e EPSILON, --epsilon EPSILON
                        epsilon for radio_beam.commonbeam.
  -n NSAMPS, --nsamps NSAMPS
                        nsamps for radio_beam.commonbeam.
  --ncores N_CORES      Number of processes (uses multiprocessing).
  --mpi                 Run with MPI.
$ beamcon_3D -h
usage: beamcon_3D [-h] [--uselogs] [--mode MODE] [--conv_mode CONV_MODE] [-v]
                  [--logfile LOGFILE] [-d] [-p PREFIX] [-s SUFFIX] [-o OUTDIR]
                  [--bmaj BMAJ] [--bmin BMIN] [--bpa BPA] [-c CUTOFF]
                  [--circularise] [-t TOLERANCE] [-e EPSILON] [-n NSAMPS]
                  infile [infile ...]

    Smooth a field of 3D cubes to a common resolution.

    Names of output files are 'infile'.sm.fits



positional arguments:
  infile                Input FITS image(s) to smooth (can be a wildcard) 
                                - beam info must be in co-located beamlog files.


optional arguments:
  -h, --help            show this help message and exit
  --uselogs             Get convolving information from previous run [False].
  --mode MODE           Common resolution mode [natural]. 
                                natural  -- allow frequency variation.
                                total -- smooth all plans to a common resolution.

  --conv_mode CONV_MODE
                        Which method to use for convolution [robust].
                                'robust' computes the analytic FT of the convolving Gaussian.
                                Can also be 'scipy', 'astropy', or 'astropy_fft'.
                                Note these other methods cannot cope well with small convolving beams.

  -v, --verbosity       Increase output verbosity
  --logfile LOGFILE     Save logging output to file
  -d, --dryrun          Compute common beam and stop [False].
  -p PREFIX, --prefix PREFIX
                        Add prefix to output filenames.
  -s SUFFIX, --suffix SUFFIX
                        Add suffix to output filenames [...{mode}.fits].
  -o OUTDIR, --outdir OUTDIR
                        Output directory of smoothed FITS image(s) [None - same as input].
  --bmaj BMAJ           BMAJ to convolve to [max BMAJ from given image(s)].
  --bmin BMIN           BMIN to convolve to [max BMAJ from given image(s)].
  --bpa BPA             BPA to convolve to [0].
  -c CUTOFF, --cutoff CUTOFF
                        Cutoff BMAJ value (arcsec) -- Blank channels with BMAJ larger than this [None -- no limit]
  --circularise         Circularise the final PSF -- Sets the BMIN = BMAJ, and BPA=0.
  -t TOLERANCE, --tolerance TOLERANCE
                        tolerance for radio_beam.commonbeam.
  -e EPSILON, --epsilon EPSILON
                        epsilon for radio_beam.commonbeam.
  -n NSAMPS, --nsamps NSAMPS
                        nsamps for radio_beam.commonbeam.

If finding a common beam fails, try tweaking the tolerance, epsilon, and nsamps parameters. See radio-beam for more details.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

BSD-3-Clause

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

RACS-tools-1.2.0.tar.gz (25.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

RACS_tools-1.2.0-cp39-cp39-macosx_10_9_x86_64.whl (43.6 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

File details

Details for the file RACS-tools-1.2.0.tar.gz.

File metadata

  • Download URL: RACS-tools-1.2.0.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.1

File hashes

Hashes for RACS-tools-1.2.0.tar.gz
Algorithm Hash digest
SHA256 475874cd4ec0cfae1aabb0eef1dc411ce2188f8182d2943cf260264b75628d74
MD5 bf25131a99d458fb3f4d1828466e53d6
BLAKE2b-256 00a891ff09220be216d284cb0cd0a9c71e514271feb42e9d43be72f188b8d8eb

See more details on using hashes here.

File details

Details for the file RACS_tools-1.2.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: RACS_tools-1.2.0-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 43.6 kB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.1

File hashes

Hashes for RACS_tools-1.2.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fa6762fe908d02230165e23c308d350474e70926bffc233a39dd32dd8ce3bf74
MD5 40eab2d25388039c5f2b48fcab748c94
BLAKE2b-256 afeac39932270a853db7aa02f21418de2644a64fd1b7e1f840281e3204074d51

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page