Deech08 / whampy

Python Package to Interact with, Visualize, and Analyze the Wisconsin H-Alpha Mapper - Sky Survey
BSD 3-Clause "New" or "Revised" License
8 stars 1 forks source link

Making Moment Maps -- Missing `import` statments #10

Closed HeloiseS closed 4 years ago

HeloiseS commented 4 years ago

Issue

There are 2 missing imports in your tutorial this tutorial and then it works spot on :+1: . Just add:

import matplotlib.pyplot as plt
import cartopy.crs as ccrs

Original Issue for history

I am testing this tutorial and received the following error.

A bit of googling seems to reveal this is a cartopy dependency - I didn't install anything beyond whampy and the tutorial doesn't call for a cartopy import, so this could be it.

>>> mean_vel = survey.moment(order=1)
/home/fste075/anaconda3/envs/whampy_test/lib/python3.7/site-packages/astropy/table/column.py:991: RuntimeWarning: invalid value encountered in less
  result = getattr(super(), op)(other)
>>> fig = plt.figure()
>>> ax = fig.add_subplot(111, projection = ccrs.Mollweide(central_longitude=0))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'ccrs' is not defined

This issue is part of the current JOSS-review of whampy ( #1940 )

Deech08 commented 4 years ago

will be fixed in next commit!

HeloiseS commented 4 years ago

Is it a lot of hassle to make a new pip version when you've fixed most of the initial issues we flagged?

This allows me to create a completely fresh environment in conda and pip install it anew as if I was a first time user :) I find this is the a great way to shoo the bugs away.

HeloiseS commented 4 years ago

Also, I should have said that the last two commands seem to have an extra indent:

>>> fig = plt.figure()
    >>> ax = fig.add_subplot(111, projection = ccrs.Mollweide(central_longitude=0))

    >>> fig = survey.intensity_map(ax = ax, c = mean_vel, vmin = -75, vmax = 75,
                                       norm = None, cmap = "RdBu_r", colorbar = True,
                                       cbar_kwargs={"orientation":"horizontal",
                                                            "label":"Mean Velocity (km/s)"})
Deech08 commented 4 years ago

I will definitely make a new pip version once I make all these changes! I will probably do so in the next day or so and will post on these issues when it is done.

Deech08 commented 4 years ago

Fixed and incorporated into version 0.2.0a2