-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from project8/develop
Improved user interface
- Loading branch information
Showing
15 changed files
with
1,025 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
""" | ||
Author: F. Thomas | ||
Date: August 07, 2023 | ||
""" | ||
|
||
from hercules import Dataset, LocustP3File | ||
from pathlib import Path | ||
|
||
module_dir = Path(__file__).parent.absolute() | ||
dataset_name = 'workingDirP3' | ||
|
||
path = module_dir / dataset_name | ||
|
||
#load the hercules dataset | ||
dataset = Dataset.load(path) | ||
|
||
#print the metadata which is valid for all entries in the dataset | ||
print(dataset.meta_data) | ||
|
||
#print the axes of the dataset grid | ||
axes = dataset.axes | ||
for i, ax in enumerate(axes): | ||
print(f'{dataset.config_data_keys[i]} -> {ax}' ) | ||
|
||
#get path to data by index of all data axes | ||
param, path = dataset.get_path([0, 0, 0, 0, 0], method='index') | ||
print(param, path) | ||
|
||
#use path | ||
data = LocustP3File(path / 'someFileName.egg') | ||
|
||
#get path to data by exact value | ||
param, path = dataset.get_path([0., 0., 0., 87., 18600.], method='exact') | ||
print(param, path) | ||
|
||
#get path to data by exact value | ||
param, path = dataset.get_path([axes[0][3], axes[1][0], axes[2][0], axes[3][0], axes[4][0]], method='exact') | ||
print(param, path) | ||
|
||
#get path to data by value using nearest neighbor interpolation | ||
param, path = dataset.get_path([0.0, 0.0, 0.0, 0.0, 0.0], method='interpolated') | ||
print(param, path) | ||
|
||
#iterate over all data in dataset | ||
for param, path in dataset: | ||
print(param, path) | ||
data = LocustP3File(path / 'someFileName.egg') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.