When I put with_contamination=True as an argument in ta=TFOPAnalysis(), every process goes well but at last part, ta.plot_final_fit() fails. The error message is as below.
ValueError Traceback (most recent call last)
in
----> 1 fig = ta.plot_final_fit();
~/github/MuSCAT2_transit_pipeline/muscat2ta/tfopanalysis.py in plot_final_fit(self, figwidth, save, close)
492 fig.add_axes((0.03, 0.32, 0.96, 0.001), facecolor='k', xticks=[], yticks=[])
493 lpf.plot_posteriors(fig=fig,
--> 494 gridspec=dict(top=0.30, bottom=0.05, left=0.1, right=0.95, wspace=0.03, hspace=0.3))
495 fig.add_axes((0.03, 0.01, 0.96, 0.001), facecolor='k', xticks=[], yticks=[])
496 plotname = self._dres.joinpath(f"{self.ticname}_20{self.date}_MuSCAT2_transit_fit.pdf")
~/github/MuSCAT2_transit_pipeline/muscat2ta/m2lpf.py in plot_posteriors(self, figsize, fig, gridspec, plot_k)
880
881 x = arange(self.nlc)
--> 882 plot_estimates(x, 1e6 * df[k2cols].quantile([0.5, 0.16, 0.84, 0.025, 0.975]).values, axs[0, 0])
883 if self.toi is not None:
884 axs[0, 0].axhline(self.toi.depth[0], c='k', ls='--')
~/github/MuSCAT2_transit_pipeline/muscat2ta/m2lpf.py in plot_estimates(x, p, ax, bwidth, color)
875 k2cols = [c for c in df.columns if 'k2' in c]
876 def plot_estimates(x, p, ax, bwidth=0.8, color='k'):
--> 877 ax.bar(x, p[4, :] - p[3, :], bwidth, p[3, :], alpha=0.25, fc=color)
878 ax.bar(x, p[2, :] - p[1, :], bwidth, p[1, :], alpha=0.25, fc=color)
879 [ax.plot((xx - 0.47 * bwidth, xx + 0.47 * bwidth), (pp[[0, 0]]), 'k') for xx, pp in zip(x, p.T)]
~/miniconda3/lib/python3.6/site-packages/matplotlib/__init__.py in inner(ax, data, *args, **kwargs)
1599 def inner(ax, *args, data=None, **kwargs):
1600 if data is None:
-> 1601 return func(ax, *map(sanitize_sequence, args), **kwargs)
1602
1603 bound = new_sig.bind(ax, *args, **kwargs)
~/miniconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py in bar(self, x, height, width, bottom, align, **kwargs)
2373 x, height, width, y, linewidth = np.broadcast_arrays(
2374 # Make args iterable too.
-> 2375 np.atleast_1d(x), height, width, y, linewidth)
2376
2377 # Now that units have been converted, set the tick locations.
~/.local/lib/python3.6/site-packages/numpy-1.16.3-py3.6-linux-x86_64.egg/numpy/lib/stride_tricks.py in broadcast_arrays(*args, **kwargs)
257 args = [np.array(_m, copy=False, subok=subok) for _m in args]
258
--> 259 shape = _broadcast_shape(*args)
260
261 if all(array.shape == shape for array in args):
~/.local/lib/python3.6/site-packages/numpy-1.16.3-py3.6-linux-x86_64.egg/numpy/lib/stride_tricks.py in _broadcast_shape(*args)
191 # use the old-iterator because np.nditer does not handle size 0 arrays
192 # consistently
--> 193 b = np.broadcast(*args[:32])
194 # unfortunately, it cannot handle 32 or more arguments directly
195 for pos in range(32, len(args), 31):
ValueError: shape mismatch: objects cannot be broadcast to a single shape
When I put with_contamination=True as an argument in ta=TFOPAnalysis(), every process goes well but at last part, ta.plot_final_fit() fails. The error message is as below.
ValueError Traceback (most recent call last)