-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from Cosmoglobe/astropy_healpix
Replace healpy with astropy-healpi. Add new API to directly support SkyCoord objects. Move freq and weights arguments to Zodipy object initialization and away from methods
- Loading branch information
Showing
31 changed files
with
1,005 additions
and
847 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
import astropy.units as u | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
from astropy.coordinates import BarycentricMeanEcliptic, SkyCoord | ||
from astropy.time import Time | ||
|
||
from zodipy import Zodipy | ||
|
||
model = Zodipy("dirbe") | ||
model = Zodipy() | ||
|
||
latitudes = np.linspace(-90, 90, 10000) * u.deg | ||
longitudes = np.zeros_like(latitudes) | ||
# Longitude and Latitude values corresponding to a scan through the eclitpic plane | ||
lats = np.linspace(-90, 90, 100) * u.deg | ||
lons = np.zeros_like(lats) | ||
|
||
emission = model.get_emission_ang( | ||
30 * u.micron, | ||
theta=longitudes, | ||
phi=latitudes, | ||
lonlat=True, | ||
obs_time=Time("2022-06-14"), | ||
obs="earth", | ||
obs_time = Time("2022-06-14") | ||
|
||
# The SkyCoord object needs to include the coordinate frame and time of observation | ||
coords = SkyCoord( | ||
lons, | ||
lats, | ||
frame=BarycentricMeanEcliptic, | ||
obstime=obs_time, | ||
) | ||
|
||
emission = model.get_emission_skycoord(coords, freq=30 * u.micron) | ||
|
||
plt.plot(latitudes, emission) | ||
plt.plot(lats, emission) | ||
plt.xlabel("Latitude [deg]") | ||
plt.ylabel("Emission [MJy/sr]") | ||
plt.savefig("../img/timestream.png", dpi=300) | ||
plt.show() |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.