parent
e3368c1817
commit
531463a637
@ -4,4 +4,8 @@ from pyzebra.h5 import *
|
|||||||
from pyzebra.xtal import *
|
from pyzebra.xtal import *
|
||||||
from pyzebra.ccl_process import *
|
from pyzebra.ccl_process import *
|
||||||
|
|
||||||
|
ZEBRA_PROPOSALS_PATHS = [
|
||||||
|
f"/afs/psi.ch/project/sinqdata/{year}/zebra/" for year in (2016, 2017, 2018, 2020, 2021)
|
||||||
|
]
|
||||||
|
|
||||||
__version__ = "0.3.2"
|
__version__ = "0.3.2"
|
||||||
|
@ -76,8 +76,14 @@ def create():
|
|||||||
|
|
||||||
def proposal_textinput_callback(_attr, _old, new):
|
def proposal_textinput_callback(_attr, _old, new):
|
||||||
proposal = new.strip()
|
proposal = new.strip()
|
||||||
year = new[:4]
|
for zebra_proposals_path in pyzebra.ZEBRA_PROPOSALS_PATHS:
|
||||||
proposal_path = f"/afs/psi.ch/project/sinqdata/{year}/zebra/{proposal}"
|
proposal_path = os.path.join(zebra_proposals_path, proposal)
|
||||||
|
if os.path.isdir(proposal_path):
|
||||||
|
# found it
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
raise ValueError(f"Can not find data for proposal '{proposal}'.")
|
||||||
|
|
||||||
file_list = []
|
file_list = []
|
||||||
for file in os.listdir(proposal_path):
|
for file in os.listdir(proposal_path):
|
||||||
if file.endswith((".ccl", ".dat")):
|
if file.endswith((".ccl", ".dat")):
|
||||||
|
@ -55,8 +55,14 @@ def create():
|
|||||||
|
|
||||||
def proposal_textinput_callback(_attr, _old, new):
|
def proposal_textinput_callback(_attr, _old, new):
|
||||||
proposal = new.strip()
|
proposal = new.strip()
|
||||||
year = new[:4]
|
for zebra_proposals_path in pyzebra.ZEBRA_PROPOSALS_PATHS:
|
||||||
proposal_path = f"/afs/psi.ch/project/sinqdata/{year}/zebra/{proposal}"
|
proposal_path = os.path.join(zebra_proposals_path, proposal)
|
||||||
|
if os.path.isdir(proposal_path):
|
||||||
|
# found it
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
raise ValueError(f"Can not find data for proposal '{proposal}'.")
|
||||||
|
|
||||||
file_list = []
|
file_list = []
|
||||||
for file in os.listdir(proposal_path):
|
for file in os.listdir(proposal_path):
|
||||||
if file.endswith(".hdf"):
|
if file.endswith(".hdf"):
|
||||||
|
@ -81,8 +81,14 @@ def create():
|
|||||||
|
|
||||||
def proposal_textinput_callback(_attr, _old, new):
|
def proposal_textinput_callback(_attr, _old, new):
|
||||||
proposal = new.strip()
|
proposal = new.strip()
|
||||||
year = new[:4]
|
for zebra_proposals_path in pyzebra.ZEBRA_PROPOSALS_PATHS:
|
||||||
proposal_path = f"/afs/psi.ch/project/sinqdata/{year}/zebra/{proposal}"
|
proposal_path = os.path.join(zebra_proposals_path, proposal)
|
||||||
|
if os.path.isdir(proposal_path):
|
||||||
|
# found it
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
raise ValueError(f"Can not find data for proposal '{proposal}'.")
|
||||||
|
|
||||||
file_list = []
|
file_list = []
|
||||||
for file in os.listdir(proposal_path):
|
for file in os.listdir(proposal_path):
|
||||||
if file.endswith((".ccl", ".dat")):
|
if file.endswith((".ccl", ".dat")):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user