Skip to content
Snippets Groups Projects
Commit 1ab94b57 authored by Loïc Le Guyader's avatar Loïc Le Guyader
Browse files

small fixes

parent 3dc50e85
No related branches found
No related tags found
No related merge requests found
......@@ -9,11 +9,12 @@ import warnings
import karabo_data as kd
from karabo_data.geometry2 import DSSC_1MGeometry
import ToolBox as tb
import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
import h5py
from imageio import imread
class DSSC:
......@@ -214,6 +215,19 @@ class DSSC:
path = '/gpfs/exfel/sw/software/exfel_environments/misc/git/karabo_data/docs/dssc_geo_june19.h5'
geom = DSSC_1MGeometry.from_h5_file_and_quad_positions(path, quad_pos)
return geom
def load_mask(self, fname):
""" Load a DSSC mask file.
input:
fname: string of the filename of the mask file
"""
dssc_mask = imread(fname)
dssc_mask = dssc_mask.astype(float)[..., 0] // 255
dssc_mask[dssc_mask==0] = np.nan
self.mask = dssc_mask
def create_virtual_dssc_datasets(self, run, path=''):
""" Create virtual datasets for each 16 DSSC modules used for the multiprocessing.
......
......@@ -4,4 +4,4 @@ from ToolBox.XAS import *
from ToolBox.knife_edge import *
from ToolBox.Laser_utils import *
from ToolBox.DSSC import DSSC
from ToolBox.azimuthal_integrator import azimuthal_integrator
from ToolBox.azimuthal_integrator import *
import numpy as np
class azimuthal_integrator(object):
def __init__(self, imageshape, center, polar_range, dr=2):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment