Skip to content

Commit

Permalink
Fixed bug where times weren't being displayed in ISOT format (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
byrdie authored Sep 17, 2024
1 parent 640708e commit 171fd3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion iris/sg/_spectrograph.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,12 @@ def from_fits(
key_center = f"TWAVE{index_window}"
self.wavelength_center[index] = hdul[0].header[key_center] * u.AA

self.inputs.time.ndarray = astropy.time.Time(
t = astropy.time.Time(
val=self.inputs.time.ndarray,
format="jd",
)
t.format = "isot"
self.inputs.time.ndarray = t

where_invalid = self.outputs < -10 * u.DN
self.outputs[where_invalid] = np.nan
Expand Down
5 changes: 3 additions & 2 deletions iris/sg/background/_background.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def average(
"""
obs = obs.copy_shallow()
obs.inputs = na.TemporalSpectralPositionalVectorArray(
time=obs.inputs.time.ndarray.mean(),
time=obs.inputs.time.ndarray.jd.mean(),
wavelength=obs.inputs.wavelength.mean(axis),
position=obs.inputs.position.mean(axis),
)
Expand Down Expand Up @@ -720,7 +720,8 @@ def estimate(
.. jupyter-execute::
# Remove background from spectrograph observation
obs_nobg = obs - bg
obs_nobg = obs.copy_shallow()
obs_nobg.outputs = obs.outputs - bg.outputs
# Select the first raster to plot
index = {obs.axis_time: 0}
Expand Down

0 comments on commit 171fd3d

Please sign in to comment.