At the moment, GALARIO sampleImage takes in input a matrix with x, y pixel axes having the origin in the top left corner and increasing towards the bottom and the right, respectively. The pixel indices start from 0. In the FT interpolation code, the v axis (and thus the Declination) is assumed coaxial with the y axis and everything is self-consistent.
FITS files, however, assume the origin in the bottom left corner (and count the pixels starting from 1).
This implies that to use a FITS image as an input to sampleImage one needs to do a manual flip up-down and also check that the center of the flipped image is in the cell (Nxy/2, Nxy/2) where Nxy is the number of pixels (starting from 0) (of the matrix, assumed square for simplicity).
There is an easy solution to avoid the flipping in the image taken from a FITS file, and can be implemented as an option (e.g. called origin) to the sampleImage function. Ideally, also to the other functions.
E.g.:
At the moment, GALARIO
sampleImage
takes in input a matrix with x, y pixel axes having the origin in the top left corner and increasing towards the bottom and the right, respectively. The pixel indices start from 0. In the FT interpolation code, the v axis (and thus the Declination) is assumed coaxial with the y axis and everything is self-consistent. FITS files, however, assume the origin in the bottom left corner (and count the pixels starting from 1). This implies that to use a FITS image as an input tosampleImage
one needs to do a manual flip up-down and also check that the center of the flipped image is in the cell (Nxy/2, Nxy/2) where Nxy is the number of pixels (starting from 0) (of the matrix, assumed square for simplicity).There is an easy solution to avoid the flipping in the image taken from a FITS file, and can be implemented as an option (e.g. called
origin
) to thesampleImage
function. Ideally, also to the other functions. E.g.:The solution consists in changing the direction of the interpolating v axis:
This works perfectly and is easy to implement at C level.