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 Telescope object. 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()
INFO Querying https://archive.stsci.edu/cgi-bin/dss_form
<Axes: >
../../_images/prose.Image_0_2.png
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.get

has_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

airmass

Observation airmass as written in image header

bjd_tdb

BJD TDB time of the observation

date

datetime of the observation

dec

DEC of the image as written in header

exposure

Image exposure time in seconds

filter

Observation filter as written in image header

flip

Telescope flip as written in image header

fov

RA-DEC field of view of the image in degrees

jd_utc

JD UTC time of the observation

label

A conveniant {Telescope}_{Date}_{Object}_{Filter} string

night_date

date of the night when night started.

object

peaks

pixel_scale

Pixel scale (or plate scale) in arcseconds

plate_solved

Return whether the image is plate solved

ra

RA of the image as written in header

seeing

Seeing of the image as written is header

shape

Shape of the image data np.ndarray

skycoord

astropy SkyCoord object based on header RAn, DEC

stars_coords

Image sources pixel coordinates

wcs

astropy.wcs.WCS object associated with the FITS Image.header