Add files via upload

This commit is contained in:
David Rotermund 2024-02-22 14:40:35 +01:00 committed by GitHub
parent 95ead89a0f
commit 6f6b1c00f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 56 additions and 65 deletions

View file

@ -49,8 +49,6 @@ test_overwrite_with_old_aligned: bool = True
filename_data_binning_replace: str = "bin_old/Exp001_Trial001_Part001.mat"
filename_data_aligned_replace: str = "aligned_old/Exp001_Trial001_Part001.mat"
remove_heartbeat: bool = True
data = torch.tensor(np.load(filename_raw).astype(np.float32), dtype=dtype)
with open(filename_raw_json, "r") as file_handle:
@ -121,7 +119,7 @@ if test_overwrite_with_old_aligned:
# ->
if remove_heartbeat:
mask: torch.Tensor = make_mask(
filename_mask=filename_mask,
camera_sequence=camera_sequence,
@ -182,15 +180,10 @@ if remove_heartbeat:
donor_power_factor = heartbeat_coefficients[channels.index("donor")].clone()
acceptor_power_factor = heartbeat_coefficients[channels.index("acceptor")].clone()
power_factors: None | list[torch.Tensor] = [
donor_power_factor,
acceptor_power_factor,
]
for i in range(0, len(camera_sequence)):
camera_sequence[i] -= heartbeat_coefficients[i] * volume_heartbeat
else:
power_factors = None
# <-
data_acceptor, data_donor, mask = preprocessing(
@ -203,10 +196,8 @@ data_acceptor, data_donor, mask = preprocessing(
temporal_width=temporal_width,
target_camera=target_camera,
regressor_cameras=regressor_cameras,
lower_frequency_heartbeat=lower_frequency_heartbeat,
upper_frequency_heartbeat=upper_frequency_heartbeat,
sample_frequency=sample_frequency,
power_factors=power_factors,
donor_correction_factor=donor_power_factor,
acceptor_correction_factor=acceptor_power_factor,
)
ratio_sequence: torch.Tensor = data_acceptor / data_donor

View file

@ -8,7 +8,7 @@ import scipy.io as sio # type: ignore
from functions.binning import binning
from functions.align_cameras import align_cameras
from functions.preprocessing import preprocessing
from functions.preprocessing_classic import preprocessing
from functions.bandpass import bandpass