improved persistent caching, added config module extension

This commit is contained in:
2023-01-29 14:17:43 +01:00
parent 8c271a310c
commit ba63bd7f7b
5 changed files with 60 additions and 24 deletions

View File

@@ -73,7 +73,12 @@ def plot_correlation(x, y, ax=None, **ax_kwargs):
return ax, r
def plot_channel(data, channel_name, ax=None):
def plot_channel(data : SFDataFiles, channel_name, ax=None):
"""
Plots a given channel from an SFDataFiles object.
Optionally: a matplotlib axis to plot into
"""
channel_dim = len(data[channel_name].shape)
# dim == 3: a 2D Image
@@ -105,7 +110,7 @@ def axis_styling(ax, channel_name, description):
)
def plot_1d_channel(data, channel_name, ax=None):
def plot_1d_channel(data : SFDataFiles, channel_name, ax=None):
"""
Plots channel data for a channel that contains a single numeric value per pulse.
"""
@@ -126,7 +131,7 @@ def plot_1d_channel(data, channel_name, ax=None):
axis_styling(ax, channel_name, description)
def plot_2d_channel(data, channel_name, ax=None):
def plot_2d_channel(data : SFDataFiles, channel_name, ax=None):
"""
Plots channel data for a channel that contains a 1d array of numeric values per pulse.
"""
@@ -148,7 +153,7 @@ def plot_2d_channel(data, channel_name, ax=None):
axis_styling(ax, channel_name, description)
def plot_image_channel(data, channel_name, pulse=0, ax=None, rois=None, norms=None):
def plot_image_channel(data : SFDataFiles, channel_name, pulse=0, ax=None, rois=None, norms=None):
"""
Plots channel data for a channel that contains an image (2d array) of numeric values per pulse.
"""
@@ -186,7 +191,7 @@ def plot_image_channel(data, channel_name, pulse=0, ax=None, rois=None, norms=No
axis_styling(ax, channel_name, description)
plt.legend(loc=4)
def plot_spectrum_channel(data, channel_name_x, channel_name_y, average=True, pulse=0, ax=None):
def plot_spectrum_channel(data : SFDataFiles, channel_name_x, channel_name_y, average=True, pulse=0, ax=None):
"""
Plots channel data for two channels where the first is taken as the (constant) x-axis
and the second as the y-axis (here we take by default the mean over the individual pulses).