Skip to content

Commit

Permalink
Merge branch 'main' into asdf_select_tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair authored Oct 12, 2023
2 parents 45cca3f + 9696c7c commit 35c61fa
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-yaml
- id: check-ast
Expand Down
4 changes: 4 additions & 0 deletions changelog/301.breaking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The ASDF files currently being served by the data center are incompatible with
gwcs 0.19+. This is due to a change in how Stokes coordinates are represented.
In this release we have pinned the gwcs version to <0.19. A future release will
require 0.19+ when the ASDF files have been updated.
2 changes: 2 additions & 0 deletions changelog/301.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Ensure that we don't nest Dask arrays when no FITS files can be read.
This might result in more memory being used when computing an array with missing files.
5 changes: 1 addition & 4 deletions dkist/io/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import logging
from pathlib import Path

import dask.array as da
import numpy as np
from dask import delayed

from astropy.io import fits
from sunpy.util.decorators import add_common_docstring
Expand Down Expand Up @@ -96,8 +94,7 @@ def __getitem__(self, slc):
_LOGGER.debug("File %s does not exist.", self.absolute_uri)
# Use np.broadcast_to to generate an array of the correct size, but
# which only uses memory for one value.
return da.from_delayed(delayed(np.broadcast_to)(np.nan, self.shape) * np.nan,
self.shape, self.dtype)
return np.broadcast_to(np.nan, self.shape) * np.nan

with fits.open(self.absolute_uri,
memmap=False, # memmap is redundant with dask and delayed loading
Expand Down
10 changes: 8 additions & 2 deletions docs/tutorial/6_visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ So the list needed to specify the default ordering would be `[None, None, 'y', '
If instead we want to plot the image formed by the raster scan at a particular wavelength and Stokes value, we would do this:

```{code-cell} ipython
#ds.plot(plot_axes=[None, 'y', None, 'x'])
#plt.show()
---
tags: [skip-execution]
---
ds.plot(plot_axes=[None, 'y', None, 'x'])
plt.show()
```

You may have noticed this plot took somewhat longer to draw than the previous one.
Expand All @@ -80,6 +83,9 @@ You can also use `plot_axes` to create a line plot, by specifying only one axis
So to plot a spectrum at a fixed Stokes, time and raster location we can tell plot to use the dispersion axis as the x axis.

```{code-cell} ipython
---
tags: [skip-execution]
---
ds.plot(plot_axes=[None, None, 'x', None])
plt.show()
```
Expand Down
10 changes: 5 additions & 5 deletions docs/whatsnew/1.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ Here is a really quick demo of searching for all unembargoed VISP data and downl
>>> import dkist.net
>>> res = Fido.search(a.Instrument.visp, a.dkist.Embargoed.false) # doctest: +REMOTE_DATA
>>> res # doctest: +REMOTE_DATA
>>> res # doctest: +SKIP
<sunpy.net.fido_factory.UnifiedResponse object at ...>
Results from 1 Provider:
<BLANKLINE>
84 Results from the DKISTClient:
<BLANKLINE>
Start Time End Time ...
...
----------------------- ----------------------- ...
... ... ...
Start Time End Time ... Average Temporal Sampling
... s
----------------------- ----------------------- ... -------------------------
... ... ... ...
Length = 84 rows
<BLANKLINE>
<BLANKLINE>
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ install_requires =
astropy>=5
dask[array]>=2021.8.0
globus-sdk>=3.0
gwcs>=0.18.0
gwcs>=0.18.0,<0.19
matplotlib>=3.5
ndcube[plotting,reproject]>=2.0
numpy>=1.22
Expand Down

0 comments on commit 35c61fa

Please sign in to comment.