## table of contents

FITRANS(1) | User Commands | FITRANS(1) |

# NAME¶

fitrans - performing spatial transformations on the input image

# SYNOPSIS¶

**fitrans** [*transformation and options*]
*<input> *[*-o|--output <output>*]

# DESCRIPTION¶

The main purpose of this program is to perform specific or generic geometric transformations on the input image.

# OPTIONS¶

## General options:¶

**-h**,**--help**- Gives general summary about the command line options.
**--long-help**,**--help-long**- Gives a detailed list of command line options.
**--wiki-help**,**--help-wiki**,**--mediawiki-help**,**--help-mediawiki**- Gives a detailed list of command line options in Mediawiki format.
**--version**,**--version-short**,**--short-version**- Gives some version information about the program.
**-i**,**--input**<image file>- Name of the input FITS image file.
**-o**,**--output**<image file>- Name of the output FITS image file.
**-b**,**--bitpix**<bitpix>- Standard FITS output bitpix value.
**-D**,**--data**<spec>- Output pixel data format specification.

## Spatial transformations:¶

**-T**,**--input-transformation**<transformation file>- Name of the file which contains the transformation description.Such a file
can be created e.g. by the programs `grtrans` or `grmatch`. This file
contains basically the same set of <keyword> = <value> pairs
as it is used after the
**-t**|--transformation option (see there). **-t**,**--transformation**<transformation>- Comma-separated list of parameters for the spatial transformation, see section "Parameters for spatial transformations" below.
**-e**,**--shift**<dx>,<dy>- Imply a transformation that shifts the image by <dx>,<dy>.
**--reverse**,**--inverse**- Apply the inverse transformation to the image rather than the original one.
**-m**- Simple linear interpolation between pixels, with no exact flux conservation (just a multiplication by the Jacobian of the transformation).
**-l**- Linear interpolation between the pixels involving exact flux conservation by integrating on the image surface.
**-c**- Bicubic spline interpolation between pixels, with no exact flux conservation (just a multiplication by the Jacobian of the transformation).
**-k**- Interpolation by integrationg the flux on a biquadratic interpolation surface, yielding exact flux conservation.
**-s**,**--size**<sx>,<sy>- The size of the output image if it should differ from the original image size.
**-f**,**--offset**<x>,<y>- Zero-point coordinate of the output image in the input image.

## Parameters for spatial transformations:¶

- type=<type>
- Type of the transformation. In the actual implementation, the only supported type for a transformation is "polynomial".
- order=<order>
- Polynomial order for the transformation.
- dxfit=<coefficients>
- Comma-separated list of the polynomial coefficients for the X coordinate. The number of coefficients must be 1, 3, 6, ... for the orders 0, 1, 2, ... respectively.
- dyfit=<coefficients>
- Comma-separated list of the polynomial coefficients for the Y coordinate.

## Other simple spatial geometric transformations:¶

**-z**,**--zoom**<factor>,**--zoom-xy**<x>,<y>- Zoom the image by the given (integer) factor, involving a biquadratic subpixel-level interpolation and therefore exact flux conservation.
**-r**,**--shrink**<factor>,**--shrink-xy**<x>,<y>- Shrink the image by the given (integer) factor(s).
**-d**,**--median**- Use a median-based averaging during the shrinking operation.
**-v**,**--truncated-mean**<Nr>- Compute a truncated mean during the shrinking operation by rejecting the <Nr> number of lower and upper points.
**--optimistic-masking**- Imply some optimism during the shrinking operation: masked pixels are ignored during the averaging process and the final mask will be computed in a complement manner.
**-g**,**--magnify**<factor>,**--magnify-xy**<x>,<y>- Same as zooming the image but there is no subpixel-level interpolation.

## Large-scale image smoothing:¶

**-a**,**--smooth**<parameters>- Perform a smoothing on the image. The parameters of the smoothing are the following:
- spline
- Do a spline interpolation smoothing
- polynomial
- Do a polynomial interpolation smoothing
- [xy]order=<order>
- Spatial order of the smoothing function. The order in the X and Y coordinates can be set independently, by setting "xorder=..." or "yorder=...".
- unity
- Scale the resulting smoothed image to have a mean of 1.
- detrend
- The resulting image will be the original image divided by the best fit smoothed surface.
- [xy]hsize=<halfsize>
- Do a box filtering with the given halfsize.
- mean
- Use the mean value of the pixels for the box filtering.
- median
- Use the median value of the pixels for the box filtering.
- iterations=<iterations>
- Number of iterations to reject outlier pixels from the box.
- lower, upper, sigma=<sigma>
- Lower, upper or symmetric rejection level in the units of standard deviation.

## Noise estimation:¶

**-n**,**--noise**- Derive an image which reflects the "noise level" of the image.

## Slicing or exploding data cube images:¶

**-y**,**--layer**<layer>- Layer (z-axis index) of the desired image slice.
**-x**,**--explode**<basename>- Explode the input image into individual planar (two dimensional) FITS image. The basename must contain at least one printf-like tag of %d, %i, %o, %x or %X that is replaced by the appropriate layer number index.
**-y**,**--first-layer**<n>- Use the specified value for the first layer index. The subsequent layer indices are incremented normally. By default, the index of the first data cube layer is 0.

## Multiple stamp extraction:¶

**-c**,**--cut**<basename>- Extract stamps with a size defined by the
**-s**|--size argument. The stamps are extracted on a grid, defined by the**-p**|--step and**-w**|--count arguments where the stamp grid offset is defined by the**-f**|--offset argument. The <basename> should contain two spefic printf-like elements of %x and %y which are replaced by the corresponding stamp indices in the X and Y directions. In order to have some sort of pretty-printing in the file names, the %x and %y parts may have the form of %.<N>x and %.<N>y. Note that despite of the %x convention, both %x and %y are printed in decimal system. **-w**,**--count**<count_x>,<count_y>- Number of stamps to be extracted in X and Y directions, respectively.
**-s**,**--size**<sx>,<sy>- The size of the output image stamps.
**-p**,**--step**<step_x>,<step_y>- Step size between the stamps in the units of pixels and in the X and Y directions, respectively. Note that if <step_x> is smaller than <sx> (or similarly, if <step_y> is smaller than <sy>), then the output stamps will overlap. This might also be intentional for various applications.
**-f**,**--offset**<x>,<y>- Zero-point coordinate of the lower-left pixel of the lower-left output stamp (having an index of %x=0 and %y=0) in the frame of the input image.

# REPORTING BUGS¶

Report bugs to <apal@szofi.net>, see also https://fitsh.net/.

# COPYRIGHT¶

Copyright © 1996, 2002, 2004-2008, 2010-2016, 2018-2020; Pal, Andras <apal@szofi.net>

January 2021 | fitrans 0.9.4 (2021.01.24) |