mirror of
https://github.com/archlinux/aur.git
synced 2026-02-07 12:41:55 +01:00
50 lines
2.8 KiB
Diff
50 lines
2.8 KiB
Diff
--- a/docs/index.rst 2023-03-28 02:13:36.000000000 +0800
|
|
+++ b/docs/index.rst 2023-04-07 15:02:28.220494471 +0800
|
|
@@ -52,9 +52,13 @@
|
|
Now we load the dataset from its canonical source:
|
|
|
|
>>> filename = 'https://data.sdss.org/sas/dr16/sdss/spectro/redux/26/spectra/1323/spec-1323-52797-0012.fits'
|
|
- >>> # The spectrum is in the second HDU of this file.
|
|
- >>> with fits.open(filename) as f: # doctest: +IGNORE_OUTPUT +REMOTE_DATA
|
|
- ... specdata = f[1].data # doctest: +REMOTE_DATA
|
|
+ >>> # The spectrum is in the second HDU of this file. Use local fits if no network when doc building.
|
|
+ >>> try:
|
|
+ ... with fits.open(filename) as f: # doctest: +IGNORE_OUTPUT +REMOTE_DATA
|
|
+ ... specdata = f[1].data # doctest: +REMOTE_DATA
|
|
+ >>> except Exception:
|
|
+ ... with fits.open('spec-1323-52797-0012.fits') as f: # doctest: +IGNORE_OUTPUT +REMOTE_DATA
|
|
+ ... specdata = f[1].data # doctest: +REMOTE_DATA
|
|
|
|
Then we re-format this dataset into astropy quantities, and create a
|
|
`~specutils.Spectrum` object:
|
|
--- a/docs/manipulation.rst 2023-03-18 03:59:09.000000000 +0800
|
|
+++ b/docs/manipulation.rst 2023-04-07 15:02:42.363989130 +0800
|
|
@@ -181,9 +181,13 @@
|
|
>>> quantity_support() # for getting units on the axes below # doctest: +IGNORE_OUTPUT
|
|
|
|
>>> filename = 'https://data.sdss.org/sas/dr16/sdss/spectro/redux/26/spectra/1323/spec-1323-52797-0012.fits'
|
|
- >>> # The spectrum is in the second HDU of this file.
|
|
- >>> with fits.open(filename) as f: # doctest: +IGNORE_OUTPUT +REMOTE_DATA
|
|
- ... specdata = f[1].data[1020:1250] # doctest: +REMOTE_DATA
|
|
+ >>> # The spectrum is in the second HDU of this file. Use local fits if no network when doc building.
|
|
+ >>> try:
|
|
+ ... with fits.open(filename) as f: # doctest: +IGNORE_OUTPUT +REMOTE_DATA
|
|
+ ... specdata = f[1].data[1020:1250] # doctest: +REMOTE_DATA
|
|
+ >>> except Exception:
|
|
+ ... with fits.open('spec-1323-52797-0012.fits') as f: # doctest: +IGNORE_OUTPUT +REMOTE_DATA
|
|
+ ... specdata = f[1].data[1020:1250] # doctest: +REMOTE_DATA
|
|
|
|
Then we re-format this dataset into astropy quantities, and create a
|
|
`~specutils.Spectrum` object:
|
|
--- a/docs/spectral_cube.rst 2023-03-28 02:13:36.000000000 +0800
|
|
+++ b/docs/spectral_cube.rst 2023-04-07 14:50:15.832279576 +0800
|
|
@@ -180,7 +180,8 @@
|
|
from specutils.manipulation import spectral_slab
|
|
|
|
filename = "https://stsci.box.com/shared/static/28a88k1qfipo4yxc4p4d40v4axtlal8y.fits"
|
|
- fn = download_file(filename, cache=True)
|
|
+ try: fn = download_file(filename, cache=True)
|
|
+ except Exception: fn = "28a88k1qfipo4yxc4p4d40v4axtlal8y.fits" # use local fits if not network when doc building
|
|
spec1d = Spectrum.read(fn)
|
|
|
|
# Extract H-alpha sub-cube for moment maps using spectral_slab
|