Skip to content
Snippets Groups Projects
Commit 9546da7b authored by Rudolf, Michael's avatar Rudolf, Michael
Browse files

Merge branch 'main' of git-ce.rwth-aachen.de:rudolf/u4py

parents 07d7a45f 8860ca9a
No related branches found
No related tags found
No related merge requests found
...@@ -270,7 +270,7 @@ def invert_time_series( ...@@ -270,7 +270,7 @@ def invert_time_series(
including *ALL* stations and not solve this for each single station. You do including *ALL* stations and not solve this for each single station. You do
that by concatenating all stations and components into one big G-Matrix. that by concatenating all stations and components into one big G-Matrix.
""" """
_clean_inputs(data) data = _clean_inputs(data)
if not ind: if not ind:
ind = slice(len(data["t"])) ind = slice(len(data["t"]))
ori = True ori = True
...@@ -340,15 +340,16 @@ def _clean_inputs(data: dict): ...@@ -340,15 +340,16 @@ def _clean_inputs(data: dict):
:type data: dict :type data: dict
""" """
logging.info("Cleaning inputs.") logging.info("Cleaning inputs.")
ind = np.nonzero(
np.isfinite(data["dataN"])
| np.isfinite(data["dataE"])
| np.isfinite(data["dataU"])
)
for kk in data.keys(): for kk in data.keys():
if isinstance(data[kk], np.ndarray) and kk != "inversion_results": if isinstance(data[kk], np.ndarray) and kk != "inversion_results":
data[kk] = data[kk][ind] ind = np.isfinite(data[kk])
for ll in data.keys():
if (
isinstance(data[ll], np.ndarray)
and kk != "inversion_results"
):
data[ll] = data[ll][ind]
return data
def _invert( def _invert(
......
...@@ -21,7 +21,7 @@ import u4py.utils.projects as u4proj ...@@ -21,7 +21,7 @@ import u4py.utils.projects as u4proj
def main(): def main():
project = u4proj.get_project( project = u4proj.get_project(
proj_path=Path( proj_path=Path(
r"~\Documents\ArcGIS\U4_projects\Examples\PSI_Fit_FFM_Regions_BBD+EGMS.u4project" r"~/Documents/umwelt4/Bericht_FFM_BBD_EGMS.u4project"
).expanduser(), ).expanduser(),
required=[ required=[
"base_path", "base_path",
...@@ -62,7 +62,7 @@ def main(): ...@@ -62,7 +62,7 @@ def main():
) )
results_log = [] results_log = []
os.makedirs(processing_path, exist_ok=True) os.makedirs(processing_path, exist_ok=True)
os.makedirs(project["paths"]["output_path"], exist_ok=True)
# Loading Data # Loading Data
regions = u4files.get_rois(project["paths"]["piloten_path"]) regions = u4files.get_rois(project["paths"]["piloten_path"])
for name, roi in tqdm(regions, desc="Reading Data and Creating Plots"): for name, roi in tqdm(regions, desc="Reading Data and Creating Plots"):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment