diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..237fb3f --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.hdf filter=lfs diff=lfs merge=lfs -text diff --git a/libeos/event_handling.py b/libeos/event_handling.py index c6052e6..0978fb7 100644 --- a/libeos/event_handling.py +++ b/libeos/event_handling.py @@ -44,7 +44,7 @@ class ApplyParameterOverwrites(EventDataAction): def update_header(self, header:Header) ->None: if self.config.sampleModel: import yaml - from orsopy.fileio import Sample + from orsopy.fileio.model_language import SampleModel if 'yml' in self.config.sampleModel or 'yaml' in self.config.sampleModel: if os.path.isfile(self.config.sampleModel): with open(self.config.sampleModel, 'r') as model_yml: @@ -54,7 +54,7 @@ class ApplyParameterOverwrites(EventDataAction): else: model = dict(stack=self.config.sampleModel) logging.debug(f' set sample.model = {self.config.sampleModel}') - header.sample.model = Sample.from_dict(model) + header.sample.model = SampleModel.from_dict(model) class CorrectChopperPhase(EventDataAction): diff --git a/test_data/amor2025n005952.hdf b/test_data/amor2025n005952.hdf new file mode 100644 index 0000000..d1d7824 --- /dev/null +++ b/test_data/amor2025n005952.hdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a6c94bb1e1c2c41290bb5c13aa593bbb031dc28662b91dd4cb5f512ca501697 +size 164227616 diff --git a/test_data/amor2025n006003.hdf b/test_data/amor2025n006003.hdf new file mode 100644 index 0000000..3c06f83 --- /dev/null +++ b/test_data/amor2025n006003.hdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4d32f754edc6beda8c6b3943d7962121eb5ec36be8245efa7749776ae97208f +size 511262 diff --git a/test_data/amor2025n006004.hdf b/test_data/amor2025n006004.hdf new file mode 100644 index 0000000..42e5eb7 --- /dev/null +++ b/test_data/amor2025n006004.hdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48d3bea779abb6ec415f051cb77d1d67ff04e6e57e55ed2eacfe18448a7c1056 +size 765639 diff --git a/test_data/amor2025n006005.hdf b/test_data/amor2025n006005.hdf new file mode 100644 index 0000000..adf8e79 --- /dev/null +++ b/test_data/amor2025n006005.hdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e523acca89e18f66d1ab73b823425ea9d0bec5c59d3b467247ea082ecd5ff5a +size 3293620 diff --git a/tests/analyze_hdf.py b/tests/analyze_hdf.py new file mode 100644 index 0000000..7d700ab --- /dev/null +++ b/tests/analyze_hdf.py @@ -0,0 +1,31 @@ +""" +Small helper to find information about hdf datafiles for debugging +""" + +import h5py + +def rec_tree(group, min_size=128): + if hasattr(group, 'keys'): + output = {} + total_size = 0 + for key in group.keys(): + subkeys, size = rec_tree(group[key], min_size) + total_size += size + if size>min_size: + if subkeys: + output[key] = subkeys + else: + output[key] = size + return output, size + elif hasattr(group, 'size'): + return None, group.size + else: + return None, 0 + +if __name__ == "__main__": + import sys + for fi in sys.argv[1:]: + print(fi) + print(rec_tree(sys.argv[1])) + + \ No newline at end of file diff --git a/tests/test_full_analysis.py b/tests/test_full_analysis.py index 1235a02..4bdc265 100644 --- a/tests/test_full_analysis.py +++ b/tests/test_full_analysis.py @@ -50,8 +50,8 @@ class FullAmorTest(TestCase): chopperPhaseOffset=-5, monitorType=self._field_defaults['ExperimentConfig']['monitorType'], lowCurrentThreshold=self._field_defaults['ExperimentConfig']['lowCurrentThreshold'], - yRange=(11, 41), - lambdaRange=(2., 15.), + yRange=(18, 48), + lambdaRange=(3., 11.5), incidentAngle=self._field_defaults['ExperimentConfig']['incidentAngle'], mu=0, nu=0, @@ -62,9 +62,8 @@ class FullAmorTest(TestCase): normalisationMethod=self._field_defaults['ReductionConfig']['normalisationMethod'], qResolution=0.01, qzRange=self._field_defaults['ReductionConfig']['qzRange'], - thetaRange=(-12., 12.), - thetaRangeR=(-12., 12.), - fileIdentifier=["5980", "5981", "5983-5985"], + thetaRange=(-0.75, 0.75), + fileIdentifier=["6003-6005"], scale=[1], normalisationFileIdentifier=[], timeSlize=[300.0] @@ -90,8 +89,8 @@ class FullAmorTest(TestCase): chopperPhaseOffset=-5, monitorType=self._field_defaults['ExperimentConfig']['monitorType'], lowCurrentThreshold=self._field_defaults['ExperimentConfig']['lowCurrentThreshold'], - yRange=(11, 41), - lambdaRange=(2., 15.), + yRange=(18, 48), + lambdaRange=(3., 11.5), incidentAngle=self._field_defaults['ExperimentConfig']['incidentAngle'], mu=0, nu=0, @@ -101,9 +100,8 @@ class FullAmorTest(TestCase): normalisationMethod=self._field_defaults['ReductionConfig']['normalisationMethod'], qResolution=0.01, qzRange=self._field_defaults['ReductionConfig']['qzRange'], - thetaRange=(-12., 12.), - thetaRangeR=(-12., 12.), - fileIdentifier=["5980"], + thetaRange=(-0.75, 0.75), + fileIdentifier=["6003", "6004", "6005"], scale=[1], normalisationFileIdentifier=["5952"], autoscale=(0.0, 0.05),