thespacedoctor / breaker

Tools for the PanSTARRS & ATLAS LIGO-VIRGO (PSAT) group to aid surveys of the likely sky-locations of LIGO-VIRGO discovered Gravitational Waves
MIT License
1 stars 0 forks source link

wcs raising AttributeError: 'NoneType' object has no attribute 'set' #1

Closed thespacedoctor closed 8 years ago

thespacedoctor commented 8 years ago

this issue was raised by @mcoughlin ...

NSIDE = 512
ORDERING = NESTED in fits file
INDXSCHM = IMPLICIT
Ordering converted to RING
Total Probability for the entire sky is 1.0000000002
Probability for the plot stamp is 0.0455527102129
Traceback (most recent call last):
  File "/home/marshall/.virtualenv/breaker/bin/breaker", line 9, in <module>
    load_entry_point('breaker==1.0.2', 'console_scripts', 'breaker')()
  File "/home/marshall/.virtualenv/breaker/lib/python2.7/site-packages/breaker/cl_utils.py", line 140, in main
    p.get()
  File "/home/marshall/.virtualenv/breaker/lib/python2.7/site-packages/breaker/plots/plot_wave_observational_timelines.py", line 160, in get
    self.get_timeline_plots()

  File "/home/marshall/.virtualenv/breaker/lib/python2.7/site-packages/breaker/plots/plot_wave_observational_timelines.py", line 1400, in get_timeline_plots
    probabilityCut=self.probabilityCut)
  File "/home/marshall/.virtualenv/breaker/lib/python2.7/site-packages/breaker/plots/plot_wave_observational_timelines.py", line 728, in generate_probability_plot
    ax = fig.add_axes([0.15, 0.1, 0.8, 0.8], projection=wcs)
  File "/home/marshall/.virtualenv/breaker/lib/python2.7/site-packages/matplotlib-2.0.0b3-py2.7-linux-x86_64.egg/matplotlib/figure.py", line 915, in add_axes
    a = projection_class(self, rect, **kwargs)
  File "/home/marshall/.virtualenv/breaker/lib/python2.7/site-packages/wcsaxes/core.py", line 44, in __init__
    self.reset_wcs(wcs=wcs, slices=slices, transform=transform, coord_meta=coord_meta)
  File "/home/marshall/.virtualenv/breaker/lib/python2.7/site-packages/wcsaxes/core.py", line 146, in reset_wcs
    wcs.wcs.set()
AttributeError: 'NoneType' object has no attribute 'set'
thespacedoctor commented 8 years ago

it seems that by following this alternative method I was able to solve the issue of wcs.wcs == None ... that is by explicitly initializing WCSAxes instead of letting astropy.wcs.WCS do all the work.