[AstroPy] How to separate %H %M %S in LST CALCULATION

Miro Saide mirosaide at gmail.com
Tue Feb 15 11:16:53 EST 2022


Thanks, Mohammad

It works.



*Ramiro Caisse Saide*
*MPhil Research Student*
Department of Physics
University of Mauritius
Contact Number: +258 845672884
Email: ramiro.saide at umail.uom.mu




Mohammad Shameoni Niaei <m.shemuni at gmail.com> escreveu no dia domingo,
13/02/2022 à(s) 03:50:

> Hello Mario
>
> Since the time_LST_set is an hourangle type, you can use hms to return it
> as an hms_tuple.
>
> The hms_tuple has h, m and s attributes which I believe is what you are
> looking for.
>
> print(time_LST_rise.hms)
> print(time_LST_rise.hms.h)
> print(time_LST_rise.hms.m)
> print(time_LST_rise.hms.s)
>
> see:
> https://docs.astropy.org/en/stable/_modules/astropy/coordinates/angles.html
>
>
>
>
>
>
>
>
>
> On Fri, Feb 11, 2022 at 1:50 PM Miro Saide <mirosaide at gmail.com> wrote:
>
>> Hi all
>>
>> I am calculating local sidereal time and I wonder how can I split the
>> output to have hours, minutes and seconds and the put it in iso format.
>> The code example is below:
>>
>> import numpy as np
>> import astropy.units as u
>> from astropy.time import Time
>> from astropy.coordinates import SkyCoord, EarthLocation, AltAz
>> from astroplan import Observer, FixedTarget
>>
>> target = SkyCoord.from_name("Barnard's star")
>> time = Time("2021-9-21 00:00:00", scale='utc')
>> Location = Observer(latitude=65.033*u.deg, longitude=-18.536*u.deg)
>>
>> star_rise_time = Location.target_rise_time(time, target, which='previous')
>> star_set_time = Location.target_set_time(time, target, which='next')
>>
>> print(star_rise_time.iso)
>> print(star_set_time.iso)
>>
>> time_LST_rise = Location.local_sidereal_time(star_rise_time,'mean',
>> model=None)
>> time_LST_set = Location.local_sidereal_time(star_set_time,'mean',
>> model=None)
>> print(time_LST_rise)
>> print(time_LST_set)
>>
>> Thanks in advance.
>>
>> *Ramiro Caisse Saide*
>> *MPhil Research Student*
>> Department of Physics
>> University of Mauritius
>> Contact Number: +258 845672884
>> Email: ramiro.saide at umail.uom.mu
>>
>>
>> _______________________________________________
>> AstroPy mailing list
>> AstroPy at python.org
>> https://mail.python.org/mailman/listinfo/astropy
>>
>
>
> --
> Mohammad Shameoni Niaei
> Astronomer
> Atatürk University, Astrophysics Research and Application Center.
> ERZURUM-TURKEY
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org
> https://mail.python.org/mailman/listinfo/astropy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/astropy/attachments/20220215/6d7e063e/attachment.html>


More information about the AstroPy mailing list