LSSTDESC / Monitor

Extract light curves for time-variable cosmological objects
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

Requirements of Monitor #43

Open rbiswas4 opened 8 years ago

rbiswas4 commented 8 years ago

I got a crash of desc.monitor.render_fits_images due to the lack of WCSAxes.

render_fits_image(test_open[1], title='post.fits')

The error message was clear about what needed to be done to fix this and is good enough for interactive use. But would it be good to add this in some kind of optional requirements document (This is actually invoked by astropy, so it must be an optional requirement of astropy)? The error message I received was:

ImportError                               Traceback (most recent call last)
<ipython-input-100-b2932ff943e5> in <module>()
----> 1 render_fits_image(test_open[1], title='post.fits')

/Users/rbiswas/doc/projects/DESC/Monitor/python/desc/monitor/Display.pyc in render_fits_image(hdu, cmap, stretch, xlabel, ylabel, title, subplot, fig, norm)
     37     if fig is None:
     38         fig = plt.figure()
---> 39     axes = fig.add_subplot(subplot, projection=wcs)
     40 
     41     im = plt.imshow(hdu.data, norm=norm, cmap=cmap, origin='lower',

/usr/local/software/lib/python2.7/site-packages/matplotlib/figure.pyc in add_subplot(self, *args, **kwargs)
    985         else:
    986             projection_class, kwargs, key = process_projection_requirements(
--> 987                 self, *args, **kwargs)
    988 
    989             # try to find the axes with this key in the stack

/usr/local/software/lib/python2.7/site-packages/matplotlib/projections/__init__.pyc in process_projection_requirements(figure, *args, **kwargs)
     98         projection_class = get_projection_class(projection)
     99     elif hasattr(projection, '_as_mpl_axes'):
--> 100         projection_class, extra_kwargs = projection._as_mpl_axes()
    101         kwargs.update(**extra_kwargs)
    102     else:

/usr/local/software/lib/python2.7/site-packages/astropy/wcs/wcs.pyc in _as_mpl_axes(self)
   3045             from wcsaxes import WCSAxes
   3046         except ImportError:
-> 3047             raise ImportError("Using WCS instances as Matplotlib projections "
   3048                               "requires the WCSAxes package to be installed. "
   3049                               "See http://wcsaxes.readthedocs.io for more "

ImportError: Using WCS instances as Matplotlib projections requires the WCSAxes package to be installed. See http://wcsaxes.readthedocs.io for more details.
jchiang87 commented 8 years ago

Yes, we should have a requirements.txt file so that any additional dependencies can be easily installed. In addition to wcsaxes, it would be good to have iminuit for fitting with sncosmo.

rbiswas4 commented 8 years ago

Yes. That is a good one too. Maybe more SNCosmo dependencies as we explore more.