NSLS-II / pyCHX

chx_analysis_codes
BSD 3-Clause "New" or "Revised" License
5 stars 6 forks source link

What is FD? #51

Open ambarb opened 3 years ago

ambarb commented 3 years ago

I see this is a lot of functions, but I am unsure what it is. Seems to be related to detector data.

def pass_FD(FD, n):

https://github.com/ambarb/pyCHX/blob/2ecdacf0dd8496dd8e90bb4975273b59e1d08e26/pyCHX/v2/_commonspeckle/chx_compress.py#L62

ambarb commented 3 years ago

https://github.com/NSLS-II/pyCHX/blob/2ecdacf0dd8496dd8e90bb4975273b59e1d08e26/pyCHX/chx_speckle.py#L1020-L1021

Assuming that FD is the special formatted list and not a ccd image, we need to understand better what language to use. I've been calling ccd images "frames" which is technically correct per webster, but perhaps this is more accurate description of the compressed list. It is framed by the edges of the detector and points in time. The representation is a list versus an image

frame = a rigid structure that surrounds or encloses something such as a door or window.

frame = place (a picture or photograph) in a frame

SO it seems all data for XPCS consist of frames. Do we use FD to provide a generic description of both types:

ambarb commented 3 years ago

@ambarb to research how frame is used here: https://github.com/scikit-beam/scikit-beam/blob/655d55f6396524f012bd5d1e2dc3b3fa9d6d6512/skbeam/core/recip.py#L95-L103

ambarb commented 3 years ago

Neither @xmchenGH or I can find where FD is returned or defined as a class. In discussion with @xmchenGH and @afluerasu : FD is to act as a pointer so in principle FD can be a different data formats - if I understand things correctly.

One instance of its use (as function argument) https://github.com/NSLS-II/pyCHX/blob/2ecdacf0dd8496dd8e90bb4975273b59e1d08e26/pyCHX/chx_correlationc.py#L425

It looks like it is roughly defined using the Mulitifile class to interpret it. https://github.com/NSLS-II/pyCHX/blob/2ecdacf0dd8496dd8e90bb4975273b59e1d08e26/pyCHX/Compress_readerNew.py#L40 https://github.com/NSLS-II/pyCHX/blob/2ecdacf0dd8496dd8e90bb4975273b59e1d08e26/pyCHX/Compress_readerNew.py#L196

See also for creation and handling https://github.com/NSLS-II/pyCHX/blob/2ecdacf0dd8496dd8e90bb4975273b59e1d08e26/pyCHX/chx_compress.py\

NOTE read_compressed_eiger() is a very simple example to understand usage without complexity of XPCS/speckle functions https://github.com/NSLS-II/pyCHX/blob/2ecdacf0dd8496dd8e90bb4975273b59e1d08e26/pyCHX/chx_compress.py#L148

ambarb commented 3 years ago

FD = file descriptor per @afluerasu .

FD could represent a hdf5 file (like CHX compressed detector images that are readable). or .imm (APS 8ID) or .edf

It was meant to be an object treated like an array from the outside. Concept is agreed upon, we just need to work a little more on the code.