TNO Intern

Commit 57c5d147 authored by Jan Diederik van Wees's avatar Jan Diederik van Wees
Browse files

update for returning na if doubletcalc does not give value

parent b41eeed4
Loading
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -104,8 +104,9 @@ def calculate_performance_of_single_location(mask: float, depth: float, thicknes
    # The Java routine which calculates DoubletPerformance, for more detail on the simulation inspect the Java source code
    doublet.calculateDoubletPerformance(-9999.0, thickness, transmissivity, False)

    if doublet.getUtcPeurctkWh() == -9999.0:  # If calculation was not successful, return all 0.0
        return 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    if doublet.getUtcPeurctkWh() == -9999.0:  # If calculation was not successful, return all nan
        return np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan
        #return 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0

    # calculate net-present-value using the utc-cutoffs
    if depth > utc_properties.utcDeepDepth():