srcmodel.img

ximpol.srcmodel.img.main()[source]
class ximpol.srcmodel.img.xFITSImage(file_path, build_cdf=True)[source]

Class describing a FITS image.

Parameters:
  • file_path (string) – The path to the FITS file containing the image.
  • build_cdf (bool) – If True, build the cdf (i.e., equip the instance to generate random numbers).

Warning

There are several things I don’t quite understand here, first of all why we seem to need to transpose the data. (Also, we migh have a residual offset by 1 pixel that we should try and sort out.)

classmethod add_label(fig, text)[source]

Add a label to an image.

This is a shortcut to have all the formatting defined.

build_cdf()[source]

Build the cumulative distribution function.

(This is used to extract random positions from the image when simulating extended sources.)

center()[source]

Return the (ra, dec) coordinates of the image center.

plot(show=True, zlabel='Counts/pixel', subplot=(1, 1, 1))[source]

Plot the image.

This is using aplpy to render the image.

Warning

We have to figure out the subplot issue, here. I put in a horrible hack to recover the previous behavior when there’s only one subplot.

rvs_coordinates(size=1, randomize=True)[source]

Generate random coordinates based on the image map.

Parameters:
  • size (int) – The number of sky coordinates to be generated.
  • randomize (bool) – If true, the positions are randomized uniformely within each pixel.

Warning

There must be a better way to do this. We should take a look at how aplpy.FITSImage is doing this.