Miscellaneous 3D data scripts

measure_slice_xy_offsets_in_3d_cube

This script calculates the spatial offset in the sky plane between a particular spatial slice and all the spatial slices of a given 3D cube. It does so using a cross-correlation method.

(venv_numina) $ numina-measure_slice_xy_offsets_in_3d_cube --help
Usage: numina-measure_slice_xy_offsets_in_3d_cube [-h] [--extname EXTNAME]
                                                  [--polydeg POLYDEG]
                                                  [--times_sigma_reject TIMES_SIGMA_REJECT]
                                                  [--islice_reference ISLICE_REFERENCE]
                                                  [--iterate] [--method {1,2}]
                                                  [--plots] [--verbose]
                                                  [--echo]
                                                  filename npoints

Determine (X,Y) offsets between slices along NAXIS3

Positional Arguments:
  filename              Input 3D FITS file
  npoints               Number of points along NAXIS3

Options:
  -h, --help            show this help message and exit
  --extname EXTNAME     Output extension name to store result (default None)
  --polydeg POLYDEG     Polynomial degree to fit distortion
  --times_sigma_reject TIMES_SIGMA_REJECT
                        Times sigma to reject fitted offsets (default 3.0)
  --islice_reference ISLICE_REFERENCE
                        Initial pixel corresponding to the reference slice
                        (from 1 to NAXIS3)
  --iterate             Force one iteration
  --method {1,2}        Method (1: skimage, 2: scipy)
  --plots               Plot intermediate results
  --verbose             Display intermediate information
  --echo                Display full command line

resample_wave_3d_cube

This script resamples a 3D data cube by specifying the output values for CRVAL3, CDELT3 and NAXIS3. The celestial WCS is preserved, and the spectral WCS is modified in order to make use of the new wavelength sampling. This code does not use the functionality of the reproject package and instead performs a simple linear redistribution of the signal in the newly sampled wavelength grid. In this sense, it produces the same result as the numina-generate_mosaic_of_3d_images script when employed with a single input 3D FITS file and the reprojection method is interp.

(venv_numina) $ numina-resample_wave_3d_cube --help
Usage: numina-resample_wave_3d_cube [-h] [--crval3out CRVAL3OUT]
                                    [--cdelt3out CDELT3OUT]
                                    [--naxis3out NAXIS3OUT]
                                    [--extname EXTNAME] [--verbose] [--echo]
                                    input_file output_file

Resample a 3D cube in the wavelength axis (NAXIS3).

Positional Arguments:
  input_file            Input FITS file with the 3D cube.
  output_file           Output FITS file with the resampled 3D cube.

Options:
  -h, --help            show this help message and exit
  --crval3out CRVAL3OUT
                        Minimum wavelength for the output image (in meters).
  --cdelt3out CDELT3OUT
                        Wavelength step for the output image (in meters).
  --naxis3out NAXIS3OUT
                        Number of slices in the output image.
  --extname EXTNAME     Extension name of the input HDU (default: 'PRIMARY').
  --verbose             Display intermediate information
  --echo                Display full command line