File ~/anaconda3/lib/python3.10/site-packages/pdrtpy/plot/modelplot.py:76, in ModelPlot.ratio(self, identifier, **kwargs)
73 if not kwargs_opts['image'] and kwargs_opts['colors'][0] == 'white':
74 kwargs_opts['colors'][0] = 'black'
---> 76 self._plot_no_wcs(model,**kwargs_opts)
77 if kwargs_opts['legend']:
78 lines = list()
File ~/anaconda3/lib/python3.10/site-packages/pdrtpy/plot/modelplot.py:683, in ModelPlot._plot_no_wcs(self, data, header, **kwargs)
678 #if self._tool is not None:
679 # if self._tool._modelnaxis is None and "NAXIS" not in _header:
680 # raise Exception("Image header/WCS has no NAXIS keyword")
682 if "NAXIS" not in _header:
--> 683 raise Exception("Image header/WCS has no NAXIS keyword")
When creating a new ratio that is not supported by default support by the model, as in the following example:
x = ms.get_model("CI_609")
y = ms.get_model("CO_43")
z = y/x
ms.add_model("CO_43/CI_609",model=z,title="CO(J=4-3)[C I] 609$\mu$m",overwrite=True)
mylines =["CI_609","CI_370","CO_43"]
ms.table.show_in_notebook()
mylines =["CI_609","CI_370","CO_43"]
check supported combinations of lines and ratios in the selected model
mods = ms.get_models(mylines,model_type='both')
mods.keys()
plotting selected model
z = ms.get_models(["CI_609","CI_370","CO_43"],model_type="ratio")
print("Found models: ",z.keys())
for j in z:
I get the following error:
Exception Traceback (most recent call last)
Cell In[75], line 13
---> 13 mp.plot(j,legend=False,contours=True,label=True,yaxis_unit="Draine",cmap='rainbow',norm='zscale') # tab20c
File ~/anaconda3/lib/python3.10/site-packages/pdrtpy/plot/modelplot.py:45, in ModelPlot.plot(self, identifier, **kwargs)
---> 45 self.ratio(identifier,**kwargs_opts)
File ~/anaconda3/lib/python3.10/site-packages/pdrtpy/plot/modelplot.py:76, in ModelPlot.ratio(self, identifier, **kwargs)
---> 76 self._plot_no_wcs(model,**kwargs_opts)
File ~/anaconda3/lib/python3.10/site-packages/pdrtpy/plot/modelplot.py:683, in ModelPlot._plot_no_wcs(self, data, header, **kwargs)
--> 683 raise Exception("Image header/WCS has no NAXIS keyword")
Exception: Image header/WCS has no NAXIS keyword