SpatialFrequencyLimits

class mpdaf.obj.SpatialFrequencyLimits(fmax, rot)[source]

Bases: object

Allow to keep track of the spatial frequency limits of an image.

Such that before resampling an image it can see if anything needs to be done to avoid undersampling and generating aliasing artefacts in the output image.

The band-limits are recorded as an ellipse. Most telescopes have circularly symmetric PSFs and thus circularly symmetric spatial-frequency band limits, but this spatial-frequency profile may become elliptical if an image is resampled to have a lower resolution along one axis.

The ellipse is defined in its own X,Y coordinate system as follows:

xe(t)=xs*cos(t)
ye(t)=ys*sin(t)

The ye axis of the ellipse is at self.rot degrees west of north in the image. For the Y axis of a coordinate system where Y is rot degrees west of north, the ellipse thus has to be rotated by psi = (rot - self.rot) degrees anticlockwise to calculate the X and Y values of the ellipse in that coordinate system:

|x(t)| = |cos(psi), -sin(psi)| |xe(t)|
|y(t)|   |sin(psi),  cos(psi)| |ye(t)|
Parameters
fmaxfloat, float

The frequency limits along the Y-axis and X-axis of an elliptically shaped band-limit (eg. cycles per degree).

rotfloat

The rotation angle of the Y axis of the ellipse westward of north (degrees). This is defined such that if image.wcs.get_rot() is passed to this function, the Y axis of the ellipse will be aligned with the Y axis of the image.

Methods Summary

deepcopy(self)

ellipse_locus(self, t, rot)

Return the Y,X coordinates of the band-limiting ellipse at ellipse phase t.

get_fmax(self, rot)

Return the spatial-frequency band-limits along a Y axis that is ‘rot’ degrees west of north, and an X axis that is 90 degrees away from this Y axis in the sense of a rotation from north to east.

Methods Documentation

deepcopy(self)[source]
ellipse_locus(self, t, rot)[source]

Return the Y,X coordinates of the band-limiting ellipse at ellipse phase t.

Parameters
tfloat

The elliptical phase at which the calculate the coordinates (radians).

rotfloat

The rotation angle of the Y axis of the ellipse west of north (degrees).

Returns
outnumpy.ndarray

The Y and X coordinates of the band-limiting ellipse.

get_fmax(self, rot)[source]

Return the spatial-frequency band-limits along a Y axis that is ‘rot’ degrees west of north, and an X axis that is 90 degrees away from this Y axis in the sense of a rotation from north to east.

Parameters
rotfloat

The angle of the target Y axis west of north (degrees).

Returns
outnumpy.ndarray

The maximum spatial frequencies along the Y and X axes at rotation angle rot, in the same units as were used to initialize the object.