-
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.
- Loading branch information
Showing
1 changed file
with
15 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,30 @@ | ||
from multiprocessing import cpu_count | ||
|
||
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", n_proc=cpu_count()) | ||
model = Zodipy() | ||
|
||
# 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) | ||
|
||
latitudes = np.linspace(-90, 90, 10000) * u.deg | ||
longitudes = np.zeros_like(latitudes) | ||
obs_time = Time("2022-06-14") | ||
|
||
emission = model.get_emission_ang( | ||
theta=longitudes, | ||
phi=latitudes, | ||
freq=30 * u.micron, | ||
lonlat=True, | ||
obs_time=Time("2022-06-14"), | ||
obs_pos="earth", | ||
# 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.show() |