-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
51 lines (42 loc) · 1.37 KB
/
Copy pathmain.py
File metadata and controls
51 lines (42 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""
Robotic-3D-DIC: Automated Image Acquisition System
Developed at ForMatLab, Penn State University (2025)
Author: Özgüç B. Çapunaman
Maintainers: Özgüç B. Çapunaman, Alale Mohseni
GitHub: https://github.com/ForMat-Lab/Robotic-3D-DIC
"""
import logging
from src.util import load_config, validate_config
from src.Experiment import Experiment
# Configure logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)
def main():
"""
Main entry point for the Robotic-3D-DIC experiment.
Loads configuration, validates it, then runs the Experiment.
"""
try:
# Load configuration
config = load_config()
if not config:
logger.error("Failed to load configuration.")
return
# Validate configuration
validate_config(config)
logger.info("Configuration validation successful.")
# Create and run the experiment
experiment = Experiment(config)
experiment.run()
except ValueError as ve:
logger.error(f"Configuration Error: {ve}")
except Exception as e:
logger.error(f"An unexpected error occurred: {e}")
# Ensure cleanup in case of an exception
if 'experiment' in locals():
experiment.cleanup()
if __name__ == "__main__":
main()