You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.
Hello poliastro community, I tried to run the following example to generate a porkchop plot.
from astropy import units as u
from poliastro.bodies import Earth, Mars
from poliastro.plotting.porkchop import PorkchopPlotter
from poliastro.util import time_range
launch_span = time_range(start="2005-04-30", end="2005-10-07")
arrival_span = time_range(start="2005-11-16", end="2006-12-21")
porkchop_plot = PorkchopPlotter(Earth, Mars, launch_span, arrival_span)
dv_dpt, dv_arr, c3dpt, c3arr, tof = porkchop_plot.porkchop()
and encountered the following error
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[10], line 2
1 porkchop_plot = PorkchopPlotter(Earth, Mars, launch_span, arrival_span)
----> 2 dv_dpt, dv_arr, c3dpt, c3arr, tof = porkchop_plot.porkchop()
File ~/Documents/poliastro/venv/lib/python3.10/site-packages/poliastro/plotting/porkchop.py:204, in PorkchopPlotter.porkchop(self)
198 fig = self.ax.figure
200 c3_levels = np.linspace(
201 0, self.max_c3.to_value(u.km**2 / u.s**2), 30
202 )
--> 204 c = self.ax.contourf(
205 [D.to_datetime() for D in self.launch_span],
206 [A.to_datetime() for A in self.arrival_span],
207 c3_launch,
208 c3_levels,
209 )
211 line = self.ax.contour(
212 [D.to_datetime() for D in self.launch_span],
213 [A.to_datetime() for A in self.arrival_span],
(...)
217 linestyles="solid",
218 )
220 cbar = fig.colorbar(c)
File ~/Documents/poliastro/venv/lib/python3.10/site-packages/matplotlib/__init__.py:1442, in _preprocess_data.<locals>.inner(ax, data, *args, **kwargs)
1439 @functools.wraps(func)
1440 def inner(ax, *args, data=None, **kwargs):
1441 if data is None:
-> 1442 return func(ax, *map(sanitize_sequence, args), **kwargs)
1444 bound = new_sig.bind(ax, *args, **kwargs)
1445 auto_label = (bound.arguments.get(label_namer)
1446 or bound.kwargs.get(label_namer))
File ~/Documents/poliastro/venv/lib/python3.10/site-packages/matplotlib/axes/_axes.py:6467, in Axes.contourf(self, *args, **kwargs)
6458 """
6459 Plot filled contours.
6460
(...)
6464 %(contour_doc)s
6465 """
6466 kwargs['filled'] = True
-> 6467 contours = mcontour.QuadContourSet(self, *args, **kwargs)
6468 self._request_autoscale_view()
6469 return contours
File ~/Documents/poliastro/venv/lib/python3.10/site-packages/matplotlib/contour.py:769, in ContourSet.__init__(self, ax, levels, filled, linewidths, linestyles, hatches, alpha, origin, extent, cmap, colors, norm, vmin, vmax, extend, antialiased, nchunk, locator, transform, negative_linestyles, *args, **kwargs)
765 if self.negative_linestyles is None:
766 self.negative_linestyles = \
767 mpl.rcParams['contour.negative_linestyle']
--> 769 kwargs = self._process_args(*args, **kwargs)
770 self._process_levels()
772 self._extend_min = self.extend in ['min', 'both']
File ~/Documents/poliastro/venv/lib/python3.10/site-packages/matplotlib/contour.py:1411, in QuadContourSet._process_args(self, corner_mask, algorithm, *args, **kwargs)
1408 corner_mask = mpl.rcParams['contour.corner_mask']
1409 self._corner_mask = corner_mask
-> 1411 x, y, z = self._contour_args(args, kwargs)
1413 contour_generator = contourpy.contour_generator(
1414 x, y, z, name=self._algorithm, corner_mask=self._corner_mask,
1415 line_type=contourpy.LineType.SeparateCode,
1416 fill_type=contourpy.FillType.OuterCode,
1417 chunk_size=self.nchunk)
1419 t = self.get_transform()
File ~/Documents/poliastro/venv/lib/python3.10/site-packages/matplotlib/contour.py:1453, in QuadContourSet._contour_args(self, args, kwargs)
1451 else:
1452 raise _api.nargs_error(fn, takes="from 1 to 4", given=nargs)
-> 1453 z = ma.masked_invalid(z, copy=False)
1454 self.zmax = float(z.max())
1455 self.zmin = float(z.min())
File ~/Documents/poliastro/venv/lib/python3.10/site-packages/numpy/ma/core.py:2361, in masked_invalid(a, copy)
2359 mask = getattr(a, '_mask', None)
2360 if mask is not None:
-> 2361 condition = ~(np.isfinite(getdata(a)))
2362 if mask is not nomask:
2363 condition |= mask
TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
馃悶 Problem
Hello poliastro community, I tried to run the following example to generate a porkchop plot.
and encountered the following error
馃枼 Please paste the output of following commands
pip freeze
I appreciate if someone could tell me if I missed anything, or if this is a bug.
Thanks for all the great work you do.
# Paste your output here:
# Paste your output here:
馃挕 Possible solutions
馃搵 Steps to solve the problem
Addresses #<put issue number here>
The text was updated successfully, but these errors were encountered: