frb.figures.finder
Module for generating a finder chart
- frb.figures.finder.from_hdu(hdu, title, **kwargs)[source]
Convenience function to handle an HDU to generate a finder chart
see generate() for more details
- Args:
hdul (astropy.io.fits.PrimaryHDU)
title (str)
- Returns:
figure generated
- Return type:
matplotlib.pyplot.figure, matplotlib.pyplot.Axis
- frb.figures.finder.generate(image, wcs, title, flip_ra=False, flip_dec=False, log_stretch=False, cutout=None, primary_coord=None, secondary_coord=None, secondary_offset: bool = True, third_coord=None, slit=None, vmnx=None, extra_text=None, outfile=None, figsize=None)[source]
Basic method to generate a Finder chart figure
- Args:
image (np.ndarray) – Image for the finder
wcs (astropy.wcs.WCS) – WCS solution
title (str) – Title; typically the name of the primary source
flip_ra (bool, default False) – Flip the RA (x-axis). Useful for southern hemisphere finders.
flip_dec (bool, default False) – Flip the Dec (y-axis). Useful for southern hemisphere finders.
log_stretch (bool, optional) – Use a log stretch for the image display
cutout (tuple, optional) – SkyCoord (center coordinate) and Quantity (image angular size) for a cutout from the input image.
primary_coord (astropy.coordinates.SkyCoord, optional) – If provided, place a mark in red at this coordinate
secondary_coord (astropy.coordinates.SkyCoord, optional) – If provided, place a mark in cyan at this coordinate It is assumeed this is for an offset star (i.e. calculate offsets) unless secondary_offset = False
secondary_offset (bool, optional) – If True, the secondary_coord provide is for an offset star Otherwise, secondary_coord is considered the second of a pair of scientific sources
third_coord (astropy.coordinates.SkyCoord, optional) – If provided, place a mark in yellow at this coordinate
slit (tuple, optional) – If provided, places a rectangular slit with specified coordinates, width, length, and position angle on image (from North to East) [SkyCoords(‘21h44m25.255s’,-40d54m00.1s’, frame=’icrs’), 1*u.arcsec, 10*u.arcsec, 20*u.deg]
vmnx (tuple, optional) – Used for scaling the image. Otherwise, the image is analyzed for these values.
extra_text – str Extra text to be added at the bottom of the Figure. e.g. DSS r-filter
outfile (str, optional) – Filename for the figure. File type will be according to the extension
figsize (tuple, optional) – tuple to define the figure size. It goes within the fig=plt.figure(figsize=figsize)
- Returns:
matplotlib.pyplot.figure, matplotlib.pyplot.Axis
- frb.figures.finder.sdss_dss(coord, title, show_circ=True, EPOCH=None, imsize=<Quantity 5. arcmin>, outfile=None, show_slit=None, show_another=None, cradius=None, in_img=None, dss_only=False, vmnx=(None, None))[source]
Generate a SDSS or DSS finder
Pulled from xastropy
- Args:
coord (SkyCoord)
title (str)
show_circ (bool, optional) – Show a yellow circle on the target
EPOCH (float, optional) – Defaults to 2000.
imsize (Quantity or Angle) – Size of the finder
show_slit (list, optional) – Show a slit with [width, length, PA]
show_another (bool, optional) – Not yet functional
cradius (Quantity, optional) – Circle radius, only shown if show_circ is True. Default is imsize/50.
in_img (PIL image, optional)
dss_only (bool, optional) – Only pull from DSS
vmnx (tuple, optional) – vmin, vmax
- frb.figures.finder.getjpg(coord, imsize, dss_only=False)[source]
Grab an SDSS or DSS image
- Args:
coord (SkyCoord)
imsize (Angle or Quantity) – image size
dss_only (bool, optional) – Only pull from DSS
- Returns:
Image, flag indicating if the image is B&W
- Return type:
PIL, bool
- frb.figures.finder.dsshttp(coord, imsize)[source]
Generate URL for DSS
- Args:
coord (SkyCoord)
imsize (Angle or Quantity) – image size
- Returns:
URL
- Return type:
Note
Finder-chart workflows may require optional imaging dependencies such as
photutils and scikit-image in your environment.