km3astro.plot

Plotting utilities.

Module Contents

Functions

ra_dec(skycoord)

Take (ra, dec) from skycoord in matplotlib-firendly format.

projection_axes([projection])

plot_equatorial(evts[, projection, ax, marker, ...])

get_coord_from_skycoord(SC, frame, detector)

Return the coordinate of a SkyCoord object for aitoff or mollweide projection

get_alert_color(alert_type)

Return the color for a specific alert_type

get_alert_marker(alert_type)

Return the marker style for a specific alert_type

get_visibility_map(frame, detector)

Get the visibility map for a given frame ('equatorial' or 'galactic') and a given detector ('antares', 'orca' or 'arca').

skymap_hpx([skymap_url, obstime, nside, detector, outfile])

Method to plot a skymap from an FITS url.

skymap_list([dataframe, frame, frame_input, detector, ...])

Method to plot a skymap from a list of alert in a csv file.

skymap_alert([ra, dec, obstime, error_radius, frame, ...])

Method to plot a skymap from an alert in a csv file or by giving RA, DEC and obstime.

km3astro.plot.ra_dec(skycoord)[source]

Take (ra, dec) from skycoord in matplotlib-firendly format.

This wraps the ra because astropy’s convention differs from matplotlib.

km3astro.plot.projection_axes(projection='aitoff', **figargs)[source]
km3astro.plot.plot_equatorial(evts, projection='aitoff', ax=None, marker='o', markersize=4, alpha=0.8, adjust_subplots=True, **kwargs)[source]
km3astro.plot.get_coord_from_skycoord(SC, frame, detector)[source]

Return the coordinate of a SkyCoord object for aitoff or mollweide projection

Parameters:
SCastropy.SkyCoord

The sky coordinate.

framestr

The frame of the coordinate, either “ParticleFrame” or “UTM” or “altaz” or “equatorial” or “galactic”

detectorstr [default = “antares”]

Detector of the coordinate, either “orca”, “arca” or “antares”.

Returns:
(phi, theta)/(az, ze)/(alt, az)/(ra, dec)/(l, b)(float, float)

The set of coordinate.

km3astro.plot.get_alert_color(alert_type)[source]

Return the color for a specific alert_type Based on color list tab:Palette 10

km3astro.plot.get_alert_marker(alert_type)[source]

Return the marker style for a specific alert_type

km3astro.plot.get_visibility_map(frame, detector)[source]

Get the visibility map for a given frame (‘equatorial’ or ‘galactic’) and a given detector (‘antares’, ‘orca’ or ‘arca’).

km3astro.plot.skymap_hpx(skymap_url: str = None, obstime: str = None, nside: int = 128, detector: str = 'antares', outfile: str = None, **old_kwargs)[source]

Method to plot a skymap from an FITS url.

Parameters:
skymap_urlstr

URL of the FITS skymap.

obstimestr

Alert time in ISOT format.

nsideint

Resolution of the map to be drawn (higher = more precise but slower).

detectorstr

The detector to use for horizon definition. Choices are antares, orca, and arca.

outfilestr

Path to the output file. If None, no file is written.

**old_kwards: dict

[TO BE DEPRECATED] Arguments used by the old function: (file0, save=False, path=””, name=””)

Returns:
Figfile.png

A png file of the skymap.

km3astro.plot.skymap_list(dataframe: pandas.DataFrame = pd.DataFrame(), frame: str = 'equatorial', frame_input: str = 'equatorial', detector: str = 'antares', outfile: str = None, **old_kwargs)[source]

Method to plot a skymap from a list of alert in a csv file.

Parameters:
dataframe = pd.DataFrame()

The dataframe containing the list of alert.

framestr [default = “equatorial”]

The frame of the skymap, either “equatorial” or “galactic”.

frame_inputstr [default = “equatorial”]

The frame of the input data, either “equatorial” or “galactic”.

detectorstr [ default = “antares”]

The detector to be used for eventual input and for horizon.

outfilestr

Path to the output file. If None, no file is written.

**old_kwards: dict

[TO BE DEPRECATED] Arguments used by the old function: (file0, plot_frame, detector_to, alt_cut, title, save, path, name)

Returns:
Figfile.png

A png file of the skymap.

km3astro.plot.skymap_alert(ra: float = None, dec: float = None, obstime: str = None, error_radius: float = None, frame: str = 'equatorial', detector: str = 'antares', outfile: str = None, **old_kwargs)[source]

Method to plot a skymap from an alert in a csv file or by giving RA, DEC and obstime.

Parameters:
ra, dec(float,float)

The ra and dec coordinate of the alert.

obstimestr

The observation time of the alert. Format is “YYYY-MM-DDTHH:MM:SS”

error_radiusfloat [default = None]

The radius of the error circle around the alert coordinate.

framestr [default = “equatorial”]

The frame of the map.

detectorstr [default = “antares”]

The detector to use for horizon definition and coordinate transformation. Choices are antares, orca, and arca.

outfilestr

Path to the output file. If None, no file is written.

**old_kwards: dict

[TO BE DEPRECATED] Arguments used by the old function: (file0, plot_frame, detector_to, alt_cut, title, save, path, name)

Returns:
Figfile.png

A png file of the skymap.