hpmoc.points module
- exception hpmoc.points.NoDisks
Bases:
ValueErrorIndicates that there are no point sources with nonzero support (sigma). Catch this to avoid wasting an extra artist plotting non-existent disks.
- class hpmoc.points.PointsTuple(points: List[Tuple[float, float, Optional[float], Optional[str]]], rgba: hpmoc.points.Rgba = Rgba(red=0, green=1, blue=0, alpha=0.2), marker: str = 'x', label: Optional[str] = None)
Bases:
tupleA collection of points for scatterplots.
- cmap()
- Returns
cmap – A color map to be used as the
cmapargument toimshowalongside the return value ofrender.- Return type
matplotlib.colors.LinearSegmentedColormap
- classmethod dedup(*pts)
Deduplicate a collection of
PointsTupleinstances, converting color tuples toRgbaand converting all input tuples toPointsTupleinstances. Preserves ordering.
- property label
Alias for field number 3
- property marker
Alias for field number 2
- meta_dict(*, start=0) dict
Create a flattened meta dictionary, e.g. for a fits file, out of the provided
PointsTupleinstances.See also
- classmethod meta_read(meta: dict) List[__class__]
- property points
Alias for field number 0
- render(u⃗o, extent=1.0)
Similar to
hpmoc.PartialUniqSkymap.render, but for support disks specified by the input points’ sigma parameters. Will raiseNoDisksif all point source sigmas are undefined and/or zero. Use this with thecmapmethod and yourWCSAxesinstance’simshowmethod to display these disks. You will need to callWCSAxes.scatterseparately to display the point locations themselves usingself.marker. You will also need to label the point names separately usingself.label_points.All of this is done automatically if this instance is passed as a
scatterparameter toPartialUniqSkymap.plot.- Parameters
u⃗ᵒ (array or astropy.wcs.WCS) – The pixels to fill. If an array, treated as UNIQ indices (duplicates allowed); if WCS, treated as a set of pixels to render to.
extent (float, optional) – How many multiples of
sigmato extend the disk out to.
- Returns
pixels – Pixel values at locations specified in
u⃗ᵒ. If aWCSinstance, then the pixels will be suitable for immediate display in aWCSAxesinstance usingimshow; otherwise, you might wish to use the nonzero values as a mask to select pixels in aPartialUniqSkymapnear the point sources in this instance.- Return type
array
- Raises
NoDisks – If all sigmas are zero or undefined. Use this to avoid an extraneous call to
imshow, or to catch missing sigmas.
See also
hpmoc.partial.PartialUniqSkymap.plot,hpmoc.partial.PartialUniqSkymap.render,WCSAxes.scatter
- property rgba
Alias for field number 1
- scale_sigma(factor, **kwargs)
Return a new
PointsTuplewith sigma scaled for each point byfactor(if sigma is defined). Optionally also changergba,marker, orlabel(will be unchanged by default). A convenience method for plotting multiple sigmas around a point source.
- class hpmoc.points.Rgba(red: Union[float, int], green: Union[float, int], blue: Union[float, int], alpha: Union[float, int] = 1)
Bases:
tupleAn RGBA color tuple. If
alphais omitted, set to1.- property alpha
Alias for field number 3
- property blue
Alias for field number 2
- classmethod from_hex(hexcolor)
Convert a color of the forms
rgb,rgba,rrggbb,rrggbbaa,#rgb,#rrggbb,#rgba, or#rrggbbaato a newRgbainstance. Alpha can be omitted, in which case it is set to 1.
- property green
Alias for field number 1
- property red
Alias for field number 0
- to_hex(include_alpha=True)
Get a hex string of the form
#rrggbbaafor thisRgbatuple.