Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

raw_data.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. from tillvisionio.vws import load_pst
  2. class AbstractRawData(object):
  3. def __init__(self, metadata_objects):
  4. self.paths_metadata = metadata_objects["paths"]
  5. self.microscope_metadata = metadata_objects["microscope"]
  6. self.stimulus_metadata = metadata_objects["stimulus"]
  7. self.animal_metadata = metadata_objects["animal"]
  8. self.raw_data = None
  9. self.signal_data = None
  10. class AbstractTillRawData(AbstractRawData):
  11. def __init__(self, metadata_objects):
  12. super().__init__(metadata_objects)
  13. self.raw_filename_ext = ".pst"
  14. def read_data_n_wavelengths(self, n_wavelengths):
  15. raw_data = []
  16. for raw_data_filename_stem in self.paths_metadata.get_raw_filenames_stems(n_wavelengths):
  17. this_raw_data = load_pst(f"{raw_data_filename_stem}{self.raw_filename_ext}")
  18. raw_data.append(this_raw_data)
  19. return raw_data
  20. class TillRawSingeWavelength(AbstractTillRawData):
  21. def __init__(self, metadata_objects):
  22. super().__init__(metadata_objects)
  23. self.raw_data = self.read_data_n_wavelengths(1)[0]
  24. class TillRawDataFura(AbstractTillRawData):
  25. def __init__(self, metadata_objects):
  26. super().__init__(metadata_objects)
  27. self.raw_data = self.read_data_n_wavelengths(2)
  28. def get_raw_data(metadata_objects):
  29. LE_loadExp = metadata_objects["microscope"].LE_loadExp
  30. if LE_loadExp == 3:
  31. return TillRawSingeWavelength(metadata_objects)
  32. elif LE_loadExp == 4:
  33. return TillRawDataFura(metadata_objects)
  34. else:
  35. raise NotImplementedError