Coverage for hiperta_stream/scripts/load_astropy.py: 93%

14 statements  

« prev     ^ index     » next       coverage.py v7.4.3, created at 2024-07-16 10:16 +0000

1#!/usr/bin/env python 

2#S. Caroff 

3 

4""" 

5Script to Load Astropy stuff 

6 

7Usage: 

8$> python Load_astropy.py 

9""" 

10 

11 

12from astropy.time import Time 

13from astropy.coordinates import SkyCoord, EarthLocation, AltAz 

14import astropy.units as u 

15 

16 

17def main(): 

18 location = EarthLocation.from_geodetic(-17.89139 * u.deg, 28.76139 * u.deg, 2184 * u.m) 

19 reco_alt = [0.36]*u.rad 

20 reco_az = [0.36]*u.rad 

21 pointing_alt = [0.36]*u.rad 

22 pointing_az = [0.36]*u.rad 

23 

24 src_sky_pos = SkyCoord(alt=reco_alt, 

25 az=reco_az, 

26 frame=AltAz( 

27 obstime=Time(Time.now().to_value(format='unix'), 

28 format='unix', 

29 scale="utc"), 

30 location=location) 

31 ).transform_to(frame='icrs') 

32 print("pointing_alt:", pointing_alt, ", pointing_az:",pointing_az, ", src_sky_pos:",src_sky_pos) 

33 

34if __name__ == '__main__': 

35 main()