astropy / astroplan

Observation planning package for astronomers – maintainer @bmorris3
https://astroplan.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
199 stars 109 forks source link

How can I get the rise and set time in Greenwich Mean Sidereal Time (GMST)? #510

Closed mirosaide closed 3 years ago

mirosaide commented 3 years ago

Hi,

I am calculating the rise and set of Barnard's star for different locations on the globe. But my output is in Universal time. I wonder how can I get the output in GMST?

The code is below:

`` from astropy.visualization import astropy_mpl_style, quantity_support plt.style.use(astropy_mpl_style) quantity_support() import astropy.units as u from astropy.time import Time from astropy.coordinates import SkyCoord, EarthLocation, AltAz from astroplan import Observer, FixedTarget from astropy.time import Time from astroplan import download_IERS_A download_IERS_A

time = Time("2020-05-12 00:00:00",format='iso') target = SkyCoord.from_name("Barnard's star") Location = Observer(latitude=42.248u.deg, longitude=-122.567u.deg) star_rise_time = Location.target_rise_time(time, target, which='nearest') star_set_time = Location.target_set_time(time, target, which='nearest')

bmorris3 commented 3 years ago

Converting the rise/set times to sidereal time can be accomplished with the astropy machinery documented here: https://docs.astropy.org/en/stable/time/index.html#getting-started. Since this isn't an astroplan issue I'm closing it, but feel free to ask more questions if you need!