We are now ready to start processing the downloaded images. The XDF datasets we are using here are already aligned to the same pixel grid. However, warping to a different/matched pixel grid is commonly needed before higher-level analysis when you are using datasets from different instruments. So let’s have a look at Gnuastro’s warping features here.
Gnuastro’s Warp program should be used for warping the pixel-grid (see Warp). For example, try rotating one of the images by 20 degrees:
$ astwarp flat-ir/xdf-f160w.fits --rotate=20
Open the output (xdf-f160w_rotated.fits) and see how it is rotated.
Warp can generally be used for many kinds of pixel grid manipulation (warping), not just rotations. for example, the outputs of the commands below will have larger pixels respectively (new resolution being one quarter the original resolution), get shifted by 2.8 (by sub-pixel), get a shear of 2, and be tilted (projected). Run each of them and open the output file to see the effect, they will become handy for you in the future.
$ astwarp flat-ir/xdf-f160w.fits --scale=0.25 $ astwarp flat-ir/xdf-f160w.fits --translate=2.8 $ astwarp flat-ir/xdf-f160w.fits --shear=0.2 $ astwarp flat-ir/xdf-f160w.fits --project=0.001,0.0005
If you need to do multiple warps, you can combine them in one call to Warp. for example, to first rotate the image, then scale it, run this command:
$ astwarp flat-ir/xdf-f160w.fits --rotate=20 --scale=0.25
If you have multiple warps, do them all in one command. Do Not warp them in separate commands because the correlated noise will become too strong. As you see in the matrix that is printed when you run Warp, it merges all the warps into a single warping matrix (see Merging multiple warpings) and simply applies that (mixes the pixel values) just once. However, if you run Warp multiple times, the pixels will be mixed multiple times, creating a strong artificial blur/smoothing, or stronger correlated noise.
Recall that the merging of multiple warps is done through matrix multiplication, therefore order matters in the separate operations. At a lower level, through Warp’s --matrix option, you can directly request your desired final warp and do not have to break it up into different warps like above (see Invoking Warp).
Fortunately these datasets are already aligned to the same pixel grid, so you do not actually need the files that were just generated.You can safely delete them all with the following command. Here, you see why we put the processed outputs that we need later into a separate directory. In this way, the top directory can be used for temporary files for testing that you can simply delete with a generic command like below.
$ rm *.fits