-
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.
- Loading branch information
Showing
3 changed files
with
77 additions
and
5 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 |
---|---|---|
@@ -1,8 +1,31 @@ | ||
from .ibeatles import main | ||
#!/usr/bin/env python | ||
"""Module entry""" | ||
|
||
import sys | ||
import argparse | ||
from pathlib import Path | ||
from ibeatles.ibeatles import main as gui_main | ||
from ibeatles.app.cli import main as cli_main | ||
|
||
__file__ = "ibeatles.py" | ||
__main__ = "iBeatles" | ||
|
||
sys.exit(main(sys.argv)) | ||
def main(): | ||
parser = argparse.ArgumentParser(description="iBeatles - Bragg Edge Analysis Tool") | ||
parser.add_argument("--no-gui", action="store_true", help="Run in CLI mode") | ||
parser.add_argument( | ||
"config", nargs="?", help="Path to the configuration file for CLI mode" | ||
) | ||
parser.add_argument("--log", type=Path, help="Path to the log file (optional)") | ||
|
||
args = parser.parse_args() | ||
|
||
if args.no_gui: | ||
if not args.config: | ||
print("Error: Configuration file is required for CLI mode.") | ||
sys.exit(1) | ||
cli_main(args.config, args.log) | ||
else: | ||
gui_main(sys.argv) | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) |
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,49 @@ | ||
{ | ||
"raw_data": { | ||
"raw_data_dir": "/Users/8cz/SNS/SNAP/IPTS-26171/shared/mcp_transfer/corrected/Inconel_Sample", | ||
"raw_data_extension": ".fits" | ||
}, | ||
"open_beam": { | ||
"open_beam_data_dir": "/Users/8cz/SNS/SNAP/IPTS-26171/shared/mcp_transfer/corrected/Inconel_OB", | ||
"open_beam_data_extension": ".fits" | ||
}, | ||
"normalization": { | ||
"sample_background": [ | ||
{ "x0": 10, "y0": 10, "width": 50, "height": 50}, | ||
{ "x0": 0, "y0": 0, "width": 3, "height": 3} | ||
], | ||
"moving_average": { | ||
"active": true, | ||
"dimension": "2D", | ||
"size": { | ||
"y": 3, | ||
"x": 3 | ||
}, | ||
"type": "Box" | ||
}, | ||
"processing_order": "Moving average, Normalization" | ||
}, | ||
"analysis": { | ||
"material": { | ||
"element": "Fe" | ||
}, | ||
"pixel_binning": { | ||
"x0": 0, | ||
"y0": 0, | ||
"width": 100, | ||
"height": 100, | ||
"bins_size": 1 | ||
}, | ||
"fitting": { | ||
"lambda_min": 0.5, | ||
"lambda_max": 5.0 | ||
}, | ||
"strain_mapping": {}, | ||
"distance_source_detector_in_m": 10.0, | ||
"detector_offset_in_us": 4500.0 | ||
}, | ||
"output": { | ||
"normalized_data_dir": "/Users/8cz/tmp/ibeatles_dev/normalized", | ||
"analysis_results_dir": "/Users/8cz/tmp/ibeatles_dev/analysis" | ||
} | ||
} |