Skip to main content

Radio astronomy image post-processing tools

Project description

spimple

Spectral index fitting made simple. This module provides three executables:

  • spimple-spifit
  • spimple-imconv
  • spimple-binterp

Spectral index fitting

The spimple-spifit executable fits a spectral index model to an image cube. The convolution to a common resolution and primary beam correction can optionally be performed on the fly. Usage is as follows:

usage: spimple-spifit [-h] [-model MODEL] [-residual RESIDUAL] -o OUTPUT_FILENAME [-pp PSF_PARS [PSF_PARS ...]] [-cp [CIRC_PSF]] [-th THRESHOLD] [-maxDR MAXDR] [-nthreads NTHREADS] [-pb-min PB_MIN]
                      [-products PRODUCTS] [-pf PADDING_FRAC] [-dc [DONT_CONVOLVE]] [-cw CHANNEL_WEIGHTS [CHANNEL_WEIGHTS ...]] [-rf REF_FREQ] [-otype OUT_DTYPE] [-acr [ADD_CONVOLVED_RESIDUALS]]
                      [-ms MS [MS ...]] [-f FIELD] [-bm BEAM_MODEL] [-st SPARSIFY_TIME] [-ct CORR_TYPE] [-band BAND]

Simple spectral index fitting tool.

optional arguments:
  -h, --help            show this help message and exit
  -model MODEL, --model MODEL
  -residual RESIDUAL, --residual RESIDUAL
  -o OUTPUT_FILENAME, --output-filename OUTPUT_FILENAME
                        Path to output directory + prefix.
  -pp PSF_PARS [PSF_PARS ...], --psf-pars PSF_PARS [PSF_PARS ...]
                        Beam parameters matching FWHM of restoring beam specified as emaj emin pa.
                        By default these are taken from the fits header of the residual image.
  -cp [CIRC_PSF], --circ-psf [CIRC_PSF]
                        Passing this flag will convolve with a circularised beam instead of an elliptical one
  -th THRESHOLD, --threshold THRESHOLD
                        Multiple of the rms in the residual to threshold on.
                        Only components above threshold*rms will be fit.
  -maxDR MAXDR, --maxDR MAXDR
                        Maximum dynamic range used to determine the threshold above which components need to be fit.
                        Only used if residual is not passed in.
  -nthreads NTHREADS, --nthreads NTHREADS
                        Number of threads to use.
                        Default of zero means use all threads
  -pb-min PB_MIN, --pb-min PB_MIN
                        Set image to zero where pb falls below this value
  -products PRODUCTS, --products PRODUCTS
                        Outputs to write. Letter correspond to:
                        a - alpha map
                        e - alpha error map
                        i - I0 map
                        k - I0 error map
                        I - reconstructed cube form alpha and I0
                        c - restoring beam used for convolution
                        m - convolved model
                        r - convolved residual
                        b - average power beam
                        Default is to write all of them
  -pf PADDING_FRAC, --padding-frac PADDING_FRAC
                        Padding factor for FFT's.
  -dc [DONT_CONVOLVE], --dont-convolve [DONT_CONVOLVE]
                        Passing this flag bypasses the convolution by the clean beam
  -cw CHANNEL_WEIGHTS [CHANNEL_WEIGHTS ...], --channel_weights CHANNEL_WEIGHTS [CHANNEL_WEIGHTS ...]
                        Per-channel weights to use during fit to frequency axis.
                         Only has an effect if no residual is passed in (for now).
  -rf REF_FREQ, --ref-freq REF_FREQ
                        Reference frequency where the I0 map is sought.
                        Will overwrite in fits headers of output.
  -otype OUT_DTYPE, --out_dtype OUT_DTYPE
                        Data type of output. Default is single precision
  -acr [ADD_CONVOLVED_RESIDUALS], --add-convolved-residuals [ADD_CONVOLVED_RESIDUALS]
                        Flag to add in the convolved residuals before fitting components
  -ms MS [MS ...], --ms MS [MS ...]
                        Mesurement sets used to make the image.
                        Used to get paralactic angles if doing primary beam correction
  -f FIELD, --field FIELD
                        Field ID
  -bm BEAM_MODEL, --beam-model BEAM_MODEL
                        Fits beam model to use.
                        It is assumed that the pattern is path_to_beam/name_corr_re/im.fits.
                        Provide only the path up to name e.g. /home/user/beams/meerkat_lband.
                        Patterns mathing corr are determined automatically.
                        Only real and imaginary beam models currently supported.
  -st SPARSIFY_TIME, --sparsify-time SPARSIFY_TIME
                        Used to select a subset of time
  -ct CORR_TYPE, --corr-type CORR_TYPE
                        Correlation typ i.e. linear or circular.
  -band BAND, --band BAND
                        Band to use with JimBeam. L or UHF

Image convolutions and primary beam correction

The spimple-imconv executable convolves images to a common resolution and optionally performs a primary beam correction. Usage is as follows:

usage: spimple-imconv [-h] -image IMAGE -o OUTPUT_FILENAME [-pp PSF_PARS [PSF_PARS ...]] [-nthreads NTHREADS] [-cp]
                      [-dilate DILATE] [-bm BEAM_MODEL] [-band BAND] [-pb-min PB_MIN] [-pf PADDING_FRAC]
                      [-otype OUT_DTYPE]

Convolve images to a common resolution.

optional arguments:
  -h, --help            show this help message and exit
  -image IMAGE, --image IMAGE
  -o OUTPUT_FILENAME, --output-filename OUTPUT_FILENAME
                        Path to output directory.
  -pp PSF_PARS [PSF_PARS ...], --psf-pars PSF_PARS [PSF_PARS ...]
                        Beam parameters matching FWHM of restoring beam specified as emaj emin pa.
                        By default these are taken from the fits header of the image.
  -nthreads NTHREADS, --nthreads NTHREADS
                        Number of threads to use.
                        Default of zero means use all threads
  -cp, --circ-psf       Passing this flag will convolve with a circularised beam instead of an elliptical one
  -dilate DILATE, --dilate DILATE
                        Dilate the psf-pars in fits header by this amount.This is sometimes required for stability.
  -bm BEAM_MODEL, --beam-model BEAM_MODEL
                        Fits beam model to use.
                        Use power_beam_maker to make power beam corresponding to image.
  -band BAND, --band BAND
                        Band to use with JimBeam. L or UHF
  -pb-min PB_MIN, --pb-min PB_MIN
                        Set image to zero where pb falls below this value
  -pf PADDING_FRAC, --padding-frac PADDING_FRAC
                        Padding fraction for FFTs (half on either side)
  -otype OUT_DTYPE, --out_dtype OUT_DTYPE
                        Data type of output. Default is single precision

Power beam interpolation

The spimple-binterp executable allows primary beam interpolation and conversion to a power beam. Usage is as follows:

usage: spimple-binterp [-h] -image IMAGE [-ms MS [MS ...]] [-f FIELD] -o OUTPUT_FILENAME [-bm BEAM_MODEL] [-st SPARSIFY_TIME] [-nthreads NTHREADS] [-ct CORR_TYPE]

Beam intrepolation tool.

optional arguments:
  -h, --help            show this help message and exit
  -image IMAGE, --image IMAGE
  -ms MS [MS ...], --ms MS [MS ...]
                        Mesurement sets used to make the image.
                        Used to get paralactic angles if doing primary beam correction
  -f FIELD, --field FIELD
                        Field ID
  -o OUTPUT_FILENAME, --output-filename OUTPUT_FILENAME
                        Path to output directory.
  -bm BEAM_MODEL, --beam-model BEAM_MODEL
                        Fits beam model to use.
                        It is assumed that the pattern is path_to_beam/name_corr_re/im.fits.
                        Provide only the path up to name e.g. /home/user/beams/meerkat_lband.
                        Patterns mathing corr are determined automatically.
                        Only real and imaginary beam models currently supported.
  -st SPARSIFY_TIME, --sparsify-time SPARSIFY_TIME
                        Used to select a subset of time
  -nthreads NTHREADS, --nthreads NTHREADS
                        Number of threads to use.
                        Default of zero means use all threads
  -ct CORR_TYPE, --corr-type CORR_TYPE
                        Correlation typ i.e. linear or circular.

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

spimple-0.0.3.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

spimple-0.0.3-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file spimple-0.0.3.tar.gz.

File metadata

  • Download URL: spimple-0.0.3.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for spimple-0.0.3.tar.gz
Algorithm Hash digest
SHA256 dea4f68c70521bcf2328ec389d241d6eca47824688d8d3897b17f15a44fd6e83
MD5 fbd17a7ea268325a0262611cbbc2f1a2
BLAKE2b-256 eb4a85b72e103ca0390c6a023e7a8ac8257d288592ac63087ea66f3e900feebc

See more details on using hashes here.

File details

Details for the file spimple-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: spimple-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for spimple-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e39a0b04bf38e08cb60ed9287fd0a34cb6ad8cd670f33a373dcd276258c37f26
MD5 9dd675bc36d665d76ef8788cfff67a4e
BLAKE2b-256 64b5660323f76c163ff6021a7fe1887f667d673e6bce1aca3c355e7f24872f1a

See more details on using hashes here.

Supported by

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