TNO Intern

Commit 6fd1bf20 authored by Zanne Korevaar's avatar Zanne Korevaar
Browse files

Fix calculation and plotting in depthplots of heat flow in W/m (negative for...

Fix calculation and plotting in depthplots of heat flow in W/m (negative for heat injection and positive for heat extraction)
parent d6b818b3
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -616,7 +616,7 @@ class PlotResults:

                dz = zp[1] - zp[0]
                if model_type in ["ANALYTICAL"]:
                    qbzm = qzb / dz
                    qbzm = qzb / abs(dz)
                    ax2.plot(
                        qbzm,
                        zseg,
@@ -624,7 +624,7 @@ class PlotResults:
                        color=next(color_iter_ax2),
                    )
                elif model_type in ["FINVOL"]:
                    qbzm = qzb / dz
                    qbzm = qzb / abs(dz)
                    qbzm[0] *= 2
                    qbzm[-1] *= 2
                    ax2.plot(
@@ -639,6 +639,9 @@ class PlotResults:
                    q_plot = qbzm * np.ones(len(zp))
                    # because of UBWT condition the heat flow is not linear
                    # ax2.plot(q_plot, zp, label=f'{file_name}: Heat Flow', color=next(color_iter_ax2))
                    # remove label of x-axis
                    ax2.set_xlabel("")
                    ax2.set_xticklabels("")
                else:
                    print(f"Unrecognized model type: {model_type}")

@@ -685,6 +688,10 @@ class PlotResults:
            # combine the legends from the second plot primary and secondary axis
            handles2, labels2 = ax2.get_legend_handles_labels()
            handles3, labels3 = ax2twin.get_legend_handles_labels()
            if model_type in ["PYG", "PYGFIELD"]:
                all_handles = handles2
                all_labels = labels2
            else:
                all_handles = handles2 + handles3
                all_labels = labels2 + labels3
            # Create a single combined legend and define legend location