Skip to content

Commit

Permalink
Updates docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MetinSa committed Apr 27, 2024
1 parent 2062d48 commit 53a1a1f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 28 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ ZodiPy is installed using `pip install zodipy`.
## Dependencies
ZodiPy supports all Python versions >= 3.9, and has the following dependencies:
- [Astropy](https://www.astropy.org/) (>=5.0.1)
- [Astropy-healpix](https://astropy-healpix.readthedocs.io/en/latest/)
- [NumPy](https://numpy.org/)
- [healpy](https://healpy.readthedocs.io/en/latest/)
- [jplephem](https://pypi.org/project/jplephem/)
- [SciPy](https://scipy.org/)

Expand All @@ -67,6 +67,7 @@ Contributing developers will need to download the following additional dependenc
- pytest
- pytest-cov
- hypothesis
- healpy
- coverage
- ruff
- mypy
Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pip install zodipy
ZodiPy has the following dependencies (these are automatically downloaded alongside ZodiPy):

- [Astropy](https://www.astropy.org) (>= 5.0.1)
- [Astropy-healpix](https://astropy-healpix.readthedocs.io/en/latest/)
- [NumPy](https://numpy.org)
- [healpy](https://healpy.readthedocs.io/en/latest/)
- [jplehem](https://pypi.org/project/jplephem/)
- [SciPy](https://scipy.org/)
7 changes: 4 additions & 3 deletions zodipy/_line_of_sight.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
if TYPE_CHECKING:
import numpy.typing as npt

from zodipy._types import Float

DIRBE_CUTOFFS: dict[ComponentLabel, tuple[float | np.float64, float]] = {
DIRBE_CUTOFFS: dict[ComponentLabel, tuple[Float, Float]] = {
ComponentLabel.CLOUD: (R_0, R_JUPITER),
ComponentLabel.BAND1: (R_0, R_JUPITER),
ComponentLabel.BAND2: (R_0, R_JUPITER),
Expand All @@ -21,7 +22,7 @@
ComponentLabel.FEATURE: (R_EARTH - 0.2, R_EARTH + 0.2),
}

RRM_CUTOFFS: dict[ComponentLabel, tuple[float | np.float64, float]] = {
RRM_CUTOFFS: dict[ComponentLabel, tuple[Float, Float]] = {
ComponentLabel.FAN: (R_0, RRM[ComponentLabel.FAN].R_outer), # type: ignore
ComponentLabel.INNER_NARROW_BAND: (
RRM[ComponentLabel.INNER_NARROW_BAND].R_inner, # type: ignore
Expand Down Expand Up @@ -78,7 +79,7 @@ def get_sphere_intersection(
return np.maximum(q, c / q)


def get_line_of_sight_start_and_stop_distances(
def get_line_of_sight_range(
components: Iterable[ComponentLabel],
unit_vectors: npt.NDArray[np.float64],
obs_pos: npt.NDArray[np.float64],
Expand Down
3 changes: 3 additions & 0 deletions zodipy/_types.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import Sequence, Union

import astropy.units as u
Expand All @@ -8,3 +10,4 @@
SkyAngles = Union[u.Quantity[u.deg], u.Quantity[u.rad]]
FrequencyOrWavelength = Union[u.Quantity[u.Hz], u.Quantity[u.m]]
ParameterDict = dict
Float = Union[float, np.floating]
52 changes: 29 additions & 23 deletions zodipy/zodipy.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from zodipy._interpolate_source import SOURCE_PARAMS_MAPPING
from zodipy._ipd_comps import ComponentLabel
from zodipy._ipd_dens_funcs import construct_density_partials_comps
from zodipy._line_of_sight import get_line_of_sight_start_and_stop_distances
from zodipy._line_of_sight import get_line_of_sight_range
from zodipy._validators import get_validated_ang
from zodipy.model_registry import model_registry

Expand Down Expand Up @@ -136,9 +136,9 @@ def get_emission_skycoord(
must be strictly increasing.
weights: Bandpass weights corresponding the the frequencies in `freq`. The weights
are assumed to be given in spectral radiance units (Jy/sr).
obs_pos: The heliocentric ecliptic position of the observer in AU, or a string
representing an observer in the `astropy.coordinates.solar_system_ephemeris`.
This should correspond to a single position. Defaults to 'earth'.
obs_pos: The heliocentric ecliptic position of the observer, or a string representing
an observer in the `astropy.coordinates.solar_system_ephemeris`. This should
correspond to a single position. Defaults to 'earth'.
return_comps: If True, the emission is returned component-wise. Defaults to False.
Returns:
Expand All @@ -151,7 +151,10 @@ def get_emission_skycoord(
axis=1,
)
coord = coords.SkyCoord(
unique_lon * units.deg, unique_lat * units.deg, frame=coord.frame, obstime=coord.obstime
unique_lon * units.deg,
unique_lat * units.deg,
frame=coord.frame,
obstime=coord.obstime,
)

return self._compute_emission(
Expand Down Expand Up @@ -195,9 +198,9 @@ def get_emission_ang(
a bandpass over which to evaluate the zodiacal emission. The frequencies
must be strictly increasing.
obs_time: Time of observation. This should be a single observational time.
obs_pos: The heliocentric ecliptic position of the observer in AU, or a string
representing an observer in the `astropy.coordinates.solar_system_ephemeris`.
This should correspond to a single position. Defaults to 'earth'.
obs_pos: The heliocentric ecliptic position of the observer, or a string representing
an observer in the `astropy.coordinates.solar_system_ephemeris`. This should
correspond to a single position. Defaults to 'earth'.
coord_in: Coordinate frame of the input pointing. Assumes 'E' (ecliptic
coordinates) by default.
weights: Bandpass weights corresponding the the frequencies in `freq`. The weights
Expand Down Expand Up @@ -248,9 +251,9 @@ def get_emission_pix(
a bandpass over which to evaluate the zodiacal emission. The frequencies
must be strictly increasing.
obs_time: Time of observation. This should be a single observational time.
obs_pos: The heliocentric ecliptic position of the observer in AU, or a string
representing an observer in the `astropy.coordinates.solar_system_ephemeris`.
This should correspond to a single position. Defaults to 'earth'.
obs_pos: The heliocentric ecliptic position of the observer, or a string representing
an observer in the `astropy.coordinates.solar_system_ephemeris`. This should
correspond to a single position. Defaults to 'earth'.
coord_in: Coordinate frame of the input pointing. Assumes 'E' (ecliptic
coordinates) by default.
weights: Bandpass weights corresponding the the frequencies in `freq`. The weights
Expand Down Expand Up @@ -302,9 +305,9 @@ def get_binned_emission_skycoord(
must be strictly increasing.
weights: Bandpass weights corresponding the the frequencies in `freq`. The weights
are assumed to be given in spectral radiance units (Jy/sr).
obs_pos: The heliocentric ecliptic position of the observer in AU, or a string
representing an observer in the `astropy.coordinates.solar_system_ephemeris`.
This should correspond to a single position. Defaults to 'earth'.
obs_pos: The heliocentric ecliptic position of the observer, or a string representing
an observer in the `astropy.coordinates.solar_system_ephemeris`. This should
correspond to a single position. Defaults to 'earth'.
return_comps: If True, the emission is returned component-wise. Defaults to False.
solar_cut: Cutoff angle from the sun. The emission for all the pointing with angular
distance between the sun smaller than `solar_cut` are masked. Defaults to `None`.
Expand All @@ -319,7 +322,10 @@ def get_binned_emission_skycoord(
axis=1,
)
coord = coords.SkyCoord(
unique_lon * units.deg, unique_lat * units.deg, frame=coord.frame, obstime=coord.obstime
unique_lon * units.deg,
unique_lat * units.deg,
frame=coord.frame,
obstime=coord.obstime,
)
healpix = hp.HEALPix(nside, order="ring", frame=coord.frame)
return self._compute_emission(
Expand All @@ -343,7 +349,7 @@ def get_binned_emission_ang(
nside: int,
freq: units.Quantity,
obs_time: time.Time,
obs_pos: units.Quantity[units.AU] | str = "earth",
obs_pos: units.Quantity | str = "earth",
coord_in: Literal["E", "G", "C"] = "E",
weights: npt.ArrayLike | None = None,
return_comps: bool = False,
Expand All @@ -367,9 +373,9 @@ def get_binned_emission_ang(
a bandpass over which to evaluate the zodiacal emission. The frequencies
must be strictly increasing.
obs_time: Time of observation. This should be a single observational time.
obs_pos: The heliocentric ecliptic position of the observer in AU, or a string
representing an observer in the `astropy.coordinates.solar_system_ephemeris`.
This should correspond to a single position. Defaults to 'earth'.
obs_pos: The heliocentric ecliptic position of the observer, or a string representing
an observer in the `astropy.coordinates.solar_system_ephemeris`. This should
correspond to a single position. Defaults to 'earth'.
coord_in: Coordinate frame of the input pointing. Assumes 'E' (ecliptic
coordinates) by default.
weights: Bandpass weights corresponding the the frequencies in `freq`. The weights
Expand Down Expand Up @@ -432,9 +438,9 @@ def get_binned_emission_pix(
a bandpass over which to evaluate the zodiacal emission. The frequencies
must be strictly increasing.
obs_time: Time of observation. This should be a single observational time.
obs_pos: The heliocentric ecliptic position of the observer in AU, or a string
representing an observer in the `astropy.coordinates.solar_system_ephemeris`.
This should correspond to a single position. Defaults to 'earth'.
obs_pos: The heliocentric ecliptic position of the observer, or a string representing
an observer in the `astropy.coordinates.solar_system_ephemeris`. This should
correspond to a single position. Defaults to 'earth'.
coord_in: Coordinate frame of the input pointing. Assumes 'E' (ecliptic
coordinates) by default.
weights: Bandpass weights corresponding the the frequencies in `freq`. The weights
Expand Down Expand Up @@ -499,7 +505,7 @@ def _compute_emission(

# Get the integration limits for each zodiacal component (which may be
# different or the same depending on the model) along all line of sights.
start, stop = get_line_of_sight_start_and_stop_distances(
start, stop = get_line_of_sight_range(
components=self._ipd_model.comps.keys(),
unit_vectors=unit_vectors,
obs_pos=obs_skycoord.cartesian.xyz.value,
Expand Down

0 comments on commit 53a1a1f

Please sign in to comment.