Skip to content

Instantly share code, notes, and snippets.

@danielballan
Created February 17, 2022 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielballan/cf490500086367474bdc2111890f2fc3 to your computer and use it in GitHub Desktop.
Save danielballan/cf490500086367474bdc2111890f2fc3 to your computer and use it in GitHub Desktop.
FXI example data access

Example using public CC0-licensed FXI data

In this example, we connect to a public HTTP server and download raw tomography images.

It is not necessary to use Python to do this---curl would work fine---but the Tiled Python client is currently the most convenient way to do navigate the data.

pip install tiled[client]
In [1]: from tiled.client import from_uri

In [2]: client = from_uri("https://tiled-demo.blueskyproject.io")

In [3]: uids = list(client["fxi"]["raw"])

In [4]: client["fxi"]["raw"][uids[2]]["primary"]["data"]["Andor_image"]
Out[4]: 
<xarray.DataArray 'Andor_image' (time: 91, dim_0: 1, dim_1: 2160, dim_2: 2560)>
array([[[[ 110,   98,  110, ...,   92,  100,  111],
         [  99,  106,   94, ...,  107,  111,   97],
         [  99,  102,   99, ...,  106,  112,  107],
         ...,
         [  95,   83,  109, ...,   93,   86,  107],
         [ 119,   96,  121, ...,   82,  111,   91],
         [ 115,  115,   90, ...,  103,   87,   91]]],


       [[[ 103,   99,  100, ...,  104,  100,  101],
         [ 111,  105,  105, ...,  109,  113,  103],
         [  95,  101,  105, ...,  101,  115,  101],
         ...,
         [ 104,  111,   82, ...,   88,   96,   87],
         [ 122,  104,   97, ...,  107,  117,  102],
         [ 111,  108,  108, ...,   95,   97,   95]]],


       [[[ 133,   97,  109, ...,   93,  107,  110],
         [  90,  100,   97, ...,   93,   96,   90],
...
<snipped>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment