Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation issue on Hapsira Quickstart #13

Open
cjpascoa opened this issue Nov 2, 2024 · 1 comment
Open

Documentation issue on Hapsira Quickstart #13

cjpascoa opened this issue Nov 2, 2024 · 1 comment

Comments

@cjpascoa
Copy link

cjpascoa commented Nov 2, 2024

First of all: Thank you for your work.

The issue is in "Studying trajectories: Ephem objects -->"

🐞 TypeError: time_range() takes 1 positional argument but 2 were given

The following code gives the previous error -->

from hapsira.twobody.sampling import EpochsArray, TrueAnomalyBounds, EpochBounds
from hapsira.util import time_range
from astropy.time import Time

start_date = Time("2022-07-11 05:05", scale="utc")
end_date = Time("2022-07-11 07:05", scale="utc")

One full revolution

ephem1 = iss.to_ephem()

Explicit times given

ephem2 = iss.to_ephem(strategy=EpochsArray(epochs=time_range(start_date, end_date)))

Automatic grid, true anomaly limits

ephem3 = iss.to_ephem(strategy=TrueAnomalyBounds(min_nu=0 << u.deg, max_nu=180 << u.deg))

Automatic grid, epoch limits

ephem4 = iss.to_ephem(strategy=EpochBounds(min_epoch=start_date, max_epoch=end_date)).

💡 Possible solutions

It looks like the function "time_range" should be called with one parameter -->

@cjpascoa
Copy link
Author

cjpascoa commented Nov 2, 2024

Further on I checked the function on hapsira.util

hapsira.util.time_range(start, *, num_values=50, spacing=None, end=None, format=None, scale=None)

Generates range of astronomical times.
New in version 0.8.0.
Parameters:
        start ([Time](https://docs.astropy.org/en/stable/api/astropy.time.Time.html#astropy.time.Time) or [Quantity](https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity)) – Start time.
        num_values ([int](https://docs.python.org/3/library/functions.html#int), optional) – Number of equal spaced time values to be generated, default to 50.
        spacing ([Time](https://docs.astropy.org/en/stable/api/astropy.time.Time.html#astropy.time.Time) or [Quantity](https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html#astropy.units.Quantity), optional) – Spacing between periods, optional.
        end ([Time](https://docs.astropy.org/en/stable/api/astropy.time.Time.html#astropy.time.Time) or equivalent, optional) – End date.
Returns:
    result – Array of time values.
Return type:
    [Time](https://docs.astropy.org/en/stable/api/astropy.time.Time.html#astropy.time.Time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant