Skip to content
Snippets Groups Projects
Commit 9360b7dd authored by Leon Michel Gorißen's avatar Leon Michel Gorißen
Browse files

wip

parent bdf808e1
No related branches found
No related tags found
No related merge requests found
...@@ -31,21 +31,17 @@ def gauss(x: np.ndarray, *p: float) -> np.ndarray: ...@@ -31,21 +31,17 @@ def gauss(x: np.ndarray, *p: float) -> np.ndarray:
# Initial guess for Gaussian parameters # Initial guess for Gaussian parameters
p0 = [1, 0, 1] p0 = [1, 0, 1]
def analyze() -> None: def analyze(directory: str, dataset: str) -> None:
""" """
Analyzes datasets in specified directories, generates statistics, and creates plots. Analyzes the specified dataset in the given directory, generates statistics, and creates plots.
This function processes datasets, performs statistical analysis, and saves the results Args:
and plots for each dataset. directory (str): The directory containing the dataset.
dataset (str): The dataset to be analyzed (e.g., "train", "test").
Returns: Returns:
None None
""" """
directories = ["dataset_v1", "dataset_v2", "dataset_v3"]
datasets = ["train", "test"]
for directory in directories:
for dataset in datasets:
# Initialize empty arrays for data collection # Initialize empty arrays for data collection
attained_freqs = np.empty([0, 1]) attained_freqs = np.empty([0, 1])
duration_meas = np.empty(0, np.float32) duration_meas = np.empty(0, np.float32)
...@@ -211,6 +207,12 @@ def analyze() -> None: ...@@ -211,6 +207,12 @@ def analyze() -> None:
fig.savefig(f"data/{directory}/analysis/hist_{dataset}_{names[i]}.png") fig.savefig(f"data/{directory}/analysis/hist_{dataset}_{names[i]}.png")
plt.close(fig) plt.close(fig)
if __name__ == "__main__": if __name__ == "__main__":
analize() directories = ["dataset_v1", "dataset_v2", "dataset_v3"]
\ No newline at end of file datasets = ["train", "test"]
#TODO test if this works
for directory in directories:
for dataset in datasets:
analyze(directory,dataset)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment