This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from astropy.coordinates import SkyCoord, EarthLocation | |
from astropy import units as u | |
from astropy.time import Time | |
def helio_to_bary(coords, hjd, obs_name): | |
helio = Time(hjd, scale='utc', format='jd') | |
obs = EarthLocation.of_site(obs_name) | |
star = SkyCoord(coords, unit=(u.hour, u.deg)) | |
ltt = helio.light_travel_time(star, 'heliocentric', location=obs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Contains some faster coordinate transformations than the ones currently used in astropy. | |
This is based on an idea put forward by @bwinkel in the pull request located at | |
at https://github.com/astropy/astropy/pull/6068. This may be merged into the astropy | |
master at some point. If this happens, this module can be removed. | |
Simply import into code to experience the speedups; the astropy coordinate transforms are | |
overwritten on modeul import. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import OrderedDict | |
import copy | |
import operator | |
from astropy.time import Time | |
class TimeSeries: | |
def __init__(self, time, data=None, **kwargs): | |
if not isinstance(time, Time): | |
raise ValueError('time must be an astropy Time') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from astropy.coordinates import SkyCoord, EarthLocation | |
from astropy.coordinates.tests.utils import randomly_sample_sphere | |
from astropy.time import Time | |
import numpy as np | |
# 1000 random locations on the sky | |
ra, dec, _ = randomly_sample_sphere(1000) | |
coos = SkyCoord(ra, dec) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from astropy import coordinates as coord | |
from astropy.time import Time | |
from astropy import units as u | |
lapalma = coord.EarthLocation.of_site('lapalma') | |
times = Time.now() + u.minute*np.linspace(-720, 720, 1440) | |
altaz_frame = coord.AltAz(location=lapalma, obstime=times) | |
sun = coord.get_body('sun', location=lapalma, time=times) | |
moon = coord.get_body('moon', location=lapalma, time=times) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from trm import observing | |
from astropy.coordinates import SkyCoord, EarthLocation | |
from astropy import units as u | |
from astropy.time import Time | |
from astroplan import Observer, ObservingBlock, FixedTarget | |
from astroplan.scheduling import (Schedule, Transitioner, TransitionBlock, | |
PriorityScheduler, SequentialScheduler) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from astropy import units as u | |
from astropy import coordinates as coord | |
from astropy.time import Time | |
from astropy.coordinates.solar_system import get_body_barycentric_posvel | |
from astropy.coordinates.matrix_utilities import matrix_product | |
from astropy.coordinates.representation import CartesianRepresentation ,UnitSphericalRepresentation | |
from astropy.coordinates.builtin_frames import GCRS | |
from astropy.coordinates import SkyCoord, solar_system, EarthLocation, ICRS | |
KPS = u.km/u.s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from astropy.time import Time | |
from astropy.coordinates import SkyCoord, solar_system, EarthLocation, ICRS | |
from astropy import units as u | |
def velcorr(time, skycoord, location=None): | |
"""Barycentric velocity correction. | |
Uses the ephemeris set with ``astropy.coordinates.solar_system_ephemeris.set`` for corrections. | |
For more information see `~astropy.coordinates.solar_system_ephemeris`. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global define*/ | |
/** | |
* To load this extension, add the following to your custom.js: | |
* | |
* require(['base/js/events'], function (events) { | |
* events.on('app_initialized.NotebookApp', function() { | |
* IPython.load_extensions('nbgrader'); | |
* }); | |
* }); | |
* |