diff --git a/changelog/301.breaking.rst b/changelog/301.breaking.rst new file mode 100644 index 00000000..7f89bc2d --- /dev/null +++ b/changelog/301.breaking.rst @@ -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. diff --git a/changelog/301.bugfix.rst b/changelog/301.bugfix.rst new file mode 100644 index 00000000..34a8ef33 --- /dev/null +++ b/changelog/301.bugfix.rst @@ -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. diff --git a/dkist/io/loaders.py b/dkist/io/loaders.py index 27312ac5..da7376e4 100644 --- a/dkist/io/loaders.py +++ b/dkist/io/loaders.py @@ -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 @@ -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 diff --git a/docs/tutorial/6_visualization.md b/docs/tutorial/6_visualization.md index 891e4326..6e8240c0 100644 --- a/docs/tutorial/6_visualization.md +++ b/docs/tutorial/6_visualization.md @@ -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. @@ -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() ``` diff --git a/docs/whatsnew/1.0.rst b/docs/whatsnew/1.0.rst index 032cdb40..0999b396 100644 --- a/docs/whatsnew/1.0.rst +++ b/docs/whatsnew/1.0.rst @@ -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 Results from 1 Provider: 84 Results from the DKISTClient: - Start Time End Time ... - ... - ----------------------- ----------------------- ... - ... ... ... + Start Time End Time ... Average Temporal Sampling + ... s + ----------------------- ----------------------- ... ------------------------- + ... ... ... ... Length = 84 rows diff --git a/setup.cfg b/setup.cfg index 2dc4b4cf..a8a1b57c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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