Cube Reprojection Tutorial¶
Authors¶
Adam Ginsburg, Eric Koch
Learning Goals¶
- reproject a cube spectrally
- smooth it spectrally
- reproject it spatially
Keywords¶
cube, reprojection
Summary¶
This tutorial shows how to take two spectral cubes observed toward the same part of the sky, but different frequencies, and put them onto the same grid using spectral-cube.
Index¶
- Step 1: Download
- Step 2: Open files, collect metadata
- Step 3: Convert to velocity
- Step 4: Spectral Interpolation
- Step 5: Spatial Smoothing
- Step 6: Reprojection
In this example, we do spectral smoothing and interpolation (step 4) before spatial smoothing and interpolation (step 5), but if you have a varying-resolution cube (with a different beam size for each channel), you have to do spatial smoothing first. For more information see the spectral-cube documentation.
Step 1: Download the data¶
(you might not have to do this step, since you may already have data)
%pip install -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt
%pip install --pre -U astroquery
Collecting spectral-cube (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 14)) Cloning https://github.com/radio-astro-tools/spectral-cube/ to /tmp/pip-install-m3cmt0dn/spectral-cube_5132f231e5fc45a086e53f3204827c9a Running command git clone --filter=blob:none --quiet https://github.com/radio-astro-tools/spectral-cube/ /tmp/pip-install-m3cmt0dn/spectral-cube_5132f231e5fc45a086e53f3204827c9a
Resolved https://github.com/radio-astro-tools/spectral-cube/ to commit 8ae6705d7e64739cbb08904efc660dbed98874ab
Installing build dependencies ... -
\
|
/
done
Getting requirements to build wheel ... -
done
Preparing metadata (pyproject.toml) ... -
done Collecting radio-beam (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 15)) Cloning https://github.com/radio-astro-tools/radio-beam/ to /tmp/pip-install-m3cmt0dn/radio-beam_276d1c1de2a34f50a574ff62749d0c8c Running command git clone --filter=blob:none --quiet https://github.com/radio-astro-tools/radio-beam/ /tmp/pip-install-m3cmt0dn/radio-beam_276d1c1de2a34f50a574ff62749d0c8c
Resolved https://github.com/radio-astro-tools/radio-beam/ to commit 325cad35689eb71d9959a9e341281713c991fb1d
Installing build dependencies ... -
\
|
/
done
Getting requirements to build wheel ... -
done
Preparing metadata (pyproject.toml) ... -
done Collecting pvextractor (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 16)) Cloning https://github.com/radio-astro-tools/pvextractor/ to /tmp/pip-install-m3cmt0dn/pvextractor_c0b2f51fcdb745a68b5cc850b82cc44b Running command git clone --filter=blob:none --quiet https://github.com/radio-astro-tools/pvextractor/ /tmp/pip-install-m3cmt0dn/pvextractor_c0b2f51fcdb745a68b5cc850b82cc44b
Resolved https://github.com/radio-astro-tools/pvextractor/ to commit d5803d85f262981c30c03282fa4b56e748a40331 Running command git submodule update --init --recursive -q
Installing build dependencies ... -
\
|
/
done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... -
done Requirement already satisfied: requests in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 2)) (2.32.3) Requirement already satisfied: beautifulsoup4 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 3)) (4.12.3) Requirement already satisfied: notebook==6.5.2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (6.5.2) Requirement already satisfied: numpy in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 7)) (1.26.4) Requirement already satisfied: scipy in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 8)) (1.13.1) Requirement already satisfied: matplotlib==3.7 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 9)) (3.7.0) Requirement already satisfied: astropy in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 10)) (6.1.0) Requirement already satisfied: regions in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 11)) (0.9) Requirement already satisfied: aplpy in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 12)) (2.1.0) Requirement already satisfied: astroquery in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 13)) (0.4.8.dev9321) Requirement already satisfied: dask-image in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 18)) (2024.5.3) Requirement already satisfied: casatools in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 19)) (6.6.4.34) Requirement already satisfied: casatasks in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 20)) (6.6.4.34) Requirement already satisfied: dask[complete] in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from -r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (2024.5.2)
Requirement already satisfied: jinja2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (3.1.4) Requirement already satisfied: tornado>=6.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (6.4) Requirement already satisfied: pyzmq>=17 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (26.0.3) Requirement already satisfied: argon2-cffi in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (23.1.0) Requirement already satisfied: traitlets>=4.2.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (5.14.3) Requirement already satisfied: jupyter-core>=4.6.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (5.7.2) Requirement already satisfied: jupyter-client>=5.3.4 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (8.6.2) Requirement already satisfied: ipython-genutils in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.2.0) Requirement already satisfied: nbformat in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (5.10.4) Requirement already satisfied: nbconvert>=5 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (7.16.4) Requirement already satisfied: nest-asyncio>=1.5 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (1.6.0) Requirement already satisfied: ipykernel in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (6.29.4) Requirement already satisfied: Send2Trash>=1.8.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (1.8.3) Requirement already satisfied: terminado>=0.8.3 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.18.1) Requirement already satisfied: prometheus-client in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.20.0) Requirement already satisfied: nbclassic>=0.4.7 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (1.1.0) Requirement already satisfied: contourpy>=1.0.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from matplotlib==3.7->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 9)) (1.2.1) Requirement already satisfied: cycler>=0.10 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from matplotlib==3.7->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 9)) (0.12.1) Requirement already satisfied: fonttools>=4.22.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from matplotlib==3.7->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 9)) (4.53.0) Requirement already satisfied: kiwisolver>=1.0.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from matplotlib==3.7->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 9)) (1.4.5) Requirement already satisfied: packaging>=20.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from matplotlib==3.7->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 9)) (24.0) Requirement already satisfied: pillow>=6.2.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from matplotlib==3.7->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 9)) (10.3.0) Requirement already satisfied: pyparsing>=2.3.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from matplotlib==3.7->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 9)) (3.1.2) Requirement already satisfied: python-dateutil>=2.7 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from matplotlib==3.7->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 9)) (2.9.0.post0) Requirement already satisfied: charset-normalizer<4,>=2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from requests->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 2)) (3.3.2) Requirement already satisfied: idna<4,>=2.5 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from requests->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 2)) (3.7) Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from requests->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 2)) (2.2.1) Requirement already satisfied: certifi>=2017.4.17 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from requests->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 2)) (2024.6.2) Requirement already satisfied: soupsieve>1.2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from beautifulsoup4->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 3)) (2.5)
Requirement already satisfied: pyerfa>=2.0.1.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astropy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 10)) (2.0.1.4) Requirement already satisfied: astropy-iers-data>=0.2024.4.29.0.28.48 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astropy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 10)) (0.2024.6.3.0.31.14) Requirement already satisfied: PyYAML>=3.13 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astropy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 10)) (6.0.1) Requirement already satisfied: reproject>=0.4 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from aplpy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 12)) (0.13.1) Requirement already satisfied: pyregion>=2.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from aplpy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 12)) (2.2.0) Requirement already satisfied: pyavm>=0.9.4 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from aplpy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 12)) (0.9.6) Requirement already satisfied: scikit-image>=0.14 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from aplpy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 12)) (0.23.2) Requirement already satisfied: shapely>=1.7 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from aplpy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 12)) (2.0.4) Requirement already satisfied: html5lib>=0.999 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astroquery->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 13)) (1.1) Requirement already satisfied: keyring>=15.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astroquery->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 13)) (25.2.1) Requirement already satisfied: pyvo>=1.5 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astroquery->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 13)) (1.5.2)
Requirement already satisfied: six in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from spectral-cube->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 14)) (1.16.0) Requirement already satisfied: joblib in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from spectral-cube->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 14)) (1.4.2) Requirement already satisfied: casa-formats-io in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from spectral-cube->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 14)) (0.3.0) Requirement already satisfied: qtpy>=2.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from pvextractor->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 16)) (2.4.1)
Requirement already satisfied: click>=8.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (8.1.7) Requirement already satisfied: cloudpickle>=1.5.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (3.0.0) Requirement already satisfied: fsspec>=2021.09.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (2024.6.0) Requirement already satisfied: partd>=1.2.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (1.4.2) Requirement already satisfied: toolz>=0.10.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (0.12.1) Requirement already satisfied: importlib-metadata>=4.13.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (7.1.0) Requirement already satisfied: pyarrow>=7.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (16.1.0) Requirement already satisfied: pyarrow-hotfix in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (0.6) Requirement already satisfied: lz4>=4.3.2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (4.3.3) Requirement already satisfied: pandas>=2.0.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask-image->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 18)) (2.2.2) Requirement already satisfied: pims>=0.4.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask-image->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 18)) (0.6.1) Requirement already satisfied: tifffile>=2018.10.18 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask-image->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 18)) (2024.5.22) Requirement already satisfied: casaconfig in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from casatools->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 19)) (1.0.0)
Requirement already satisfied: dask-expr<1.2,>=1.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (1.1.2)
Requirement already satisfied: webencodings in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from html5lib>=0.999->astroquery->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 13)) (0.5.1) Requirement already satisfied: zipp>=0.5 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from importlib-metadata>=4.13.0->dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (3.19.1)
Requirement already satisfied: platformdirs>=2.5 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jupyter-core>=4.6.1->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (4.2.2)
Requirement already satisfied: jaraco.classes in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from keyring>=15.0->astroquery->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 13)) (3.4.0) Requirement already satisfied: jaraco.functools in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from keyring>=15.0->astroquery->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 13)) (4.0.1) Requirement already satisfied: jaraco.context in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from keyring>=15.0->astroquery->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 13)) (5.3.0) Requirement already satisfied: SecretStorage>=3.2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from keyring>=15.0->astroquery->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 13)) (3.3.3) Requirement already satisfied: jeepney>=0.4.2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from keyring>=15.0->astroquery->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 13)) (0.8.0) Requirement already satisfied: notebook-shim>=0.2.3 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.2.4)
Requirement already satisfied: bleach!=5.0.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from nbconvert>=5->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (6.1.0) Requirement already satisfied: defusedxml in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from nbconvert>=5->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.7.1) Requirement already satisfied: jupyterlab-pygments in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from nbconvert>=5->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.3.0) Requirement already satisfied: markupsafe>=2.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from nbconvert>=5->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (2.1.5) Requirement already satisfied: mistune<4,>=2.0.3 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from nbconvert>=5->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (3.0.2) Requirement already satisfied: nbclient>=0.5.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from nbconvert>=5->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.10.0) Requirement already satisfied: pandocfilters>=1.4.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from nbconvert>=5->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (1.5.1) Requirement already satisfied: pygments>=2.4.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from nbconvert>=5->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (2.18.0) Requirement already satisfied: tinycss2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from nbconvert>=5->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (1.3.0) Requirement already satisfied: fastjsonschema>=2.15 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from nbformat->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (2.19.1) Requirement already satisfied: jsonschema>=2.6 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from nbformat->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (4.22.0)
Requirement already satisfied: pytz>=2020.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from pandas>=2.0.0->dask-image->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 18)) (2024.1) Requirement already satisfied: tzdata>=2022.7 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from pandas>=2.0.0->dask-image->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 18)) (2024.1) Requirement already satisfied: locket in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from partd>=1.2.0->dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (1.0.0)
Requirement already satisfied: imageio in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from pims>=0.4.1->dask-image->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 18)) (2.34.1) Requirement already satisfied: slicerator>=0.9.8 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from pims>=0.4.1->dask-image->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 18)) (1.1.0)
Requirement already satisfied: astropy-healpix>=0.6 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from reproject>=0.4->aplpy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 12)) (1.0.3) Requirement already satisfied: zarr in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from reproject>=0.4->aplpy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 12)) (2.18.2)
Requirement already satisfied: networkx>=2.8 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from scikit-image>=0.14->aplpy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 12)) (3.3) Requirement already satisfied: lazy-loader>=0.4 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from scikit-image>=0.14->aplpy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 12)) (0.4)
Requirement already satisfied: ptyprocess in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from terminado>=0.8.3->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.7.0)
Requirement already satisfied: argon2-cffi-bindings in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from argon2-cffi->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (21.2.0) Requirement already satisfied: bokeh>=2.4.2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (3.4.1) Requirement already satisfied: distributed==2024.5.2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (2024.5.2)
Requirement already satisfied: msgpack>=1.0.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from distributed==2024.5.2->dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (1.0.8) Requirement already satisfied: psutil>=5.7.2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from distributed==2024.5.2->dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (5.9.8) Requirement already satisfied: sortedcontainers>=2.0.5 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from distributed==2024.5.2->dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (2.4.0) Requirement already satisfied: tblib>=1.6.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from distributed==2024.5.2->dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (3.0.0) Requirement already satisfied: zict>=3.0.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from distributed==2024.5.2->dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (3.0.0) Requirement already satisfied: comm>=0.1.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.2.2) Requirement already satisfied: debugpy>=1.6.5 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (1.8.1) Requirement already satisfied: ipython>=7.23.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (8.25.0)
Requirement already satisfied: matplotlib-inline>=0.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.1.7)
Requirement already satisfied: xyzservices>=2021.09.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from bokeh>=2.4.2->dask[complete]->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 17)) (2024.4.0)
Requirement already satisfied: decorator in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from ipython>=7.23.1->ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (5.1.1) Requirement already satisfied: jedi>=0.16 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from ipython>=7.23.1->ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.19.1) Requirement already satisfied: prompt-toolkit<3.1.0,>=3.0.41 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from ipython>=7.23.1->ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (3.0.46) Requirement already satisfied: stack-data in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from ipython>=7.23.1->ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.6.3) Requirement already satisfied: exceptiongroup in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from ipython>=7.23.1->ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (1.2.1) Requirement already satisfied: typing-extensions>=4.6 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from ipython>=7.23.1->ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (4.12.1) Requirement already satisfied: pexpect>4.3 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from ipython>=7.23.1->ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (4.9.0)
Requirement already satisfied: attrs>=22.2.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jsonschema>=2.6->nbformat->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (23.2.0) Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jsonschema>=2.6->nbformat->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (2023.12.1) Requirement already satisfied: referencing>=0.28.4 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jsonschema>=2.6->nbformat->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.35.1) Requirement already satisfied: rpds-py>=0.7.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jsonschema>=2.6->nbformat->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.18.1)
Requirement already satisfied: jupyter-server<3,>=1.8 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (2.14.1)
Requirement already satisfied: cryptography>=2.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from SecretStorage>=3.2->keyring>=15.0->astroquery->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 13)) (42.0.7)
Requirement already satisfied: cffi>=1.0.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from argon2-cffi-bindings->argon2-cffi->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (1.16.0)
Requirement already satisfied: more-itertools in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jaraco.classes->keyring>=15.0->astroquery->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 13)) (10.2.0) Requirement already satisfied: backports.tarfile in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jaraco.context->keyring>=15.0->astroquery->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 13)) (1.2.0)
Requirement already satisfied: asciitree in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from zarr->reproject>=0.4->aplpy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 12)) (0.3.3) Requirement already satisfied: numcodecs>=0.10.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from zarr->reproject>=0.4->aplpy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 12)) (0.12.1) Requirement already satisfied: fasteners in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from zarr->reproject>=0.4->aplpy->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 12)) (0.19)
Requirement already satisfied: pycparser in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (2.22)
Requirement already satisfied: parso<0.9.0,>=0.8.3 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jedi>=0.16->ipython>=7.23.1->ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.8.4)
Requirement already satisfied: anyio>=3.1.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (4.4.0) Requirement already satisfied: jupyter-events>=0.9.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.10.0) Requirement already satisfied: jupyter-server-terminals>=0.4.4 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.5.3) Requirement already satisfied: overrides>=5.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (7.7.0) Requirement already satisfied: websocket-client>=1.7 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (1.8.0)
Requirement already satisfied: wcwidth in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from prompt-toolkit<3.1.0,>=3.0.41->ipython>=7.23.1->ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.2.13)
Requirement already satisfied: executing>=1.2.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from stack-data->ipython>=7.23.1->ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (2.0.1) Requirement already satisfied: asttokens>=2.1.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from stack-data->ipython>=7.23.1->ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (2.4.1) Requirement already satisfied: pure-eval in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from stack-data->ipython>=7.23.1->ipykernel->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.2.2)
Requirement already satisfied: sniffio>=1.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from anyio>=3.1.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (1.3.1)
Requirement already satisfied: python-json-logger>=2.0.4 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (2.0.7) Requirement already satisfied: rfc3339-validator in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.1.4) Requirement already satisfied: rfc3986-validator>=0.1.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (0.1.1)
Requirement already satisfied: fqdn in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (1.5.1) Requirement already satisfied: isoduration in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (20.11.0) Requirement already satisfied: jsonpointer>1.13 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (2.4) Requirement already satisfied: uri-template in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (1.3.0) Requirement already satisfied: webcolors>=1.11 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (1.13)
Requirement already satisfied: arrow>=0.15.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (1.3.0)
Requirement already satisfied: types-python-dateutil>=2.8.10 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from arrow>=0.15.0->isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=1.8->notebook-shim>=0.2.3->nbclassic>=0.4.7->notebook==6.5.2->-r https://github.com/radio-astro-tools/tutorials/raw/master/requirements.txt (line 5)) (2.9.0.20240316)
Note: you may need to restart the kernel to use updated packages.
Requirement already satisfied: astroquery in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (0.4.8.dev9321)
Requirement already satisfied: numpy>=1.20 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astroquery) (1.26.4) Requirement already satisfied: astropy>=5.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astroquery) (6.1.0) Requirement already satisfied: requests>=2.19 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astroquery) (2.32.3) Requirement already satisfied: beautifulsoup4>=4.8 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astroquery) (4.12.3) Requirement already satisfied: html5lib>=0.999 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astroquery) (1.1) Requirement already satisfied: keyring>=15.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astroquery) (25.2.1) Requirement already satisfied: pyvo>=1.5 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astroquery) (1.5.2)
Requirement already satisfied: pyerfa>=2.0.1.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astropy>=5.0->astroquery) (2.0.1.4) Requirement already satisfied: astropy-iers-data>=0.2024.4.29.0.28.48 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astropy>=5.0->astroquery) (0.2024.6.3.0.31.14) Requirement already satisfied: PyYAML>=3.13 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astropy>=5.0->astroquery) (6.0.1) Requirement already satisfied: packaging>=19.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from astropy>=5.0->astroquery) (24.0) Requirement already satisfied: soupsieve>1.2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from beautifulsoup4>=4.8->astroquery) (2.5) Requirement already satisfied: six>=1.9 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from html5lib>=0.999->astroquery) (1.16.0) Requirement already satisfied: webencodings in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from html5lib>=0.999->astroquery) (0.5.1) Requirement already satisfied: jaraco.classes in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from keyring>=15.0->astroquery) (3.4.0) Requirement already satisfied: jaraco.functools in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from keyring>=15.0->astroquery) (4.0.1) Requirement already satisfied: jaraco.context in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from keyring>=15.0->astroquery) (5.3.0) Requirement already satisfied: importlib-metadata>=4.11.4 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from keyring>=15.0->astroquery) (7.1.0) Requirement already satisfied: SecretStorage>=3.2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from keyring>=15.0->astroquery) (3.3.3) Requirement already satisfied: jeepney>=0.4.2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from keyring>=15.0->astroquery) (0.8.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from requests>=2.19->astroquery) (3.3.2) Requirement already satisfied: idna<4,>=2.5 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from requests>=2.19->astroquery) (3.7) Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from requests>=2.19->astroquery) (2.2.1) Requirement already satisfied: certifi>=2017.4.17 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from requests>=2.19->astroquery) (2024.6.2) Requirement already satisfied: zipp>=0.5 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from importlib-metadata>=4.11.4->keyring>=15.0->astroquery) (3.19.1) Requirement already satisfied: cryptography>=2.0 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from SecretStorage>=3.2->keyring>=15.0->astroquery) (42.0.7)
Requirement already satisfied: more-itertools in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jaraco.classes->keyring>=15.0->astroquery) (10.2.0) Requirement already satisfied: backports.tarfile in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from jaraco.context->keyring>=15.0->astroquery) (1.2.0)
Requirement already satisfied: cffi>=1.12 in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from cryptography>=2.0->SecretStorage>=3.2->keyring>=15.0->astroquery) (1.16.0)
Requirement already satisfied: pycparser in /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages (from cffi>=1.12->cryptography>=2.0->SecretStorage>=3.2->keyring>=15.0->astroquery) (2.22)
Note: you may need to restart the kernel to use updated packages.
import numpy as np
from astropy.utils.data import download_file
We download the data cubes (18 MB and 337 MB, respectively) from a permalink on the ALMA archives.
If you have trouble with these downloads, try changing to a different ALMA server (e.g., almascience.nrao.edu->almascience.eso.org) or increase the timeout. See https://docs.astropy.org/en/stable/api/astropy.utils.data.download_file.html.
filename_1 = download_file("https://almascience.nrao.edu/dataPortal/member.uid___A001_X1465_X3a33.BrickMaser_sci.spw71.cube.I.manual.image.pbcor.fits",
cache=True)
filename_2 = download_file("https://almascience.nrao.edu/dataPortal/member.uid___A001_X87d_X141.a_sma1_sci.spw27.cube.I.pbcor.fits",
cache=True)
Step 2: Load the cubes¶
from spectral_cube import SpectralCube
cube1 = SpectralCube.read(filename_1)
cube1
WARNING: StokesWarning: Cube is a Stokes cube, returning spectral cube for I component [spectral_cube.io.core]
SpectralCube with shape=(75, 250, 250) and unit=Jy / beam: n_x: 250 type_x: RA---SIN unit_x: deg range: 266.534072 deg: 266.554577 deg n_y: 250 type_y: DEC--SIN unit_y: deg range: -28.713958 deg: -28.695975 deg n_s: 75 type_s: FREQ unit_s: Hz range: 139434992275.503 Hz:139503942362.300 Hz
cube2 = SpectralCube.read(filename_2)
cube2
WARNING: StokesWarning: Cube is a Stokes cube, returning spectral cube for I component [spectral_cube.io.core]
SpectralCube with shape=(478, 420, 420) and unit=Jy / beam: n_x: 420 type_x: RA---SIN unit_x: deg range: 266.537002 deg: 266.551600 deg n_y: 420 type_y: DEC--SIN unit_y: deg range: -28.711371 deg: -28.698569 deg n_s: 478 type_s: FREQ unit_s: Hz range: 216957714464.027 Hz:217190639088.700 Hz
The cubes are at different frequencies - 139 and 89 GHz.
The first cube covers the H2CS 4(1,3)-3(1,2) line at 139.483699 GHz.
The second covers SiO v=5-4 at 217.104984 GHz
We use the find_lines
tool to query splatalogue with astroquery over the spectral range covered by the cube. It returns a table of matching lines. Note that some line names will be repeated because Splatalogue includes several different databases and most chemical species are present in all of these.
# DEBUG
import astroquery
print(astroquery.__version__)
0.4.8.dev9321
cube1.find_lines(chemical_name=' H2CS ')
WARNING: ExperimentalImplementationWarning: The line-finding routine is experimental. Please report bugs on the Issues page: https://github.com/radio-astro-tools/spectral-cube/issues [spectral_cube.spectral_cube]
species_id | name | chemical_name | resolved_QNs | linelist | LovasASTIntensity | lower_state_energy | upper_state_energy | sijmu2 | sij | aij | intintensity | Lovas_NRAO | orderedfreq | lower_state_energy_K | upper_state_energy_K | orderedFreq | measFreq | upperStateDegen | moleculeTag | qnCode | labref_Lovas_NIST | rel_int_HFS_Lovas | unres_quantum_numbers | lineid | transition_in_space | transition_in_G358 | obsref_Lovas_NIST | source_Lovas_NIST | telescope_Lovas_NIST | transitionBandColor | searchErrorMessage | sqlquery | requestnumber |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
int64 | str15 | str16 | str28 | str5 | str5 | float64 | float64 | float64 | float64 | float64 | str7 | int64 | float64 | float64 | float64 | str68 | str69 | str3 | int64 | int64 | str8 | str1 | str28 | int64 | int64 | int64 | str6 | str11 | str13 | str14 | str1 | object | int64 |
210 | H<sub>2</sub>CS | Thioformaldehyde | 4( 1, 3)- 3( 1, 2) | JPL | 0.17 | 16.1465 | 20.79917 | 30.51674 | 11.223 | -4.44732 | -3.2185 | 1 | 139483.41 | 23.23108 | 29.92519 | <span style = 'color: #DC143C'></span> | 139.48341 (0.28), <span style = 'color: #DC143C'>139.48341</span> | 27 | -46003 | 303 | 4 1 3 3 1 2 | 4065687 | 0 | 0 | Lor84a | rho Oph B1 | MMWO 4.9m | datatablegreen | None | 0 | |||
210 | H<sub>2</sub>CS | Thioformaldehyde | 4( 1, 3)- 3( 1, 2) | CDMS | 16.1329 | 20.78557 | 30.59661 | 11.251 | -4.44619 | -3.2182 | 0 | 139483.6816 | 23.21151 | 29.90563 | <span style = 'color: #DC143C'></span> | 139.4836816 (0.05), <span style = 'color: #DC143C'>139.4836816</span> | 27 | -46509 | 303 | 4 1 3 3 1 2 | 4066266 | 0 | 0 | datatablegreen | None | 0 | |||||||
210 | H<sub>2</sub>CS | Thioformaldehyde | 4( 1, 3)- 3( 1, 2) | SLAIM | 0.17 | 16.133 | 20.78568 | 30.59472 | 3.75 | -3.94426 | 0 | 139483.699 | 23.21165 | 29.90578 | 139.483699 (0.017), <span style = 'color: #DC143C'>139.483699</span> | 139.483741 (0.024), <span style = 'color: #DC143C'>139.483741</span> | 8.5 | 0 | 0 | Mar05 | 4( 1, 3)- 3( 1, 2) | 3744487 | 1 | 0 | datatablegreen | None | 0 | ||||||
210 | H<sub>2</sub>CS | Thioformaldehyde | 4(1,3)-3(1,2) | Lovas | 0.17 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0 | 139483.699 | 0.0 | 0.0 | 139.483699 (0.017), <span style = 'color: #DC143C'>139.483699</span> | <span style = 'color: #DC143C'></span> | 0 | 0 | 4(1,3)-3(1,2) | 3734199 | 0 | 0 | Lor84a | rho Oph B1 | MMWO 4.9m | datatablegreen | None | 0 |
cube2.find_lines(chemical_name='SiO')
WARNING: ExperimentalImplementationWarning: The line-finding routine is experimental. Please report bugs on the Issues page: https://github.com/radio-astro-tools/spectral-cube/issues [spectral_cube.spectral_cube]
species_id | name | chemical_name | resolved_QNs | linelist | LovasASTIntensity | lower_state_energy | upper_state_energy | sijmu2 | sij | aij | intintensity | Lovas_NRAO | orderedfreq | lower_state_energy_K | upper_state_energy_K | orderedFreq | measFreq | upperStateDegen | moleculeTag | qnCode | labref_Lovas_NIST | rel_int_HFS_Lovas | unres_quantum_numbers | lineid | transition_in_space | transition_in_G358 | obsref_Lovas_NIST | source_Lovas_NIST | telescope_Lovas_NIST | transitionBandColor | searchErrorMessage | sqlquery | requestnumber |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
int64 | str35 | str29 | str20 | str5 | str4 | float64 | float64 | float64 | float64 | float64 | str7 | int64 | float64 | float64 | float64 | str68 | str68 | str2 | int64 | int64 | str9 | str1 | str24 | int64 | int64 | int64 | str13 | str9 | str13 | str20 | str1 | object | int64 |
21081 | SiO, v = 0-10 | Silicon monoxide (global fit) | J = 5 - 4, v = 0 - 0 | CDMS | 14.4843 | 21.72614 | 47.9909 | 0.0 | -3.28429 | -1.3211 | 1 | 217104.919 | 20.83981 | 31.25927 | <span style = 'color: #DC143C'></span> | 217.104919 (0.002), <span style = 'color: #DC143C'>217.104919</span> | 11 | -44505 | 1202 | 5 0 4 0 | 7980087 | 1 | 0 | Belloche 2013 | Sgr B2(N) | IRAM 30m | datatablelightpurple | None | 0 | ||||
20 | SiO <font color="red">v = 0 </font> | Silicon Monoxide | 5- 4 | CDMS | 1.6 | 14.4843 | 21.72614 | 47.99147 | 5.0 | -3.28429 | -1.3211 | 0 | 217104.98 | 20.83956 | 31.25889 | <span style = 'color: #DC143C'></span> | 217.10498 (0.08), <span style = 'color: #DC143C'>217.10498</span> | 11 | -44505 | 1202 | 5 0 4 0 | 6962437 | 0 | 0 | datatablelightpurple | None | 0 | ||||||
20 | SiO <font color="red">v = 0 </font> | Silicon Monoxide | 5- 4 | CDMS | 1.6 | 14.4843 | 21.72614 | 47.9911 | 5.0 | -3.28429 | -1.3199 | 0 | 217104.98 | 20.83956 | 31.25889 | <span style = 'color: #DC143C'></span> | 217.10498 (0.05), <span style = 'color: #DC143C'>217.10498</span> | 11 | -44505 | 1202 | J=5-4 v=0 | 13358 | 1 | 0 | datatablelightpurple | None | 0 | ||||||
20 | SiO <font color="red">v = 0 </font> | Silicon Monoxide | 5-4 | JPL | 1.6 | 14.4843 | 21.72614 | 48.14651 | 5.0 | -3.28288 | -1.3166 | 1 | 217104.98 | 20.83956 | 31.25889 | <span style = 'color: #DC143C'></span> | 217.10498 (0.08), <span style = 'color: #DC143C'>217.10498</span> | 11 | -44002 | 101 | J=5-4 v=0 | 1167368 | 0 | 0 | Lor84a | OriMC-1 | MMWO 4.9m | datatablelightpurple | None | 0 | |||
20 | SiO <font color="red">v = 0 </font> | Silicon Monoxide | 5-4 | Lovas | 1.6 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0 | 217104.984 | 0.0 | 0.0 | 217.104984 (0.014), <span style = 'color: #DC143C'>217.104984</span> | <span style = 'color: #DC143C'></span> | 0 | 0 | 5-4 v=0 | 3724638 | 0 | 0 | Lor84a | OriMC-1 | MMWO 4.9m | datatablelightpurple | None | 0 | |||||
20 | SiO <font color="red">v = 0 </font> | Silicon Monoxide | 5 - 4 | SLAIM | 14.484 | 21.72584 | 47.6849 | 5.0 | -3.28706 | 0 | 217104.984 | 20.83913 | 31.25846 | 217.104984 (0.014), <span style = 'color: #DC143C'>217.104984</span> | 217.10498 (0.1), <span style = 'color: #DC143C'>217.10498</span> | 11 | 0 | 0 | Man77 | 5 - 4 v=0 | 3932866 | 0 | 0 | datatablelightpurple | None | 0 |
Step 3: Convert cubes from frequency to velocity¶
from astropy import units as u
cube1vel = cube1.with_spectral_unit(u.km/u.s, velocity_convention='radio', rest_value=139.483699*u.GHz)
cube1vel
SpectralCube with shape=(75, 250, 250) and unit=Jy / beam: n_x: 250 type_x: RA---SIN unit_x: deg range: 266.534072 deg: 266.554577 deg n_y: 250 type_y: DEC--SIN unit_y: deg range: -28.713958 deg: -28.695975 deg n_s: 75 type_s: VRAD unit_s: km / s range: -43.509 km / s: 104.685 km / s
cube2vel = cube2.with_spectral_unit(u.km/u.s, velocity_convention='radio', rest_value=217.104984*u.GHz)
cube2vel
SpectralCube with shape=(478, 420, 420) and unit=Jy / beam: n_x: 420 type_x: RA---SIN unit_x: deg range: 266.537002 deg: 266.551600 deg n_y: 420 type_y: DEC--SIN unit_y: deg range: -28.711371 deg: -28.698569 deg n_s: 478 type_s: VRAD unit_s: km / s range: -118.278 km / s: 203.359 km / s
From the shape of the cube, we can see the H2CS cube is narrower in velocity, so we'll use that as the target spectral reprojection. However, the SiO cube is the smaller footprint on the sky.
Create spatial maps of the peak intensity to quickly explore the cubes:¶
One way to quickly explore the structure in the data cubes is to produce a peak intensity map, or the maximum along the spectral axis (axis=0
).
mx = cube1.max(axis=0)
mx.quicklook()
WARNING: PossiblySlowWarning: This function (<function BaseSpectralCube.max at 0x7feb932deef0>) requires loading the entire cube into memory and may therefore be slow. [spectral_cube.utils] /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/spectral_cube/spectral_cube.py:439: RuntimeWarning: All-NaN slice encountered out = function(self._get_filled_data(fill=fill,
We can do the same thing all on one line (for the other cube this time):
cube2.max(axis=0).quicklook()
WARNING: PossiblySlowWarning: This function (<function BaseSpectralCube.max at 0x7feb932deef0>) requires loading the entire cube into memory and may therefore be slow. [spectral_cube.utils]
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/spectral_cube/spectral_cube.py:439: RuntimeWarning: All-NaN slice encountered out = function(self._get_filled_data(fill=fill,
Step 4. Spectral Interpolation¶
We can do the spatial or spectral step first. In this case, we choose the spectral step first because the H$_2$CS cube is narrower in velocity (cube1vel
) and this will reduce the number of channels we need to spatially interpolate over in the next step.
We need to match resolution to the cube with the largest channel width:
velocity_res_1 = np.diff(cube1vel.spectral_axis)[0]
velocity_res_2 = np.diff(cube2vel.spectral_axis)[0]
velocity_res_1, velocity_res_2
(<Quantity 2.00262828 km / s>, <Quantity 0.67429189 km / s>)
Next, we will reduce cube2vel
to have the same spectral range as cube1vel
:
cube2vel_cutout = cube2vel.spectral_slab(cube1vel.spectral_axis.min(),
cube1vel.spectral_axis.max())
cube1vel, cube2vel_cutout
(SpectralCube with shape=(75, 250, 250) and unit=Jy / beam: n_x: 250 type_x: RA---SIN unit_x: deg range: 266.534072 deg: 266.554577 deg n_y: 250 type_y: DEC--SIN unit_y: deg range: -28.713958 deg: -28.695975 deg n_s: 75 type_s: VRAD unit_s: km / s range: -43.509 km / s: 104.685 km / s, SpectralCube with shape=(221, 420, 420) and unit=Jy / beam: n_x: 420 type_x: RA---SIN unit_x: deg range: 266.537002 deg: 266.551600 deg n_y: 420 type_y: DEC--SIN unit_y: deg range: -28.711371 deg: -28.698569 deg n_s: 221 type_s: VRAD unit_s: km / s range: -43.432 km / s: 104.913 km / s)
Note that it is important for the to-be-interpolated cube, in this case cube2
, to have pixels bounding cube1
's spectral axis, but in this case it does not. If the pixel range doesn't overlap perfectly, it may blank out one of the edge pixels. So, to fix this, we add a little buffer:
cube2vel_cutout = cube2vel.spectral_slab(cube1vel.spectral_axis.min() - velocity_res_2,
cube1vel.spectral_axis.max())
cube1vel, cube2vel_cutout
(SpectralCube with shape=(75, 250, 250) and unit=Jy / beam: n_x: 250 type_x: RA---SIN unit_x: deg range: 266.534072 deg: 266.554577 deg n_y: 250 type_y: DEC--SIN unit_y: deg range: -28.713958 deg: -28.695975 deg n_s: 75 type_s: VRAD unit_s: km / s range: -43.509 km / s: 104.685 km / s, SpectralCube with shape=(222, 420, 420) and unit=Jy / beam: n_x: 420 type_x: RA---SIN unit_x: deg range: 266.537002 deg: 266.551600 deg n_y: 420 type_y: DEC--SIN unit_y: deg range: -28.711371 deg: -28.698569 deg n_s: 222 type_s: VRAD unit_s: km / s range: -44.106 km / s: 104.913 km / s)
Our H2CS cube (cube1vel
) has broader channels. We need to first smooth cube2vel
to the broader channel width before doing the spatial reprojection.
To do this, we will spectrally smooth with a Gaussian with width set such that smoothing cube2vel
will result in the same width as cube1vel
. We do this by finding the difference in widths when deconvolving the cube1vel
channel width from cube2vel
. For further information see the documentation on smoothing.
Note that if we did not do this smoothing step, we would under-sample the cube2vel
data in the next downsampling step, reducing our signal-to-noise ratio.
We have adopted a width equal to the channel width; the line spread function is actually a Hanning-smoothed tophat. We are making a coarse approximation here.
fwhm_gaussian = (velocity_res_1**2 - velocity_res_2**2)**0.5
fwhm_gaussian
from astropy.convolution import Gaussian1DKernel
fwhm_to_sigma = np.sqrt(8*np.log(2))
# we want the kernel in pixel units, so we force to km/s and take the value
spectral_smoothing_kernel = Gaussian1DKernel(stddev=fwhm_gaussian.to(u.km/u.s).value / fwhm_to_sigma)
We then smooth with the kernel. Note that this is doing 420x420 = 176400 smoothing operations on a length-221 spectrum: it will take a little time
cube2vel_smooth = cube2vel_cutout.spectral_smooth(spectral_smoothing_kernel)
WARNING: nan_treatment='interpolate', however, NaN values detected post convolution. A contiguous region of NaN values, larger than the kernel size, are present in the input array. Increase the kernel size to avoid this. [astropy.convolution.convolve]
Now that we've done spectral smoothing, we can resample the spectral axis of cube2vel_smooth
to match cube1vel
by interpolating cube2vel_smooth
onto cube1vel
's grid:
cube2vel_spectralresample = cube2vel_smooth.spectral_interpolate(cube1vel.spectral_axis,
suppress_smooth_warning=True)
cube2vel_spectralresample
SpectralCube with shape=(75, 420, 420) and unit=Jy / beam: n_x: 420 type_x: RA---SIN unit_x: deg range: 266.537002 deg: 266.551600 deg n_y: 420 type_y: DEC--SIN unit_y: deg range: -28.711371 deg: -28.698569 deg n_s: 75 type_s: VRAD unit_s: km / s range: -43.509 km / s: 104.685 km / s
Note that we included the suppress_smooth_warning=True
argument. That is to hide this warning:
WARNING: SmoothingWarning: Input grid has too small a spacing. The data should be smoothed prior to resampling. [spectral_cube.spectral_cube]
which will tell you if the operation will under-sample the original data. The smoothing work we did above is specifically to make sure we are properly sampling, so this warning does not apply.
Step 5. Spatial Smoothing¶
Now that we've done spectral smoothing, we also need to follow a similar procedure of smoothing then resampling for the spatial axes.
The beam
is the resolution element of our cubes:
cube1vel.beam, cube2vel_spectralresample.beam
(Beam: BMAJ=1.29719604986604 arcsec BMIN=1.04247149438736 arcsec BPA=82.95313553702 deg, Beam: BMAJ=0.8935712308515601 arcsec BMIN=0.6649610689789199 arcsec BPA=85.81119797802 deg)
cube1
again hase the larger beam, so we'll smooth cube2
to its resolution
Aside: mixed beams¶
If cube1 and cube2 had different sized beams, but neither was clearly larger, we would have to convolve both to a common beam.
In this case, it's redundant and we could have just used cube1
's beam, but this is the more general approach:
import radio_beam
common_beam = cube1vel.beam.commonbeam_with(cube2vel.beam)
# This works with older versions of radio-beam:
# common_beam = radio_beam.commonbeam.common_2beams(radio_beam.Beams(beams=[cube1vel.beam, cube2vel.beam]))
common_beam
We then convolve:
# for v<0.6, we convert to Kelvin to ensure the units are preserved:
# cube2vel_spatialspectralsmooth = cube2vel_spectralresample.to(u.K).convolve_to(common_beam)
# in more recent versions, the unit conversion is handled appropriately,
# so unit conversion isn't needed
cube2vel_spatialspectralsmooth = cube2vel_spectralresample.convolve_to(common_beam)
cube2vel_spatialspectralsmooth
WARNING: PossiblySlowWarning: This function (<function BaseSpectralCube.convolve_to at 0x7feb92fd2b00>) requires loading the entire cube into memory and may therefore be slow. [spectral_cube.utils]
SpectralCube with shape=(75, 420, 420) and unit=Jy / beam: n_x: 420 type_x: RA---SIN unit_x: deg range: 266.537002 deg: 266.551600 deg n_y: 420 type_y: DEC--SIN unit_y: deg range: -28.711371 deg: -28.698569 deg n_s: 75 type_s: VRAD unit_s: km / s range: -43.509 km / s: 104.685 km / s
Step 6. Reprojection¶
Now we can do the spatial resampling as the final step for producing two cubes matched to the same spatial and spectral pixel grid:
# these next two lines are a hack to prevent the WCS from trying to convert to frequency
tgt_header = cube1vel.header
tgt_header['RESTFRQ'] = cube2vel_spatialspectralsmooth.header['RESTFRQ']
cube2vel_reproj = cube2vel_spatialspectralsmooth.reproject(tgt_header)
cube2vel_reproj
WARNING: PossiblySlowWarning: This function (<function BaseSpectralCube.reproject at 0x7feb92fd1fc0>) requires loading the entire cube into memory and may therefore be slow. [spectral_cube.utils]
SpectralCube with shape=(75, 250, 250) and unit=Jy / beam: n_x: 250 type_x: RA---SIN unit_x: deg range: 266.534072 deg: 266.554577 deg n_y: 250 type_y: DEC--SIN unit_y: deg range: -28.713958 deg: -28.695975 deg n_s: 75 type_s: VRAD unit_s: km / s range: -43.509 km / s: 104.685 km / s
These two cubes are now on an identical grid, and can be directly compared:
cube2vel_reproj, cube1vel
(SpectralCube with shape=(75, 250, 250) and unit=Jy / beam: n_x: 250 type_x: RA---SIN unit_x: deg range: 266.534072 deg: 266.554577 deg n_y: 250 type_y: DEC--SIN unit_y: deg range: -28.713958 deg: -28.695975 deg n_s: 75 type_s: VRAD unit_s: km / s range: -43.509 km / s: 104.685 km / s, SpectralCube with shape=(75, 250, 250) and unit=Jy / beam: n_x: 250 type_x: RA---SIN unit_x: deg range: 266.534072 deg: 266.554577 deg n_y: 250 type_y: DEC--SIN unit_y: deg range: -28.713958 deg: -28.695975 deg n_s: 75 type_s: VRAD unit_s: km / s range: -43.509 km / s: 104.685 km / s)
These spectra can now be overplotted as they are in the same unit with the same beam.
cube1vel[:,125,125].quicklook()
cube2vel_reproj[:,125,125].quicklook()
Dask¶
All of the above can be done using dask
as the underlying framework to parallelize the operations.
The dask approach can be made more memory-efficient (avoid using too much RAM) by writing intermediate steps to disk. The non-dask approach used above will generally need to read the whole cube into memory. Depending on the situation, either approach may be faster, but dask
may be needed if the cube is larger than memory.
We repeat all the operations above using dask. We use a ProgressBar
so you can see how long it takes. We also suppress warnings to make the output look cleaner (we already saw all the important warnings above).
from dask.diagnostics import ProgressBar
import warnings
with warnings.catch_warnings():
warnings.simplefilter('ignore')
with ProgressBar():
cube2dask = SpectralCube.read(filename_2, use_dask=True)
cube2daskvel = cube2dask.with_spectral_unit(u.km/u.s,
velocity_convention='radio', rest_value=217.104984*u.GHz)
cube2daskvel_cutout = cube2daskvel.spectral_slab(cube1vel.spectral_axis.min() - velocity_res_2,
cube1vel.spectral_axis.max())
cube2daskvel_smooth = cube2daskvel_cutout.spectral_smooth(spectral_smoothing_kernel)
cube2daskvel_spectralresample = cube2daskvel_smooth.spectral_interpolate(cube1vel.spectral_axis,
suppress_smooth_warning=True)
cube2daskvel_spatialspectralsmooth = cube2daskvel_spectralresample.convolve_to(common_beam)
cube2daskvel_reproj = cube2daskvel_spatialspectralsmooth.reproject(tgt_header)
cube2daskvel_reproj
[ ] | 0% Completed | 173.43 us
[ ] | 0% Completed | 101.15 ms
[ ] | 0% Completed | 202.18 ms
[ ] | 0% Completed | 454.02 ms
[ ] | 0% Completed | 691.97 ms
[ ] | 0% Completed | 828.46 ms
[ ] | 0% Completed | 1.60 s
[ ] | 0% Completed | 1.70 s
[ ] | 0% Completed | 1.93 s
[ ] | 0% Completed | 2.19 s
[ ] | 0% Completed | 2.30 s
[ ] | 0% Completed | 2.40 s
[ ] | 0% Completed | 3.21 s
[ ] | 0% Completed | 3.31 s
[ ] | 0% Completed | 3.41 s
[ ] | 0% Completed | 160.66 s
[ ] | 0% Completed | 160.82 s
[ ] | 0% Completed | 161.30 s
[ ] | 0% Completed | 161.40 s
[ ] | 0% Completed | 162.15 s
[ ] | 0% Completed | 162.26 s
[ ] | 0% Completed | 162.36 s
[########################################] | 100% Completed | 162.46 s
DaskSpectralCube with shape=(75, 250, 250) and unit=Jy / beam and chunk size (75, 250, 250): n_x: 250 type_x: RA---SIN unit_x: deg range: 266.534072 deg: 266.554577 deg n_y: 250 type_y: DEC--SIN unit_y: deg range: -28.713958 deg: -28.695975 deg n_s: 75 type_s: VRAD unit_s: km / s range: -43.509 km / s: 104.685 km / s