guaix-ucm / megaradrp

MEGARA (Multi-Espectrógrafo en GTC de Alta Resolución para Astronomía) is a facility instrument designed for the 10.4m GTC telescope in La Palma (Spain).
https://guaix.fis.ucm.es/megara/
GNU General Public License v3.0
12 stars 6 forks source link

megaradrp-overplot_traces error after latest update #308

Closed gildepaz closed 4 months ago

gildepaz commented 1 year ago

We have been using megaradrp-overplot_traces under numina 0.30 without any problem, but after updating to numina 0.31 we now get the following error when using megaradrp-overplot_traces. The command used is: megaradrp-overplot_traces --rawimage arc/0003868613-20230616-MEGARA-MegaraArcCalibration.fits obsid4-Tracemap_LCB_LR-R__results/master_traces.json (we can provide these files if needed)

and the resulting error is (the whole output is listed here):

File..: stds/0003868411-20230616-MEGARA-MegaraLcbImage.fits NAXIS1: 4196 NAXIS2: 4212 /opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/axes/_base.py:1918: RuntimeWarning: invalid value encountered in scalar divide fig_aspect = bb.height / bb.width Traceback (most recent call last): File "/opt/miniconda3/envs/Megara/bin/megaradrp-overplot_traces", line 8, in sys.exit(main()) File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/megaradrp/tools/overplot_traces.py", line 141, in main ax = ximshow_file(args.fits_file.name, File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/numina/array/display/ximshow.py", line 639, in ximshow_file ax = ximshow(image2d=image2d, show=False, File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/numina/array/display/ximshow.py", line 455, in ximshow plt.tight_layout() File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/pyplot.py", line 2349, in tight_layout return gcf().tight_layout(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect) File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/figure.py", line 3509, in tight_layout engine.execute(self) File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/layout_engine.py", line 178, in execute kwargs = get_tight_layout_figure( File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/_tight_layout.py", line 266, in get_tight_layout_figure kwargs = _auto_adjust_subplotpars(fig, renderer, File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/_tight_layout.py", line 82, in _auto_adjust_subplotpars bb += [martist._get_tightbbox_for_layout_only(ax, renderer)] File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/artist.py", line 1415, in _get_tightbbox_for_layout_only return obj.get_tightbbox(args, {kwargs, "for_layout_only": True}) File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/axes/_base.py", line 4385, in get_tightbbox ba = martist._get_tightbbox_for_layout_only(axis, renderer) File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/artist.py", line 1415, in _get_tightbbox_for_layout_only return obj.get_tightbbox(args, {kwargs, "for_layout_only": True}) File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/axis.py", line 1323, in get_tightbbox ticks_to_draw = self._update_ticks() File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/axis.py", line 1262, in _update_ticks major_locs = self.get_majorticklocs() File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/axis.py", line 1484, in get_majorticklocs return self.major.locator() File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/ticker.py", line 2136, in call return self.tick_values(vmin, vmax) File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/ticker.py", line 2144, in tick_values locs = self._raw_ticks(vmin, vmax) File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/ticker.py", line 2083, in _raw_ticks nbins = np.clip(self.axis.get_tick_space(), File "/opt/miniconda3/envs/Megara/lib/python3.10/site-packages/matplotlib/axis.py", line 2740, in get_tick_space return int(np.floor(length / size)) ValueError: cannot convert float NaN to integer

sergiopasra commented 1 year ago

Well, works for me...

Could you please write the version of the packages you are using?

Namely, Python itself, numpy, matplotlib, numina and megaradrp