streamobs.plotting module#
Plotting functions.
- streamobs.plotting.draw_stream(phi1, phi2)[source]#
Create 2d histogram and draw stellar distribution.
- Parameters:
phi1 (coordinates of stars (deg))
phi2 (coordinates of stars (deg))
Returns
--------
num (output of imshow)
xedges (output of imshow)
yedges (output of imshow)
im (output of imshow)
- streamobs.plotting.plot_inject(data, survey, bands=None, range=None, **kwargs)[source]#
Plot injection results showing observed vs unobserved stars.
Creates three panels: - Left: Injected stars in the survey footprint (using magnitude limit map) - Center: HR diagram using true magnitudes - Right: HR diagram using measured magnitudes with photometric errors
- Parameters:
data (pandas.DataFrame or dict-like) – Data containing the injected stream. Must have columns: - ‘ra’, ‘dec’: Sky coordinates in degrees - ‘flag_observed’: Boolean flag for detected stars - ‘mag_<band>’: True magnitudes for each band - ‘mag_<band>_obs’: Observed magnitudes for each band
survey (Survey) – Survey object containing magnitude limit maps and other properties.
bands (list of str, optional) – Bands to use for HR diagram. Default is [‘g’, ‘r’]. Will use first two bands if more are provided.
**kwargs (dict) – Additional keyword arguments: - save : bool, if True saves the figure - folder : str, path to save folder (default: ../data/outputs/) - survey_name : str, survey name for filename (default: uses survey object)
- Returns:
fig, ax – The matplotlib figure and axes array.
- Return type:
tuple
Examples
>>> fig, ax = plot_inject(observed_data, survey, bands=['g', 'r'], save=True)
- streamobs.plotting.plot_stream(phi1, phi2)[source]#
Plot binned histogram of stream.
- Parameters:
phi1 (coordinates of stars (deg))
phi2 (coordinates of stars (deg))
- Returns:
fig, ax
- Return type:
the figure and axis
- streamobs.plotting.plot_stream_in_mask(ra, dec, mask, nest=False, output_folder=None)[source]#
Plot stream in mask using healpy and skyproj.
- Parameters:
ra (coordinates of stars (deg))
dec (coordinates of stars (deg))
mask (boolean array, True for masked points)
- Returns:
fig, ax
- Return type:
the figure and axis