Skip to content

[WIP] Add CelestialCoord1 tutorial notebook [new content]#436

Closed
kakirastern wants to merge 2 commits into
astropy-learn:masterfrom
kakirastern:skycoord1-tutorial
Closed

[WIP] Add CelestialCoord1 tutorial notebook [new content]#436
kakirastern wants to merge 2 commits into
astropy-learn:masterfrom
kakirastern:skycoord1-tutorial

Conversation

@kakirastern
Copy link
Copy Markdown
Contributor

@kakirastern kakirastern commented Mar 30, 2020

Fixes #443.

Address #400, though not completely fixing it.

Add new FITS World Coordinate System (WCS) tutorial to guide users on how to building one's own astropy.wcs.WCS object, serving as an intro to WCS using astropy in two ways programmatically.

@kakirastern
Copy link
Copy Markdown
Contributor Author

A Google Colab version will follow soon and be posted here.

@kakirastern
Copy link
Copy Markdown
Contributor Author

Google Colab link for SkyCoord 1 notebook: https://colab.research.google.com/drive/14ZN73gO9aIiqX-bd8PsXuBxGspO-6eOQ

@kakirastern
Copy link
Copy Markdown
Contributor Author

An error encountered during the CircleCI build that is unrelated to this notebook in particular as follows:

INFO: Processing notebook FITS-cubes.ipynb (in /home/circleci/project/tutorials/notebooks/FITS-cubes) [convert]

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/home/circleci/project/venv/lib/python3.7/site-packages/sphinx/config.py", line 348, in eval_config_file
    execfile_(filename, namespace)
  File "/home/circleci/project/venv/lib/python3.7/site-packages/sphinx/util/pycompat.py", line 81, in execfile_
    exec(code, _globals)
  File "/home/circleci/project/tutorials/conf.py", line 164, in <module>
    process_notebooks(nb_tutorials_path, **processkwargs)
  File "/home/circleci/project/scripts/convert.py", line 238, in process_notebooks
    nbc.execute()
  File "/home/circleci/project/scripts/convert.py", line 97, in execute
    executor.preprocess(nb, {'metadata': {'path': self.path_only}})
  File "/home/circleci/project/venv/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 405, in preprocess
    nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources)
  File "/home/circleci/project/venv/lib/python3.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess
    nb.cells[index], resources = self.preprocess_cell(cell, resources, index)
  File "/home/circleci/project/venv/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 448, in preprocess_cell
    raise CellExecutionError.from_cell_and_msg(cell, out)
nbconvert.preprocessors.execute.CellExecutionError: An error occurred while executing the following cell:
------------------
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm

import astropy.units as u
from astropy.utils.data import download_file
from astropy.io import fits  # We use fits to open the actual data file

from astropy.utils import data
data.conf.remote_timeout = 60

from spectral_cube import SpectralCube

from astroquery.esasky import ESASky
from astroquery.utils import TableList
from astropy.wcs import WCS
from reproject import reproject_interp
------------------


KeyErrorTraceback (most recent call last)
<ipython-input-1-5087be31c7cf> in <module>
     15 from astroquery.utils import TableList
     16 from astropy.wcs import WCS
---> 17 from reproject import reproject_interp

~/project/venv/lib/python3.7/site-packages/reproject/__init__.py in <module>
     11 
     12 if not _ASTROPY_SETUP_:  # noqa
---> 13     from .interpolation import reproject_interp  # noqa
     14     from .spherical_intersect import reproject_exact  # noqa
     15     from .healpix import reproject_from_healpix, reproject_to_healpix  # noqa

~/project/venv/lib/python3.7/site-packages/reproject/interpolation/__init__.py in <module>
      3 Routines to carry out reprojection by interpolation.
      4 """
----> 5 from .high_level import *  # noqa

~/project/venv/lib/python3.7/site-packages/reproject/interpolation/high_level.py in <module>
     17 @deprecated_renamed_argument('independent_celestial_slices', None, since='0.6')
     18 def reproject_interp(input_data, output_projection, shape_out=None, hdu_in=0,
---> 19                      order='bilinear', output_array=None, return_footprint=True):
     20     """
     21     Reproject data to a new projection using interpolation (this is typically

~/project/venv/lib/python3.7/site-packages/astropy/utils/decorators.py in decorator(function)
    441             else:
    442                 if new_name[i] is None:
--> 443                     param = arguments[old_name[i]]
    444                 elif new_name[i] in arguments:
    445                     param = arguments[new_name[i]]

KeyError: 'independent_celestial_slices'
KeyError: 'independent_celestial_slices'

@adrn
Copy link
Copy Markdown
Contributor

adrn commented Apr 13, 2020

The failure was related to this issue, should now be resolved with reproject v0.7 astropy/reproject#224

@stargaser
Copy link
Copy Markdown

At the Learn telecon today, we decided this notebook should be longer, including reading in a FITS file of the Helix Nebula, and plotting it with coordinates labeled on the axes, and then to stop at that point.

@eblur
Copy link
Copy Markdown
Contributor

eblur commented Apr 14, 2020

Please consider also Issue #443

@kakirastern kakirastern changed the title Add SkyCoord1 tutorial notebook [new content] [WIP] Add CelestialCoord1 tutorial notebook [new content] May 3, 2020
@kakirastern
Copy link
Copy Markdown
Contributor Author

@eblur @kelle @stargaser The Colab version of the 1st WCS tutorial is ready for another (possibly a final) review: https://colab.research.google.com/drive/14ZN73gO9aIiqX-bd8PsXuBxGspO-6eOQ?usp=sharing

Once I get a final approval (expecting mostly from @eblur) then I will move the code into the repo via Git.

@kakirastern kakirastern requested a review from eblur July 8, 2020 14:26
@eblur
Copy link
Copy Markdown
Contributor

eblur commented Jul 8, 2020

Hi @kakirastern I finished reviewing the Colab notebook. I made some minor grammatical changes and moved some of the text around for ease of reading.

After one minor change needed on your part, I think it's good to go! Please:

  • Make it so the 0.1 degree scale bar is labeled using matplotlib.pyplot.text. I have already added a line to the code, but I cannot run the colab notebook myself. (There is an authorization code needed to download the associated data.) So once you have checked that it is running and positioned correctly, go ahead and update the PR.

@stargaser
Copy link
Copy Markdown

I saw in this Slack thread that specutils puts test files in Zenodo. Perhaps something to consider for the data file here? From the Slack post, there is some relevant specutils code that could be used as a template.

@kakirastern
Copy link
Copy Markdown
Contributor Author

Hi @kakirastern I finished reviewing the Colab notebook. I made some minor grammatical changes and moved some of the text around for ease of reading.

After one minor change needed on your part, I think it's good to go! Please:

  • Make it so the 0.1 degree scale bar is labeled using matplotlib.pyplot.text. I have already added a line to the code, but I cannot run the colab notebook myself. (There is an authorization code needed to download the associated data.) So once you have checked that it is running and positioned correctly, go ahead and update the PR.

Thanks @eblur! I will make the final change according to your suggestion soon and push it to the repo via Git.

@kakirastern
Copy link
Copy Markdown
Contributor Author

I saw in this Slack thread that specutils puts test files in Zenodo. Perhaps something to consider for the data file here? From the Slack post, there is some relevant specutils code that could be used as a template.

Yeah @stargaser I think that would be a good option to explore since we might have more control over the data files via Zenodo. I will put this in the running notes at the next telecon/co-work hour so we could have some discussion regarding the matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add to WCS tutorial: How to place a scale bar on an image with WCS

5 participants