Skip to content

Commit

Permalink
Merge branch 'master' into s1_pattern_map
Browse files Browse the repository at this point in the history
  • Loading branch information
jmosbacher authored Aug 23, 2023
2 parents aedaeee + 6f00f6d commit 14fb0c6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xedocs/data_locations/data_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import yaml
import fsspec

from pydantic import BaseSettings
from pydantic import BaseSettings, validator

from ..utils import Database, LazyFileAccessor

Expand All @@ -17,13 +17,19 @@ class Config:
protocol: str = "file"
config_path: str = "datasets.yml"

@validator("root", pre=True)
def expand_user(cls, value):
if isinstance(value, str):
value = os.path.expanduser(value)
return value

def storage_kwargs(self, path):
return {}

def abs_path(self, path):
if isinstance(path, list):
return [self.abs_path(p) for p in path]
path = os.path.expanduser(path)
if not os.path.isabs(path) and self.root is not None:
path = os.path.join(self.root, path)
return path
Expand Down
1 change: 1 addition & 0 deletions xedocs/schemas/corrections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
from .hotspot_veto_cut import *
from .photoionization_strength import *
from .s1_pattern_maps import *
from .z_bias import *
12 changes: 12 additions & 0 deletions xedocs/schemas/corrections/z_bias.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""
The 'z_bias_map' calculate the z correction due to non-uniform drift velocity based on
the observed r(r_obs) and z(z_obs).
Reference: xenon:xenonnt:terliuk:drift_field_z_bias_correction
"""

from .base_references import BaseResourceReference

class ZBias(BaseResourceReference):
_ALIAS = 'z_bias_maps'
fmt = 'json.gz'

0 comments on commit 14fb0c6

Please sign in to comment.