Skip to content

Commit

Permalink
Merge pull request #10 from ARPES-ASTRID/merged_spectra
Browse files Browse the repository at this point in the history
Merged spectra
  • Loading branch information
steinnymir authored Jan 25, 2024
2 parents b809ef7 + f50a2c1 commit b005d2a
Show file tree
Hide file tree
Showing 8 changed files with 501 additions and 207 deletions.
64 changes: 50 additions & 14 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,58 @@
from smartscan import AsyncScanManager


batched = True


def batches(settings,logger) -> None:
iter_pars = [0.1,0.5,1,2,3]
batched = False

def batches(settings,logger):
aqf_batch(settings,logger)

def aqf_batch(settings,logger) -> None:
tasks = {
'curvature': {
'func': 'curvature',
'params': {
'sigma': 10,
'roi': [[145,190],[10,140]]
}
},
'laplace_filter': {
'func': 'laplace_filter',
'params': {
'bw': 5,
'c1': 0.001,
'c2': 0.001,
'w': 1,
'roi': [[145, 190], [10, 140]]
}
},
}
rois = [[145,190],[10,140]], [[45,190],[10,140]]
aqf_values = [0.1,0.5,1]
i = 1
# ~~~batch~~~~
for val in iter_pars:
logger.info(f"Starting batch run #{i}")
settings['acquisition_function']['params']['a'] = 0.1
settings['cost_function']['params']['weight'] = 0.1
run_asyncio(settings)
logger.info(f'Finished batch run #{i}')
logger.info(f'Waiting for 30 seconds')
time.sleep(30)
i += 1
for task in tasks.keys():
for roi in rois:
settings['tasks'] = {
"mean": {
"func": "mean",
"params": {
"roi":roi
}
},
task: tasks[task]
}
settings['tasks'][task]['params']['roi'] = roi
for val in aqf_values:
logger.info(f"Starting batch run #{i}")
settings['acquisition_function']['params']['a'] = val
run_asyncio(settings)
print(f"tasks: {settings['tasks'].keys()}")
print(f"roi: {settings['tasks']['mean']['params']['roi']}")
print(f"a: {settings['acquisition_function']['params']['a']}")
logger.info(f'Finished batch run #{i}')
logger.info(f'Waiting for 30 seconds')
time.sleep(30)
i += 1



Expand Down
10 changes: 7 additions & 3 deletions scan_settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ plots:
posterior_map_shape: [50,50] #full #"auto"

scanning:
max_points: 750 # 0 for unlimited
duration: 1_000_000
max_points: 1000 # 0 for unlimited
duration: 3600
train_at: [10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000]
train_every: 0 # 0 for no training
normalize_values: training # one of init, training, always, fixed or never
fixed_normalization: [1.0, 1.0] # normalization factors for each task

merge_unique_positions: true
base_error: 0.01 # 1% error
initial_points_2D: hexgrid_19
initial_points_3D: border_25

preprocessing:
# list of preprocessing functions to apply to the data.
# Functions are chained in the order they are listed.
Expand Down
2 changes: 1 addition & 1 deletion smartscan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
from .virtualSGM4 import VirtualSGM4
from .asyncscanner import AsyncScanManager

__version__ = "0.3.5"
__version__ = "0.4.0"
__all__ = [AsyncScanManager, VirtualSGM4]
Loading

0 comments on commit b005d2a

Please sign in to comment.