Image#
- class prose.Image#
Object containing image data and metadata
When a FITS path (or header) is provided, keyword values are used to identify and instantiate a
Telescopeobject. Image attributes then use this object to retrieve specific image information such as ra, dec, untis… etc- Parameters:
fitspath (str or Path, optional) – file path , by default None
data (numpy.ndarray, optional) – image data, by default None
header (dict-like, optional) – image metadata, by default None
Example
from prose.tutorials import image_sample # loading and showing an example image image = image_sample("05 38 44.851", "+04 32 47.68") image.show()
[38;5;12mINFO[0m Querying https://archive.stsci.edu/cgi-bin/dss_form
<Axes: >
image.header[0:10] # the 10 first lines
SIMPLE = T /FITS: Compliance BITPIX = 16 /FITS: I*2 Data NAXIS = 2 /FITS: 2-D Image Data NAXIS1 = 713 /FITS: X Dimension NAXIS2 = 714 /FITS: Y Dimension EXTEND = T /FITS: File can contain extensions DATE = '2023-04-14 ' /FITS: Creation Date ORIGIN = 'STScI/MAST' /GSSS: STScI Digitized Sky Survey SURVEY = 'POSSI-O ' /GSSS: Sky Survey REGION = 'XO538 ' /GSSS: Region Name
Once this object is instantiated, its parameters are mapped to the ones of the telescope, detected from the header information. This exposes conveniant attributres, for example:
print(f"pixel scale : {image.pixel_scale:.2f}\nFOV: {image.fov}\nnight: {image.night_date}\n")
pixel scale : 1.01 arcsec FOV: [0.20003263 0.20031318] deg night: 1955-11-22
some of them being directly translated into astropy Quantity or datetime object.
Methods
__init__([fitspath, data, header, verbose, ...])Object containing image data and metadata
copy([data])Copy of image object
enough_stars([n, error])from_telescope(telescope)gaia_stars([world, inplace])Query gaia stars in the image (only in >= 2.0.3)
get(key[, default])Return corresponding value from header, similar to
dict.gethas_stars([error])plot_aperture(center[, arcmin])Plot an aperture with radius defined in arcmin
plot_catalog(name[, color, label, n])Plot catalog stars
plot_marks(coordinates[, label, ax])Plot circular marks given world coordinates (only in >= 2.0.3)
plot_psf_model([cmap, c, figsize, axes])plot_sources([ax])show([cmap, ax, figsize, stars, zscale, ...])Show image data
show_cutout([star, size])Show a zoomed cutout around a detected star or coordinates
writeto(destination)Attributes
airmassObservation airmass as written in image header
bjd_tdbBJD TDB time of the observation
datedatetime of the observation
decDEC of the image as written in header
exposureImage exposure time in seconds
filterObservation filter as written in image header
flipTelescope flip as written in image header
fovRA-DEC field of view of the image in degrees
jd_utcJD UTC time of the observation
labelA conveniant {Telescope}_{Date}_{Object}_{Filter} string
night_datedate of the night when night started.
objectpeakspixel_scalePixel scale (or plate scale) in arcseconds
plate_solvedReturn whether the image is plate solved
raRA of the image as written in header
seeingSeeing of the image as written is header
shapeShape of the image data np.ndarray
skycoordastropy SkyCoord object based on header RAn, DEC
stars_coordsImage sources pixel coordinates
wcsastropy.wcs.WCS object associated with the FITS
Image.header