|
33 | 33 | from emcee import EnsembleSampler |
34 | 34 | from matplotlib.pyplot import subplots, setp, figure, Figure, Axes |
35 | 35 | from numpy import (where, sqrt, clip, percentile, median, squeeze, floor, ndarray, |
36 | | - array, inf, newaxis, arange, tile, sort, argsort, concatenate, full, nan, r_) |
| 36 | + array, inf, newaxis, arange, tile, sort, argsort, concatenate, full, nan, r_, nanpercentile) |
37 | 37 | from numpy.random import normal, permutation |
38 | 38 | from pytransit import UniformPrior, NormalPrior |
39 | 39 | from pytransit.orbits import epoch |
@@ -912,17 +912,12 @@ def plot_residuals(self, result: Optional[str] = None, ax: None | Axes | Sequenc |
912 | 912 | for ids, data in enumerate(self.data): |
913 | 913 | ax = axs[ids] |
914 | 914 | residuals = data.fluxes - squeeze(fmodel[ids]) |
915 | | - pp = percentile(residuals, [pmin, pmax]) |
| 915 | + pp = nanpercentile(residuals, [pmin, pmax]) |
916 | 916 | data.plot(ax=ax, data=residuals, vmin=pp[0], vmax=pp[1], cmap=cmap) |
917 | 917 |
|
918 | 918 | tc = pv[1] + pv[2]*epoch(data.time.mean(), pv[1], pv[2]) |
919 | 919 | td = self.transit_duration |
920 | 920 |
|
921 | | - #for i in range(2): |
922 | | - # ax.axvline(tc + (-1) ** i * 0.5 * td - self._tref, c='w', ymax=0.05, lw=5) |
923 | | - # ax.axvline(tc + (-1) ** i * 0.5 * td - self._tref, c='w', ymin=0.95, lw=5) |
924 | | - # ax.axvline(tc + (-1) ** i * 0.5 * td - self._tref, c='k', ymax=0.05, lw=1) |
925 | | - # ax.axvline(tc + (-1) ** i * 0.5 * td - self._tref, c='k', ymin=0.95, lw=1) |
926 | 921 | if not show_names: |
927 | 922 | ax.set_title("") |
928 | 923 |
|
|
0 commit comments