Debian Codegraph @

docs/getting_started.rst

raw
1 .. _getting_started:
2
3 ***************
4 Getting Started
5 ***************
6
7 General Guidelines
8 ==================
9
10 `astroplan` is based on `astropy <https://astropy.org>`__ and was built around the creation of Python
11 objects that contain all the information needed to perform certain tasks. You,
12 the user, will create and manipulate these objects to plan your observation. For
13 instance, an `~astroplan.Target` object contains information associated with
14 targets, such as right ascension, declination, etc.
15
16 Objects representing celestial bodies like stars (which, if we ignore proper
17 motion, are fixed on the celestial sphere) are created (or "instantiated") via
18 an `~astroplan.FixedTarget` object::
19
20 from astropy.coordinates import SkyCoord
21 from astroplan import FixedTarget
22
23 coordinates = SkyCoord('19h50m47.6s', '+08d52m12.0s', frame='icrs')
24 altair = FixedTarget(name='Altair', coord=coordinates)
25
26 Alternatively, for objects known to the CDS name resolver, you can quickly
27 retrieve their coordinates with `~astroplan.FixedTarget.from_name`::
28
29 altair = FixedTarget.from_name('Altair')
30
31 Similarly, an `~astroplan.Observer` object contains information about the
32 observatory, telescope or place where you are observing, such as longitude,
33 latitude, elevation and other optional parameters. You can initialize an
34 `~astroplan.Observer` object via the `~astroplan.Observer.at_site` class
35 method::
36
37 from astroplan import Observer
38 observer = Observer.at_site('subaru')
39
40 Or you can specify your own location parameters::
41
42 import astropy.units as u
43 from astropy.coordinates import EarthLocation
44 from pytz import timezone
45 from astroplan import Observer
46
47 longitude = '-155d28m48.900s'
48 latitude = '+19d49m42.600s'
49 elevation = 4163 * u.m
50 location = EarthLocation.from_geodetic(longitude, latitude, elevation)
51
52 observer = Observer(name='Subaru Telescope',
53 location=location,
54 pressure=0.615 * u.bar,
55 relative_humidity=0.11,
56 temperature=0 * u.deg_C,
57 timezone=timezone('US/Hawaii'),
58 description="Subaru Telescope on Maunakea, Hawaii")
59
60 `astroplan` makes heavy use of certain `astropy <https://astropy.org>`__ machinery, including the
61 `~astropy.coordinates` objects and transformations and
62 `~astropy.units`. Most importantly for basic use of `astroplan` is the
63 representation of dates/times as `~astropy.time.Time` objects (note that
64 these are in the UTC timezone by default)::
65
66 from astropy.time import Time
67 time = Time(['2015-06-16 06:00:00'])
68
69
70 Doing More
71 ==========
72
73 Now that you know the basics of working with `astroplan`, check out our
74 :ref:`tutorials` page for high-level examples of using `astroplan`, as well as
75 the :ref:`api` section for more exhaustive documentation and lower-level usage
76 examples.