Skip to content

Commit

Permalink
adding special utility function
Browse files Browse the repository at this point in the history
  • Loading branch information
kttakasaki committed Sep 14, 2023
1 parent ae0e3c7 commit 2b9e126
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion acpreprocessing/stitching_modules/acstitch/zarrutils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pathlib
import zarr
import json

def get_zarr_group(zpath,grpname):
# key to working with zarr files
Expand All @@ -17,4 +18,11 @@ def get_group_from_src(srcpath,
return get_zarr_group(p.parent,p.name)
else:
print(str(p) + " not found!")
return None
return None

def get_src_from_json(sourcejson,plane,tile):
with open(sourcejson,'r') as f:
js = json.load(f)
srcList = js[plane]['sources']
ind = [s.split("_")[-1] for s in srcList].index(tile)
return srcList[ind]

0 comments on commit 2b9e126

Please sign in to comment.