nenupy.astro.target
Celestial Target
|
Class to handle astronomical targets outside the Solar System. |
|
Class to handle Solar System targets. |
- class nenupy.astro.target.FixedTarget(coordinates, time=<Time object: scale='utc' format='datetime' value=2024-05-03 08:29:42.530741>, observer=<EarthLocation (4323936.68522791, 165534.49991696, 4670345.36540385) m>)[source]
Bases:
Target
Class to handle astronomical targets outside the Solar System.
Added in version 2.0.0.
- Parameters:
coordinates (
SkyCoord
)observer (
EarthLocation
)time (
Time
)
Attributes Summary
coordinates
observer
Whether the celestial object is circumpolar at the observer's latitude.
Methods Summary
from_name
(name[, time, observer])Instantiates a
FixedTarget
object from a name that could be resolved by Simbad.separation
(other)Computes the angular separation between two
Target
instances.meridian_transit
([t_min, duration, ...])Computes the
Target
meridian transit time(s).next_meridian_transit
([time, precision, ...])Computes the
Target
next meridian transit time.previous_meridian_transit
([time, precision, ...])Computes the
Target
previous meridian transit time.azimuth_transit
([azimuth, t_min, duration, ...])Computes the
Target
transit time(s) at a givenazimuth
value.rise_time
([t_min, elevation, duration, ...])Computes the
Target
rise time(s) aboveelevation
.next_rise_time
([time, elevation, precision])Computes the
Target
next rise time aboveelevation
.previous_rise_time
([time, elevation, precision])Computes the
Target
previous rise time aboveelevation
.set_time
([t_min, elevation, duration, precision])Computes the
Target
set time(s) belowelevation
.next_set_time
([time, elevation, precision])Computes the
Target
next set time belowelevation
.previous_set_time
([time, elevation, precision])Computes the
Target
previous set time belowelevation
.Attributes and Methods Documentation
- classmethod from_name(name, time=<Time object: scale='utc' format='datetime' value=2024-05-03 08:29:42.530844>, observer=<EarthLocation (4323936.68522791, 165534.49991696, 4670345.36540385) m>)[source]
Instantiates a
FixedTarget
object from a name that could be resolved by Simbad.- Parameters:
name (
str
) – Source name.time (
Time
) – Time at which the source is looked at. Default is current time.observer (
EarthLocation
) – Earth location from where the source is observed. Default is NenuFAR’s location.
- Returns:
FixedTarget
instance.- Return type:
- Example:
>>> from nenupy.astro.target import FixedTarget >>> cyg_a = FixedTarget.from_name("Cyg A")
- property horizontal_coordinates
- class nenupy.astro.target.SolarSystemTarget(name, coordinates, time=<Time object: scale='utc' format='datetime' value=2024-05-03 08:29:42.531016>, observer=<EarthLocation (4323936.68522791, 165534.49991696, 4670345.36540385) m>)[source]
Bases:
Target
Class to handle Solar System targets.
Added in version 2.0.0.
Attributes Summary
coordinates
observer
Whether the celestial object is circumpolar at the observer's latitude.
Methods Summary
from_name
(name[, time, observer])separation
(other)Computes the angular separation between two
Target
instances.meridian_transit
([t_min, duration, ...])Computes the
Target
meridian transit time(s).next_meridian_transit
([time, precision, ...])Computes the
Target
next meridian transit time.previous_meridian_transit
([time, precision, ...])Computes the
Target
previous meridian transit time.azimuth_transit
([azimuth, t_min, duration, ...])Computes the
Target
transit time(s) at a givenazimuth
value.rise_time
([t_min, elevation, duration, ...])Computes the
Target
rise time(s) aboveelevation
.next_rise_time
([time, elevation, precision])Computes the
Target
next rise time aboveelevation
.previous_rise_time
([time, elevation, precision])Computes the
Target
previous rise time aboveelevation
.set_time
([t_min, elevation, duration, precision])Computes the
Target
set time(s) belowelevation
.next_set_time
([time, elevation, precision])Computes the
Target
next set time belowelevation
.previous_set_time
([time, elevation, precision])Computes the
Target
previous set time belowelevation
.Attributes and Methods Documentation
- classmethod from_name(name, time=<Time object: scale='utc' format='datetime' value=2024-05-03 08:29:42.531119>, observer=<EarthLocation (4323936.68522791, 165534.49991696, 4670345.36540385) m>)[source]
- property horizontal_coordinates
- class nenupy.astro.target.Target(coordinates, observer=<EarthLocation (4323936.68522791, 165534.49991696, 4670345.36540385) m>, time=<Time object: scale='utc' format='datetime' value=2024-05-03 08:29:42.528451>)[source]
Bases:
AstroObject
,ABC
Abstract class to handle target objects.
Added in version 2.0.0.
Attributes Summary
coordinates
observer
Whether the celestial object is circumpolar at the observer's latitude.
Methods Summary
separation
(other)Computes the angular separation between two
Target
instances.meridian_transit
([t_min, duration, ...])Computes the
Target
meridian transit time(s).next_meridian_transit
([time, precision, ...])Computes the
Target
next meridian transit time.previous_meridian_transit
([time, precision, ...])Computes the
Target
previous meridian transit time.azimuth_transit
([azimuth, t_min, duration, ...])Computes the
Target
transit time(s) at a givenazimuth
value.rise_time
([t_min, elevation, duration, ...])Computes the
Target
rise time(s) aboveelevation
.next_rise_time
([time, elevation, precision])Computes the
Target
next rise time aboveelevation
.previous_rise_time
([time, elevation, precision])Computes the
Target
previous rise time aboveelevation
.set_time
([t_min, elevation, duration, precision])Computes the
Target
set time(s) belowelevation
.next_set_time
([time, elevation, precision])Computes the
Target
next set time belowelevation
.previous_set_time
([time, elevation, precision])Computes the
Target
previous set time belowelevation
.Attributes and Methods Documentation
- azimuth_transit(azimuth=<Quantity 180. deg>, t_min=<Time object: scale='utc' format='datetime' value=2024-05-03 08:29:42.528963>, duration=<TimeDelta object: scale='None' format='sec' value=86400.0>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>)[source]
Computes the
Target
transit time(s) at a givenazimuth
value. This method returns all the transit times found in the time window ranging fromt_min
tot_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 emptyTime
object 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 culmination_azimuth
- 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=2024-05-03 08:29:42.528649>, 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
Target
meridian transit time(s). This method returns all the transit times found in the time window ranging fromt_min
tot_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
Time
object 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=2024-05-03 08:29:42.529206>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>, fast_compute=True)[source]
Computes the
Target
next 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=2024-05-03 08:29:42.529779>, elevation=<Quantity 0. deg>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>)[source]
Computes the
Target
next 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
Time
object 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=2024-05-03 08:29:42.530361>, elevation=<Quantity 0. deg>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>)[source]
Computes the
Target
next 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
Time
object 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
- previous_meridian_transit(time=<Time object: scale='utc' format='datetime' value=2024-05-03 08:29:42.529371>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>, fast_compute=True)[source]
Computes the
Target
previous 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=2024-05-03 08:29:42.529953>, elevation=<Quantity 0. deg>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>)[source]
Computes the
Target
previous 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
Time
object 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=2024-05-03 08:29:42.530531>, elevation=<Quantity 0. deg>, precision=<TimeDelta object: scale='None' format='sec' value=5.0>)[source]
Computes the
Target
previous 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
Time
object 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=2024-05-03 08:29:42.529532>, 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
Target
rise time(s) aboveelevation
. This method returns all the rise times found in the time window ranging fromt_min
tot_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
Time
object 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
Target
instances. This method is a wrapper aroundastropy.coordinates.SkyCoord.separation()
.- Parameters:
other (
Target
) – OtherTarget
from 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=2024-05-03 08:29:42.530130>, 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
Target
set time(s) belowelevation
. This method returns all the set times found in the time window ranging fromt_min
tot_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
Time
object 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
- property time