TNO Intern

Commit 1d1ba523 authored by Zanne Korevaar's avatar Zanne Korevaar
Browse files

update the process_lithology.py module conform the new location of the...

update the process_lithology.py module conform the new location of the lithology_properties.xslx resources file
parent 36c578a8
Loading
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
import math
from pathlib import Path
from importlib.resources import files

import numpy as np
import pandas as pd
import xarray as xr

from geoloop.configuration import LithologyConfig
from geoloop.constants import lithology_properties_xlsx
from geoloop.geoloopcore.strat_interpolator import TgInterpolator


@@ -271,7 +271,7 @@ class ProcessLithologyToThermalConductivity:
        read_from_table: bool,
    ) -> None:
        # Read lithology properties reference table (Excel)
        self.lithology_props_df = pd.read_excel(lithology_properties_xlsx)
        self.lithology_props_df = self.load_lithology_properties_df()

        self.borehole_df = borehole_df
        self.lithology_props_dict = self.create_lithology_props_dict()
@@ -299,6 +299,14 @@ class ProcessLithologyToThermalConductivity:
        self.out_table = out_table
        self.read_from_table = read_from_table

    @staticmethod
    def load_lithology_properties_df() -> pd.DataFrame:
        return pd.read_excel(
            files("geoloop.lithology.resources").joinpath(
                "lithology_properties.xlsx"
            )
        )

    def create_lithology_props_dict(self) -> dict[int, "ThermalConductivityCalculator"]:
        """
        Creates a dictionary of physical and thermal properties for different lithologies, in the correct format for