Mosaicking

extract_2d_slice_from_3d_cube

This script extracts a 2D section from a 3D FITS image. It allows specifying the axis to collapse and the interval (pixel range) along that axis.

(venv_numina) $ numina-extract_2d_slice_from_3d_cube --help
Usage: numina-extract_2d_slice_from_3d_cube [-h] [--axis AXIS] [--i1 I1]
                                            [--i2 I2]
                                            [--method {sum,mean,median}]
                                            [--wavecal {none,fridasimulator,1,2,3}]
                                            [--transpose] [--noplot]
                                            [--vmin VMIN] [--vmax VMAX]
                                            [--output OUTPUT] [--echo]
                                            [--debug]
                                            input

Extract 2D slice from 3D cube

Positional Arguments:
  input                 Input FITS file

Options:
  -h, --help            show this help message and exit
  --axis AXIS           Axis to be collapsed in output
  --i1 I1               First pixel of the projected axis
  --i2 I2               Last pixel of the projected axis (0=NAXIS value)
  --method {sum,mean,median}
                        Collapse method (default=sum)
  --wavecal {none,fridasimulator,1,2,3}
                        Wavelength calibration type
  --transpose           Transpose data array in output
  --noplot              Do not plot result
  --vmin VMIN           vmin value for imshow
  --vmax VMAX           vmax value for imshow
  --output OUTPUT       Output FITS file
  --echo                Display full command line
  --debug               Debug

generate_mosaic_of_2d_images

This script generates a mosaic of 2D images from a list of 2D FITS files.

(venv_numina) $ numina-generate_mosaic_of_2d_images --help
Usage: numina-generate_mosaic_of_2d_images [-h]
                                           [--reproject_method {interp,adaptive,exact}]
                                           [--extname_image EXTNAME_IMAGE]
                                           [--extname_mask EXTNAME_MASK]
                                           [--combination_function {mean,median,sum,std,sigmaclip_mean,sigmaclip_median,sigmaclip_stddev}]
                                           [--output_3D_stack OUTPUT_3D_STACK]
                                           [--verbose] [--echo]
                                           input_list output_filename

Generate mosaic of 2D images

Positional Arguments:
  input_list            TXT file with list of 2D images to be combined
  output_filename       filename of output FITS image

Options:
  -h, --help            show this help message and exit
  --reproject_method {interp,adaptive,exact}
                        Reprojection method (interp, adaptive, exact)
  --extname_image EXTNAME_IMAGE
                        Extension name for image in input files. Default
                        value: PRIMARY
  --extname_mask EXTNAME_MASK
                        Extension name for mask in input files. Default
                        'None': use np.nan in image
  --combination_function {mean,median,sum,std,sigmaclip_mean,sigmaclip_median,sigmaclip_stddev}
                        Combination function. Default: mean
  --output_3D_stack OUTPUT_3D_STACK
                        filename for stacked 3D array. Default None
  --verbose             Display intermediate information
  --echo                Display full command line

generate_mosaic_of_3d_cubes

This script generates a mosaic of 3D data cubes from a list of 3D FITS files.

  • It is possible to use arguments to fix the desired outupt celestial 2D WCS, as well as the output CRVAL3 and CDELT3 parameters that define the output linear wavelength sampling.

  • If the input is a single 3D FITS cube, the code can be used to resample the initial cube with different values of CRVAL3 and CDELT3. In that case, it is recommended to use interp as the reprojection method to avoid the default Gaussian kernel used when the reprojection method is adaptive).

(venv_numina) $ numina-generate_mosaic_of_3d_cubes --help
Usage: numina-generate_mosaic_of_3d_cubes [-h] [--crval3out CRVAL3OUT]
                                          [--cdelt3out CDELT3OUT]
                                          [--naxis3out NAXIS3OUT]
                                          [--desired_celestial_2d_wcs DESIRED_CELESTIAL_2D_WCS]
                                          [--reproject_method {interp,adaptive,exact}]
                                          [--parallel]
                                          [--extname_image EXTNAME_IMAGE]
                                          [--output_celestial_2d_wcs OUTPUT_CELESTIAL_2D_WCS]
                                          [--footprint] [--verbose] [--echo]
                                          input_list output_filename

Generate a 3D mosaic from individual 3D cubes

Positional Arguments:
  input_list            TXT file with list of 3D images to be combined or
                        single FITS file
  output_filename       filename of output FITS image

Options:
  -h, --help            show this help message and exit
  --crval3out CRVAL3OUT
                        Minimum wavelength (in m) for the output image
  --cdelt3out CDELT3OUT
                        Wavelength step (in m/pixel) for the output image
  --naxis3out NAXIS3OUT
                        Number of slices in the output image
  --desired_celestial_2d_wcs DESIRED_CELESTIAL_2D_WCS
                        Desired 2D celestial WCS projection. Default None
                        (compute for current 3D cube combination)
  --reproject_method {interp,adaptive,exact}
                        Reprojection method (interp, adaptive, exact)
  --parallel            Use parallel processing for reprojection
  --extname_image EXTNAME_IMAGE
                        Extension name for image in input files. Default
                        value: PRIMARY
  --output_celestial_2d_wcs OUTPUT_CELESTIAL_2D_WCS
                        filename for output 2D celestial WCS
  --footprint           Generate a FOOTPRINT extension with the final
                        footprint
  --verbose             Display intermediate information
  --echo                Display full command line