Skip to content

Commit

Permalink
(*) Summary_script (#31)
Browse files Browse the repository at this point in the history
* (*) potential bug in summary script

Sometimes the finabs were not properly summarized. However, this seem to
depend on the numpy version. Made it bullet-proof now...
  • Loading branch information
Mreichert91 authored Nov 5, 2024
1 parent a8afa88 commit 1eaf27e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bin/summary_script/summarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from src_files.wreader import wreader
from src_files.template_class import template
from src_files.nucleus_multiple_class import nucleus_multiple
import matplotlib.pyplot as plt



Expand Down Expand Up @@ -334,6 +335,9 @@
# Recover the original indices from the sorted index
indices = nuclei_sorted_idx[matching_idx]

# Set first zero
finab_data_Y[:,ind % buffsize] = 0
finab_data_X[:,ind % buffsize] = 0
finab_data_Y[indices,ind % buffsize] = data.finab["Y"][:]
finab_data_X[indices,ind % buffsize] = data.finab["X"][:]

Expand All @@ -355,9 +359,7 @@
run_names[ind % buffsize] = d



# Get numbers out from the run name

# Check if the run_ids is full and write it to the hdf5 file
if ind % buffsize == 0 and ind != 0:
# Check if the dataset is already created and if not create it
Expand Down Expand Up @@ -416,6 +418,7 @@
f_hdf["snapshots/X"][:,:,ind-buffsize:ind] = snapshot_data*nuclei_data.A[:,np.newaxis,np.newaxis]

# Store it
snapshot_data[:,:,ind % buffsize] = 0
snapshot_data[indices_nuclei,:,ind % buffsize] = data.Y[indexes][:, :].T

# Set entries to nan if necessary (e.g., if run does not contain a time at the beginning or end)
Expand Down Expand Up @@ -449,7 +452,7 @@
logger.info(f"Finished looping over all directories, writing the last data to the hdf5 file.")


# Write the last data to the hdf5 file
# # Write the last data to the hdf5 file

#### Finab ####
###############
Expand Down

0 comments on commit 1eaf27e

Please sign in to comment.