Skip to main content

Zodipy is a python tool that simulates the Zodiacal emission.

Project description

PyPI version Tests astropy


Zodipy is a Python simulation tool for Zodiacal Emission (Interplanetary Dust Emission). It allows you to compute the simulated emission in a timestream, or at an instant in time.

plot

Installing

Zodipy is available at PyPI and can be installed with pip install zodipy.

Features

The full set of features and use-cases will be documentated in the nearby future.

Initializing an Interplantery Dust Model: Zodipy implements the Kelsall et al. (1998) Interplanetary Dust Model. Additionally, it is possible to include the various emissivity fits from the Planck collaboration.

import zodipy

# Other options for models are "K98" (default), "Planck13", "Planck15"
model = zodipy.InterplanetaryDustModel(model="Planck18")

Instantaneous emission: We can make a map of the simulated instantaneous emission seen by an observer using the get_instantaneous_emission function, which queries the observer position given an epoch through the JPL Horizons API:

import healpy as hp
import astropy.units as u

emission = model.get_instantaneous_emission(
    800*u.GHz, 
    nside=256, 
    observer="Planck", 
    epochs=59215,  # 2010-01-01 (iso) in MJD
    coord_out="G"
)

hp.mollview(emission, norm="hist")

plot

The epochs input must follow the convention used in astroquery. If multiple dates are passed to the function, the returned emission becomes the average over all instantaneous maps.

Additionally, it is possible to retrieve the emission component-wise by setting return_comps=True in the function call. Following is an example of what the simulated emission seen from L2 for each component is at 6th of October 2021.

plot

Time-ordered emission: We can make a time-stream of simulated emission for a sequence of time-ordered pixels using the get_time_ordered_emission function. This requires specifying the heliocentric ecliptic cartesian position of the observer (and optionally the Earth) associated with each chunk of pixels. In the following we use the first day of time-ordered pixels from the DIRBE instrument of the COBE satellite (Photometric Band 6, Detector A, first day of observations) to make a simulated time-stream:

import astropy.units as u
import matplotlib.pyplot as plt
import zodipy

model = zodipy.InterplanetaryDustModel()

dirbe_pixels = ...
dirbe_position = ...  
earth_position = ...  

timestream = model.get_time_ordered_emission(
    25*u.micron
    nside=128,
    pixels=dirbe_pixels,
    observer_coordinates=dirbe_position,
    earth_coordinates=earth_position
)

plt.plot(timestream)

plot

Binned time-ordered emission: By setting bin=True in the function call, the simulated emission is binned into a map. In the following, we compare Zodipy simulations with the observed time-ordered data by DIRBE.

import astropy.units as u
import matplotlib.pyplot as plt
import zodipy

model = zodipy.InterplanetaryDustModel()

dirbe_pixel_chunks = [...]
dirbe_positions = [...]
earth_positions = [...]

emission = np.zeros(hp.nside2npix(nside))
hits_map = np.zeros(hp.nside2npix(nside))   
    
for day, (pixels, dirbe_position, earth_position) in enumerate(
    zip(dirbe_pixel_chunks, dirbe_positions, earth_positions),
    start=1
):
    
    unique_pixels, counts = np.unique(pixels, return_counts=True)
    hits_map[unique_pixels] += counts

    emission += model.get_time_ordered_emission(
        25*u.micron,
        nside=128,
        pixels=pixels,
        observer_position=dirbe_position,
        earth_position=earth_positions,
        bin=True
    )

    # We make a plot for each week.
    if day % 7 == 0:
        zodi_emission /= hits_map
        hp.mollview(zodi_emission)

        # Reset emission and hits map for next week
        emission = np.zeros(hp.nside2npix(nside)) 
        hits_map = np.zeros(hp.nside2npix(nside)) 
DIRBE TOD Zodipy TOD Simulation
plot plot

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zodipy-0.3.3.tar.gz (66.8 kB view hashes)

Uploaded Source

Built Distribution

zodipy-0.3.3-py3-none-any.whl (69.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page