Commit c1826896 authored by Zhang, Yuanpeng's avatar Zhang, Yuanpeng
Browse files

add local routine

parent 31968a5a
Loading
Loading
Loading
Loading

batch_calib.py

0 → 100644
+42 −0
Original line number Diff line number Diff line
import json
import subprocess

with open("cal_config.json", "r") as f:
    input_tmp = json.load(f)

all_dia = {
    "110722": {
        "File": "/SNS/NOM/IPTS-20771/nexus/NOM_110722.nxs.h5",
        "Date": "07-09-2018"
    },
    "111869": {
        "File": "/SNS/NOM/IPTS-21285/nexus/NOM_111869.nxs.h5",
        "Date": "07-23-2018"
    },
    "112596": {
        "File": "/SNS/NOM/IPTS-21285/nexus/NOM_112596.nxs.h5",
        "Date": "08-27-2018"
    },
    "121649": {
        "File": "/SNS/NOM/IPTS-21285/nexus/NOM_121649.nxs.h5",
        "Date": "10-30-2018"
    },
    "122756": {
        "File": "/SNS/NOM/IPTS-22784/nexus/NOM_122756.nxs.h5",
        "Date": "01-15-2019"
    },
    "122825": {
        "File": "/SNS/NOM/IPTS-22784/nexus/NOM_122825.nxs.h5",
        "Date": "01-16-2019"
    },
}

for key, item in all_dia.items():
    input_tmp["Diamond"] = item["File"]
    input_tmp["Date"] = item["Date"]
    input_tmp["GenShadowMask"] = f"shadow_mask_shifter_{key}.in"

    with open('cal_config.json', 'w') as f:
        json.dump(input_tmp, f, indent=4)

    subprocess.check_call(["nom_cal"])
+4 −4
Original line number Diff line number Diff line
{
    "Diamond": "/SNS/NOM/IPTS-30147/nexus/NOM_189201.nxs.h5",
    "Diamond": "/SNS/NOM/IPTS-21285/nexus/NOM_111869.nxs.h5",
    "Instrument": "NOM",
    "Date": "2023-01-10",
    "SampleEnv": "furnace",
    "Date": "07-23-2018",
    "SampleEnv": "shifter",
    "OutputDir": "/SNS/NOM/shared/autoreduce/calibration",
    "GenShadowMask": "shadow_mask_shifter_189201.in",
    "GenShadowMask": "shadow_mask_shifter_111869.in",
    "DiaLattParam": 3.5671299351,
    "GroupMethod": "KMEANS_ED",
    "SaveInitCalTable": true,
+14 −0
Original line number Diff line number Diff line
{
    "Diamond": "/SNS/NOM/IPTS-20771/nexus/NOM_110722.nxs.h5",
    "Instrument": "NOM",
    "Date": "07-08-2018",
    "SampleEnv": "shifter",
    "OutputDir": "/SNS/NOM/shared/autoreduce/calibration",
    "GenShadowMask": "shadow_mask_shifter_110722.in",
    "DiaLattParam": 3.5671299351,
    "GroupMethod": "KMEANS_ED",
    "SaveInitCalTable": true,
    "Quiet": true,
    "ArbCalFile": "arb_starting_cal.h5",
    "MaskFile": "outputmask.xml"
}
+14 −0
Original line number Diff line number Diff line
{
    "Diamond": "/SNS/NOM/IPTS-21285/nexus/NOM_111869.nxs.h5",
    "Instrument": "NOM",
    "Date": "07-23-2018",
    "SampleEnv": "shifter",
    "OutputDir": "/SNS/NOM/shared/autoreduce/calibration",
    "GenShadowMask": "shadow_mask_shifter_111869.in",
    "DiaLattParam": 3.5671299351,
    "GroupMethod": "KMEANS_ED",
    "SaveInitCalTable": true,
    "Quiet": true,
    "ArbCalFile": "arb_starting_cal.h5",
    "MaskFile": "outputmask.xml"
}
+14 −0
Original line number Diff line number Diff line
{
    "Diamond": "/SNS/NOM/IPTS-21285/nexus/NOM_112596.nxs.h5",
    "Instrument": "NOM",
    "Date": "08-07-2018",
    "SampleEnv": "shifter",
    "OutputDir": "/SNS/NOM/shared/autoreduce/calibration",
    "GenShadowMask": "shadow_mask_shifter_112596.in",
    "DiaLattParam": 3.5671299351,
    "GroupMethod": "KMEANS_ED",
    "SaveInitCalTable": true,
    "Quiet": true,
    "ArbCalFile": "arb_starting_cal.h5",
    "MaskFile": "outputmask.xml"
}
Loading