Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions CHAP/xrf/raw_data_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
`NXentry` structure with :class:`~CHAP.common.processor.MapProcessor`.
"""
import argparse
import json
import logging
import os
import sys
from typing import Literal
import yaml

from CHAP.common.map_utils import SpecScanToMapConfigProcessor
from CHAP.common.processor import MapProcessor
Expand All @@ -17,7 +19,7 @@
VORTEX_CONFIG = {
'detectors': [
{'id': i}
for i in range(3)
for i in range(4)
]
}

Expand Down Expand Up @@ -114,7 +116,7 @@ def __call__(self, parser, namespace, values, option_string=None):
if os.path.isfile(values):
# Try loading detector_config from .yaml file
with open(values, 'r') as inf:
detector_config = yaml.load(inf)
detector_config = yaml.safe_load(inf)
elif isinstance(values, str):
# Try loading detector_config from JSON string
detector_config = json.loads(values)
Expand Down Expand Up @@ -225,6 +227,7 @@ def run():

logger.info(f'Using detector configuration {args.detector_config}')
map_config = get_map_config(args)
map_config['spec_scans'][0]['spec_file'] = args.spec_file
logger.info(f'Using map configuration {map_config}')
mapprocessor_config = {
'config': map_config,
Expand Down
Loading