Attach files to a sample¶
There are three ways to get a file onto an item:
- Upload it from your computer. This always works.
- Let your instruments send it with Beholder. This is the best option for regular measurements, if your group has set it up.
- Pick it from a server share that your administrator has connected.
Upload from your computer¶
- Open the item.
- In the Files section, click Upload files.
- Drag files into the dialog, or click to browse for them. You can also take a photo with your webcam.
- Click Upload.
When the upload finishes, the file appears in the list. It is kept straight away. You do not need to press Save.
Things to know:
- Size limit. Your instance sets a maximum file size. If a file is too big, datalab tells you the limit.
- Same file name. If the item already has a file with that name, datalab warns you. If you upload anyway, the item will have two files with the same name.
- Any file type. You can attach any kind of file. Only some types can be plotted. See Add a data block.
Let your instruments send files¶
Copying files off instrument computers by hand is slow, and files get lost. Beholder does it for you.
Beholder is a small program that runs on an instrument computer. It watches the folders where the instrument saves data. When a new file appears, Beholder:
- reads the item ID from the file name or folder name,
- creates the item in datalab if it does not exist yet (if it is set up to),
- uploads the file and attaches it to that item.
If the file changes later, for example because a measurement is still running, Beholder uploads the new version and replaces the old copy. It never deletes anything from datalab.
What you need to do¶
Beholder finds the item by looking for its ID in the file path. So the one thing you must do is put the item ID in the file name or folder name, in the way your group has agreed.
For example, suppose Beholder watches D:\Data\XRD and looks for IDs like jb-042. Then
these files would all be attached to the item jb-042:
This file would be skipped, because it has no item ID in its path:
Ask whoever set up Beholder for the exact pattern it uses on each instrument.
How quickly files appear¶
With the default settings:
- Beholder looks for new files once an hour.
- It re-checks files that changed recently once a minute.
- It uploads everything it has found every 20 minutes.
So a new file usually reaches datalab within an hour or two. Your group may have chosen different settings. If you need a file now, upload it yourself.
Setting up Beholder¶
Beholder needs to be installed once on each instrument computer, usually by the instrument's owner or your administrator. It needs:
- a folder to watch,
- a pattern that picks the item ID out of each file path,
- a datalab API key. Files are uploaded as the owner of that key.
It only makes outgoing connections to datalab. The instrument computer does not need to accept connections from the network. A ready-made program is available for Windows, so Python does not need to be installed.
Setup instructions are in the Beholder README.
Beholder is new
Beholder is still in pre-release. Its settings may change between versions. See Syncing data from instruments for more detail.
Pick a file from a server share¶
Your administrator can connect shared folders to datalab, such as a network drive that instruments save to. If they have, you can copy files from them without downloading them first.
- In the Files section, click Add files from server.
- Browse the folder tree, or search for a file name. The search starts with the item's ID.
- Tick the files you want and click Load files.
The folder listing is refreshed from time to time, not live. If a new file is missing, click Update tree.
Files added this way show the name of the server they came from, when they last changed on the server, and when datalab last copied them.
What happens to a file once attached¶
- datalab keeps its own copy. The original on your computer or instrument is not changed.
- The copy belongs to the item it was attached to. To use the same file on another item, attach it to that item as well.
- Clicking the × next to a file removes it from the item. The stored copy is not deleted, so an administrator can recover it.
- Some data blocks save a processed version of a file alongside the original. These appear in exports too.