nenupy.astro.target.Target
- class nenupy.astro.target.Target(coordinates, observer=<EarthLocation (4323936.68522791, 165534.49991696, 4670345.36540385) m>, time=<Time object: scale='utc' format='datetime' value=2026-05-27 13:14:46.149384>)[source]
Bases:
AstroObject,ABCAbstract class to handle target objects.
Added in version 2.0.0.
- __init__(coordinates, observer=<EarthLocation (4323936.68522791, 165534.49991696, 4670345.36540385) m>, time=<Time object: scale='utc' format='datetime' value=2026-05-27 13:14:46.149384>)[source]
Methods
__init__(coordinates[, observer, time])azimuth_transit([azimuth, t_min, duration, ...])Computes the
Targettransit time(s) at a givenazimuthvalue.hour_angle([fast_compute])local_sidereal_time([fast_compute])meridian_transit([t_min, duration, ...])Computes the
Targetmeridian transit time(s).meridian_transit_2([t_min, duration, ...])next_meridian_transit([time, precision, ...])Computes the
Targetnext meridian transit time.next_rise_time([time, elevation, precision])Computes the
Targetnext rise time aboveelevation.next_set_time([time, elevation, precision])Computes the
Targetnext set time belowelevation.plot([figname, fig, return_ax])Plot the horizontal position of the Target as a scatter plot in polar coordinates.
previous_meridian_transit([time, precision, ...])Computes the
Targetprevious meridian transit time.previous_rise_time([time, elevation, precision])Computes the
Targetprevious rise time aboveelevation.previous_set_time([time, elevation, precision])Computes the
Targetprevious set time belowelevation.rise_time([t_min, elevation, duration, ...])Computes the
Targetrise time(s) aboveelevation.separation(other)Computes the angular separation between two
Targetinstances.set_time([t_min, elevation, duration, precision])Computes the
Targetset time(s) belowelevation.Attributes
culmination_azimuthAllows to modify horizontal coordinates without messing up with the actual coordinates object.
Returns the maximal elevation of the target with respect to the observer.
Returns the minimal elevation of the target with respect to the observer.
test de doc
ground_projectionhorizontal_coordinatesWhether the celestial object is circumpolar at the observer's latitude.
timecoordinatespolarizationvalueobserver- azimuth_transit(azimuth=<Quantity 180. deg>, t_min=<Time object: scale='utc' format='datetime' value=2026-05-27 13:14:46.149992>, duration=<TimeDelta object: scale='None' format='sec' value=86400.0>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>)[source]
Computes the
Targettransit time(s) at a givenazimuthvalue. This method returns all the transit times found in the time window ranging fromt_mintot_min + duration.- Parameters:
azimuth (
Quantity) – Azimuth at which the transit is computed. Default is180 deg(i.e. South).t_min (
Time) – Starting time of the temporal window within which azimuth transits are looked for. Default is current time.duration (
TimeDelta) – Width of the temporal window within which azimuth transits are looked for. Default is1 day.precision (
TimeDelta) – Temporal precision of the returned azimuth transit values. Default is5 sec.
- Returns:
Azimuth transit times. If no transit times are found (either because the requested time window doesn’t contain any or because the source apparent sky position does not cross the desired
azimuth) an emptyTimeobject is returned.- Return type:
- Example:
>>> from nenupy.astro.target import FixedTarget >>> from astropy.time import Time, TimeDelta >>> import astropy.units as u >>> cyg_a = FixedTarget.from_name("Cyg A") >>> cyg_a.azimuth_transit( azimuth=100*u.deg, t_min=Time("2021-01-01"), duration=TimeDelta(86400*2, format="sec") ) <Time object: scale='utc' format='iso' value=['2021-01-01 11:22:12.463' '2021-01-02 11:18:16.477']>
See also
- property custom_ho_coordinates
Allows to modify horizontal coordinates without messing up with the actual coordinates object.
- property elevation_max
Returns the maximal elevation of the target with respect to the observer.
It is computed as:
\[\theta_{\rm max} [\rm{deg}] = 90 - l + \delta\]where \(l\) is the observer’s latitude, \(\delta\) the source’s declination.
- Returns:
The maximal elevation.
- Return type:
- property elevation_min
Returns the minimal elevation of the target with respect to the observer.
It is computed as:
\[\theta_{\rm min} [\rm{deg}] = 90 - l - \delta\]where \(l\) is the observer’s latitude, \(\delta\) the source’s declination.
- Returns:
The minimal elevation.
- Return type:
- property frequency
test de doc
- property is_circumpolar
Whether the celestial object is circumpolar at the observer’s latitude.
\[l + \delta \geq 90\,{\rm deg}\]where \(l\) is the latitude (defined in
observer), \(\delta\) is the object’s declination (defined incoordinates).
- meridian_transit(t_min=<Time object: scale='utc' format='datetime' value=2026-05-27 13:14:46.149620>, duration=<TimeDelta object: scale='None' format='sec' value=86400.0>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>, fast_compute=True)[source]
Computes the
Targetmeridian transit time(s). This method returns all the transit times found in the time window ranging fromt_mintot_min + duration.- Parameters:
t_min (
Time) – Starting time of the temporal window within which meridian transits are looked for. Default is current time.duration (
TimeDelta) – Width of the temporal window within which meridian transits are looked for. Default is1 day.precision (
TimeDelta) – Temporal precision of the returned meridian transit values. Default is5 sec.fast_compute (
bool) – If set toTrue, a fast approximation is used during the computation of Local Sidereal Time. Default isTrue.
- Returns:
Meridian transit times. If no transit times are found (because the requested time window doesn’t contain any) an empty
Timeobject is returned.- Return type:
- Example:
>>> from nenupy.astro.target import FixedTarget >>> from astropy.time import Time, TimeDelta >>> cyg_a = FixedTarget.from_name("Cyg A") >>> cyg_a.meridian_transit( t_min=Time("2021-01-01"), duration=TimeDelta(86400*2, format="sec") ) <Time object: scale='utc' format='iso' value=['2021-01-01 13:05:47.868' '2021-01-02 13:01:51.882']>
See also
- next_meridian_transit(time=<Time object: scale='utc' format='datetime' value=2026-05-27 13:14:46.150118>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>, fast_compute=True)[source]
Computes the
Targetnext meridian transit time. This method returns the next transit time found aftertime.- Parameters:
time (
Time) – Relative time used to searching for the next meridian transit.precision (
TimeDelta) – Temporal precision of the returned meridian transit value. Default is5 sec.fast_compute (
bool) – If set toTrue, a fast approximation is used during the computation of Local Sidereal Time. Default isTrue.
- Returns:
Next meridian transit time.
- Return type:
- Example:
>>> from nenupy.astro.target import FixedTarget >>> from astropy.time import Time >>> cyg_a = FixedTarget.from_name("Cyg A") >>> cyg_a.next_meridian_transit( time=Time("2021-01-01 12:00:00") ) <Time object: scale='utc' format='iso' value=2021-01-01 13:05:47.868>
See also
- next_rise_time(time=<Time object: scale='utc' format='datetime' value=2026-05-27 13:14:46.150394>, elevation=<Quantity 0. deg>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>)[source]
Computes the
Targetnext rise time aboveelevation. This method returns the next rise time found aftertime.- Parameters:
- Returns:
Next rise time. If no rise time is found (because the source does not cross the elevation) an empty
Timeobject is returned.- Return type:
- Example:
>>> from nenupy.astro.target import FixedTarget >>> from astropy.time import Time, TimeDelta >>> import astropy.units as u >>> cyg_a = FixedTarget.from_name("Cyg A") >>> cyg_a.next_rise_time( time=Time("2021-01-01"), elevation=40*u.deg, ) <Time object: scale='utc' format='iso' value=2021-01-01 08:20:16.447>
See also
- next_set_time(time=<Time object: scale='utc' format='datetime' value=2026-05-27 13:14:46.150653>, elevation=<Quantity 0. deg>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>)[source]
Computes the
Targetnext set time belowelevation. This method returns the next set time found aftertime.- Parameters:
- Returns:
Next set time. If no set time is found (because the source does not cross the elevation) an empty
Timeobject is returned.- Return type:
- Example:
>>> from nenupy.astro.target import FixedTarget >>> from astropy.time import Time, TimeDelta >>> import astropy.units as u >>> cyg_a = FixedTarget.from_name("Cyg A") >>> cyg_a.next_set_time( time=Time("2021-01-01"), elevation=40*u.deg, ) <Time object: scale='utc' format='iso' value=2021-01-01 17:51:17.312>
See also
- plot(figname='', fig=None, return_ax=False, **kwargs)[source]
Plot the horizontal position of the Target as a scatter plot in polar coordinates.
- Parameters:
figname (
str, optional) – If anything is set (e.g.,"my_plot.png") the figure will be saved, by default""fig (:class:~`matplotlib.figure.Figure`, optional) – The parent figure, if nothing is provided a new figure is created, by default
Nonereturn_ax (
bool, optional) – Return the ax containing the plot, by defaultFalsefigsize ((
float,float), optional) – Figure size passed to matplotlib, by default(5, 5)markersize (
float, optional) – Size of the marker, by default30`cmap (
str, optional) – Colormap, by default"viridis"
- Returns:
The plot ax as defined by matplotlib
- Return type:
Example
>>> from nenupy.astro.target import FixedTarget >>> from astropy.time import Time, TimeDelta >>> import numpy as np >>> times = Time("2025-04-18T00:30:00") + np.arange(10) * TimeDelta(600, format="sec") >>> target = FixedTarget.from_name("Cyg A", time=times) >>> target.plot()
- previous_meridian_transit(time=<Time object: scale='utc' format='datetime' value=2026-05-27 13:14:46.150196>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>, fast_compute=True)[source]
Computes the
Targetprevious meridian transit time. This method returns the previous transit time found beforetime.- Parameters:
time (
Time) – Relative time used to searching for the previous meridian transit. Default is current time.precision (
TimeDelta) – Temporal precision of the returned meridian transit value. Default is5 sec.fast_compute (
bool) – If set toTrue, a fast approximation is used during the computation of Local Sidereal Time. Default isTrue.
- Returns:
Previous meridian transit time.
- Return type:
- Example:
>>> from nenupy.astro.target import FixedTarget >>> from astropy.time import Time >>> cyg_a = FixedTarget.from_name("Cyg A") >>> cyg_a.previous_meridian_transit( time=Time("2021-01-01 12:00:00") ) Time object: scale='utc' format='iso' value=2020-12-31 13:09:43.855>
See also
- previous_rise_time(time=<Time object: scale='utc' format='datetime' value=2026-05-27 13:14:46.150473>, elevation=<Quantity 0. deg>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>)[source]
Computes the
Targetprevious rise time aboveelevation. This method returns the previous rise time found aftertime.- Parameters:
- Returns:
Previous rise time. If no rise time is found (because the source does not cross the elevation) an empty
Timeobject is returned.- Return type:
- Example:
>>> from nenupy.astro.target import FixedTarget >>> from astropy.time import Time, TimeDelta >>> import astropy.units as u >>> cyg_a = FixedTarget.from_name("Cyg A") >>> cyg_a.previous_rise_time( time=Time("2021-01-01"), elevation=40*u.deg, ) <Time object: scale='utc' format='iso' value=2020-12-31 08:24:12.434>
See also
- previous_set_time(time=<Time object: scale='utc' format='datetime' value=2026-05-27 13:14:46.150728>, elevation=<Quantity 0. deg>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>)[source]
Computes the
Targetprevious set time belowelevation. This method returns the next set time found beforetime.- Parameters:
- Returns:
Previous set time. If no set time is found (because the source does not cross the elevation) an empty
Timeobject is returned.- Return type:
- Example:
>>> from nenupy.astro.target import FixedTarget >>> from astropy.time import Time, TimeDelta >>> import astropy.units as u >>> cyg_a = FixedTarget.from_name("Cyg A") >>> cyg_a.previous_set_time( time=Time("2021-01-01"), elevation=40*u.deg, ) <Time object: scale='utc' format='iso' value=2020-12-31 17:55:12.639>
See also
- rise_time(t_min=<Time object: scale='utc' format='datetime' value=2026-05-27 13:14:46.150280>, elevation=<Quantity 0. deg>, duration=<TimeDelta object: scale='None' format='sec' value=86400.0>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>)[source]
Computes the
Targetrise time(s) aboveelevation. This method returns all the rise times found in the time window ranging fromt_mintot_min + duration.- Parameters:
t_min (
Time) – Starting time of the temporal window within which rise times are looked for. Default is current time.elevation (
Quantity) – Elevation above which the rise time is computed. Default is0 deg.duration (
TimeDelta) – Width of the temporal window within which rise times are looked for. Default is1 day.precision (
TimeDelta) – Temporal precision of the returned meridian transit values. Default is5 sec.
- Returns:
Rise times above a given elevation. If no rise times are found (because the requested time window doesn’t contain any) an empty
Timeobject is returned.- Return type:
- Example:
>>> from nenupy.astro.target import FixedTarget >>> from astropy.time import Time, TimeDelta >>> import astropy.units as u >>> cyg_a = FixedTarget.from_name("Cyg A") >>> cyg_a.rise_time( t_min=Time("2021-01-01"), elevation=0*u.deg, duration=TimeDelta(86400*2, format="sec") ) <Time object: scale='utc' format='iso' value=['2021-01-01 02:28:51.926' '2021-01-02 02:24:56.599']>
See also
- separation(other)[source]
Computes the angular separation between two
Targetinstances. This method is a wrapper aroundastropy.coordinates.SkyCoord.separation().- Parameters:
other (
Target) – OtherTargetfrom which the angular separation should be computed.- Returns:
Angular separation.
- Return type:
- Example:
from nenupy.astro.target import FixedTarget, SolarSystemTarget from astropy.time import Time, TimeDelta import numpy as np src = FixedTarget.from_name("Cyg A") times = Time("2022-01-01T12:00:00") + np.arange(180)*TimeDelta(2, format="jd") seps = src.separation( SolarSystemTarget.from_name( "Sun", time=times ) )
- set_time(t_min=<Time object: scale='utc' format='datetime' value=2026-05-27 13:14:46.150549>, elevation=<Quantity 0. deg>, duration=<TimeDelta object: scale='None' format='sec' value=86400.0>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>)[source]
Computes the
Targetset time(s) belowelevation. This method returns all the set times found in the time window ranging fromt_mintot_min + duration.- Parameters:
t_min (
Time) – Starting time of the temporal window within which set times are looked for. Default is current time.elevation (
Quantity) – Elevation below which the set time is computed. Default is0 deg.duration (
TimeDelta) – Width of the temporal window within which set times are looked for. Default is1 day.precision (
TimeDelta) – Temporal precision of the returned meridian transit values. Default is5 sec.
- Returns:
Set times below a given elevation. If no set times are found (because the requested time window doesn’t contain any) an empty
Timeobject is returned.- Return type:
- Example:
>>> from nenupy.astro.target import FixedTarget >>> from astropy.time import Time, TimeDelta >>> import astropy.units as u >>> cyg_a = FixedTarget.from_name("Cyg A") >>> cyg_a.set_time( t_min=Time("2021-01-01"), elevation=0*u.deg, duration=TimeDelta(86400*2, format="sec") ) <Time object: scale='utc' format='iso' value=['2021-01-01 23:42:41.174' '2021-01-02 23:38:45.188']>
See also