Datasets (photutils.datasets
)¶
Introduction¶
photutils.datasets
gives easy access to load or make a few example
datasets. The datasets are mostly images, but they also include PSF
models and a source catalog.
These datasets are useful for the Photutils documentation, tests, and benchmarks, but also for users that would like to try out or implement new methods for Photutils.
Functions that start with load_*
load data files from disk. Very
small data files are bundled in the Photutils code repository and are
guaranteed to be available. Mid-sized data files are currently
available from the astropy-data repository and loaded into the
Astropy cache on the user’s machine on first load.
Functions that start with make_*
generate simple simulated data
(e.g., Gaussian sources on a flat background with Poisson or Gaussian
noise). Note that there are other tools like skymaker that can
simulate much more realistic astronomical images.
Getting Started¶
Let’s load an example image of M67 with
load_star_image()
:
>>> from photutils.datasets import load_star_image
>>> hdu = load_star_image()
>>> print(hdu.data.shape)
(1059, 1059)
hdu
is a FITS ImageHDU
object and hdu.data
is a ndarray
object.
Let’s plot the image:
import matplotlib.pyplot as plt
from photutils.datasets import load_star_image
hdu = load_star_image()
plt.imshow(hdu.data, origin='lower', interpolation='nearest')
plt.tight_layout()
plt.show()
(Source code
, png
, hires.png
, pdf
, svg
)

Reference/API¶
This subpackage contains tools for making or loading datasets for examples and tests.
Functions¶
|
Apply Poisson noise to an array, where the value of each element in the input array represents the expected number of counts. |
|
Get the local path for a given file. |
|
Load a Spitzer IRAC PSF image. |
|
Load a simulated HST WFC3/IR F160W image of stars. |
|
Load a 4.5 micron Spitzer catalog. |
|
Load a 4.5 micron Spitzer image. |
|
Load an optical image of stars. |
|
Make an example image containing 100 2D Gaussians plus a constant background. |
|
Make an example image containing four 2D Gaussians plus a constant background. |
|
Make an image containing 2D Gaussian sources. |
|
Make an image containing 2D Gaussian sources. |
|
Create a simple celestial gWCS object in the ICRS coordinate frame. |
|
Create a FITS |
|
Make an image containing sources generated from a user-specified model. |
|
Make a noise image containing Gaussian or Poisson noise. |
|
Make a |
|
Make a |
|
Make an example image containing PSF model images. |
|
Create a simple celestial |