csxtools.utils.
calculate_flatfield
(image, limits=(0.6, 1.4))[source]¶Calculate a flatfield from fluo data
This routine calculates the flatfield correction from fluorescence data The image is thresholded by limits from the median value of the image. The flatfield is then constructed from the mean of the image divided by the masked (by NaN) image resulting in a true flatfield correction
Parameters: |
|
---|---|
Returns: | |
Return type: | Array of flatfield correction. |
csxtools.utils.
fccd_mask
()[source]¶Return the initial flatfield mask for the FastCCD
Returns: | |
---|---|
Return type: | np.array of flatfield |
csxtools.utils.
get_fastccd_flatfield
(light, dark, flat=None, limits=(0.6, 1.4))[source]¶Calculate a flatfield from two headers
This routine calculates the flatfield using the :func:calculate_flatfield() function after obtaining the images from the headers.
Parameters: |
|
---|---|
Returns: | Flatfield correction |
Return type: | array_like |
csxtools.utils.
get_fastccd_images
(light_header, dark_headers=None, flat=None, gain=(1, 4, 8), tag=None, roi=None)[source]¶Retreive and correct FastCCD Images from associated headers
Retrieve FastCCD Images from databroker and correct for:
np.nan
)Parameters: |
|
---|---|
Returns: | |
Return type: | A corrected pims.pipeline of the data |
csxtools.utils.
get_fastccd_timestamps
(header, tag='fccd_image')[source]¶Return the FastCCD timestamps from the Areadetector Data File
Return a list of numpy arrays of the timestamps for the images as recorded in the datafile.
Parameters: |
|
---|---|
Returns: | |
Return type: | list of arrays of the timestamps |
csxtools.utils.
get_images_to_3D
(images, dtype=None)[source]¶Convert image stack to 3D numpy array
This function converts an image stack from :func: get_images() into a 3D numpy ndarray of a given datatype. This is useful to just get a simple array from detector data
Parameters: |
|
---|
Example
>>> header = DataBroker[-1]
>>> images = get_images(header, "my_detector')
>>> a = get_images_to_3D(images, dtype=np.float32)
csxtools.utils.
get_images_to_4D
(images, dtype=None)[source]¶Convert image stack to 4D numpy array
This function converts an image stack from :func: get_images() into a 4D numpy ndarray of a given datatype. This is useful to just get a simple array from detector data
Parameters: |
|
---|
Example
>>> header = DataBroker[-1]
>>> images = get_images(header, "my_detector')
>>> a = get_images_to_4D(images, dtype=np.float32)