Skip to content

Commit

Permalink
Added possibility to use hours as stepsize
Browse files Browse the repository at this point in the history
  • Loading branch information
MetinSa committed Aug 16, 2021
1 parent 199275e commit c3e08b4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions zodipy/_coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

@functools.lru_cache
def get_target_coordinates(
target: str, start: datetime, stop:datetime = None, step: int = 1
target: str, start: datetime, stop:datetime = None, step: str = '1d'
) -> np.ndarray:
"""Returns the heliocentric cartesian coordinates of the target.
Expand Down Expand Up @@ -48,7 +48,7 @@ def get_target_coordinates(
else:
stop_ = stop

epochs = dict(start=str(start), stop=str(stop_), step=f'{step}d')
epochs = dict(start=str(start), stop=str(stop_), step=f'{step}')
query = Horizons(id=target, id_type='majorbody', location='c@sun', epochs=epochs)
ephemerides = query.ephemerides()

Expand Down
5 changes: 2 additions & 3 deletions zodipy/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def simulate(self, nside: int, freq: float, mask: float) -> np.ndarray:
pixels = self.get_observed_pixels(X_observer, X_unit, ang=mask)

components = self.model.components
emissivities = self.model.emissivities

# The emission is initialized as NANs representing unobserved pixels
emission = np.zeros((n_observations, len(components), npix)) + np.NAN
Expand All @@ -144,9 +145,7 @@ def simulate(self, nside: int, freq: float, mask: float) -> np.ndarray:
comp_emission, R, dx=integration_config.dR, axis=0
)

comp_emissivity = self.model.emissivities.get_emissivity(
comp_name, freq
)
comp_emissivity = emissivities.get_emissivity(comp_name, freq)
integrated_comp_emission *= comp_emissivity

emission[observation_idx, comp_idx, observed_pixels] = integrated_comp_emission
Expand Down
7 changes: 4 additions & 3 deletions zodipy/zodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(
observer: Optional[str] = 'L2',
start: Optional[datetime] = datetime.now().date(),
stop: Optional[datetime] = None,
step: Optional[int] = 1,
step: Optional[str] = '1d',
model: Optional[str] = 'planck 2018',
integration_config: Optional[str] = 'default'
) -> None:
Expand All @@ -43,8 +43,9 @@ def __init__(
Datetime object represetning the time when the observation ended.
If None, the observation is assumed to only occur on the start
date. Defaults to None.
step : int
Step size in number of days from start to stop. Defaults to 1.
step : str
Step size from the start to stop dates in days denoted by 'd'
or hours 'h'. Defaults to 1 day ('1d').
model : str, optional
String representing the Interplanteary dust model used in the
simulation. Available options are 'planck 2013', 'planck 2015',
Expand Down

0 comments on commit c3e08b4

Please sign in to comment.