ssapy_toolkit.Plots.plotutils
Functions
|
Classify 'var' into one of VarType cases. |
|
Create sphere coordinates with center (cx, cy, cz) and radius r. |
|
Darken a color by reducing its lightness. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Save a Matplotlib figure as JPG (or append to PDF if save_path ends with .pdf). |
|
Save a Matplotlib figure as a PNG embedded in a PDF file. |
|
Normalize r and t into parallel lists of shape-(n,3) ndarrays and astropy Time objects. |
|
Save a Matplotlib figure. |
Classes
|
- class ssapy_toolkit.Plots.plotutils.VarType(value)[source]
Bases:
Enum- ARRAY = 3
- LIST_ARRAYS = 4
- LIST_LISTS = 5
- MIXED_LIST = 6
- NONE = 1
- OTHER = 7
- TIME = 2
- ssapy_toolkit.Plots.plotutils.create_sphere(cx, cy, cz, r, resolution=360)[source]
Create sphere coordinates with center (cx, cy, cz) and radius r.
- Return type:
np.ndarray of shape (3, 2*resolution, resolution)
- ssapy_toolkit.Plots.plotutils.darken(color, amount=0.5)[source]
Darken a color by reducing its lightness.
- ssapy_toolkit.Plots.plotutils.drawEarth(time, ngrid=100, R=6378137.0, rfactor=1)[source]
- Parameters:
time (array_like or astropy.time.Time (n,)) – If float (array), then should correspond to GPS seconds; i.e., seconds since 1980-01-06 00:00:00 UTC
ngrid (int) – Number of grid points in Earth model.
R (float) – Earth radius in meters. Default is WGS84 value.
rfactor (float) – Factor by which to enlarge Earth (for visualization purposes)
- ssapy_toolkit.Plots.plotutils.drawMoon(time, ngrid=100, R=1738100.0, rfactor=1)[source]
- Parameters:
time (array_like or astropy.time.Time (n,)) – If float (array), then should correspond to GPS seconds; i.e., seconds since 1980-01-06 00:00:00 UTC
ngrid (int) – Number of grid points in Moon model.
R (float) – Moon radius in meters.
rfactor (float) – Factor by which to enlarge Moon (for visualization purposes)
- ssapy_toolkit.Plots.plotutils.drawSphere(xCenter, yCenter, zCenter, r, res=10j, flatten=True)[source]
- ssapy_toolkit.Plots.plotutils.draw_dashed_circle(ax, normal_vector, radius, dashes, dash_length=0.1, label='Dashed Circle')[source]
- ssapy_toolkit.Plots.plotutils.save_plot(figure, save_path, dpi=200)[source]
Save a Matplotlib figure as JPG (or append to PDF if save_path ends with .pdf).
- ssapy_toolkit.Plots.plotutils.save_plot_to_pdf(figure, pdf_path)[source]
Save a Matplotlib figure as a PNG embedded in a PDF file.
If the specified PDF already exists, append a new page; otherwise create it.
- ssapy_toolkit.Plots.plotutils.valid_orbits(r, t, drop_empty=True, warn=True)[source]
Normalize r and t into parallel lists of shape-(n,3) ndarrays and astropy Time objects.
- Accepts:
- r:
(3,), (1,3), (N,3), (B,N,3) ndarray
list/tuple of any of the above
- t:
None
scalar (float/int) interpreted as GPS seconds (broadcast)
ndarray of GPS seconds: (N,) or (B,N)
astropy.time.Time (scalar or array)
list/tuple of scalars/ndarrays/Time, matching number of tracks
- Additionally (if drop_empty=True):
removes empty r-tracks (Ni==0)
if t is a per-track list/tuple with the same length as the original r_list, removes the corresponding t entries too
prints a warning when any are removed
- Returns:
r_list: list[np.ndarray] where each is (Ni,3) t_list: list[astropy.time.Time] where each has len Ni
- ssapy_toolkit.Plots.plotutils.yufig(figure, save_path, dpi=200)[source]
Save a Matplotlib figure.
- Behavior:
If save_path has no extension -> save as JPG (‘.jpg’ is appended).
If save_path ends with ‘.pdf’ (case-insensitive) -> append/write to PDF via save_plot_to_pdf.
If save_path has any other extension -> use it directly with figure.savefig().