Skip to content

Commit

Permalink
AD: Small correction to account nan data in the TP profile grid
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan Denis committed Jan 9, 2025
1 parent 0f3d561 commit 45f33a1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ForMoSA/plotting/plotting_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -1109,16 +1109,16 @@ def plot_PT(self, path_temp_profile, figsize=(6,5), model = 'ExoREM'):
#Calcule le profil le plus probable
Tfit = []
for i in range(0, len(P)):
Tfit.append(np.percentile(temperature_profiles[:,i], 50))
Tfit.append(np.nanpercentile(temperature_profiles[:,i], 50))
#Calcule les percentiles 68 et 96 du profil le plus probable
Tinf68, Tsup68, Tinf95, Tsup95 = [], [], [], []
for i in range(0, len(P)):
Tinf68.append(np.percentile(temperature_profiles[:,i], 16))
Tsup68.append(np.percentile(temperature_profiles[:,i], 84))
Tinf95.append(np.percentile(temperature_profiles[:,i], 2))
Tsup95.append(np.percentile(temperature_profiles[:,i], 98))
Tinf68.append(np.nanpercentile(temperature_profiles[:,i], 16))
Tsup68.append(np.nanpercentile(temperature_profiles[:,i], 84))
Tinf95.append(np.nanpercentile(temperature_profiles[:,i], 2))
Tsup95.append(np.nanpercentile(temperature_profiles[:,i], 98))
#Plot le profil le plus probable et les percentiles associés

fig = plt.figure(figsize=figsize)
ax = plt.axes()
ax.fill_betweenx(P, Tinf95, Tsup95, color=self.color_out, alpha=0.1, label=r'2 $\sigma$')
Expand Down

0 comments on commit 45f33a1

Please sign in to comment.