New Microscope App
Requirement: Install ScopeFoundry.
After installation, use the Anaconda prompt and navigate to where you want or have the source code for your setup. Start ScopeFoundry tools:
# cd "to/your_project_folder"
conda activate scopefoundry
python -m ScopeFoundry.tools
Go to the
new app
and press new app
. This copies the ScopeFoundry example files to your project folder. In your Anaconda(3) prompt, run:
python fancy_app.py
You should see:
Folder Structure and Key Takeaways
Now is a good time to learn the bare minimum about ScopeFoundry. On the left panel, you see two lists:
Hardwares: These are subclasses of
HardwareComponent
. Their job is to establish a connection to your hardware and provide methods to write and read values.Measurements: These are subclasses of the
Measurement
class that define the procedures for acquiring and saving data. They can have graphical user interfaces shown on the right. Can you start theexample_2d_scan
?
Note that you can expand the items in either list to expose settings
that show the state of the hardware and parameterize your measurements, respectively.
The folder structure should be of this form:
├── your_project_folder
├── ScopeFoundryHW
├── company1_model1
├── company1_model1_hw.py
├── company1_model1_dev.py
├── company1_model1_test_app.py
├── Licence
├── README.md
├── docs # optional
├── links.json
**
**
├── fancy_app.py
├── your_measurement_1.py
├── **
# after databrowser tutorial
├── viewers.py
├── images.py
├── fancy_data_browser.py
In particular, the folder contains:
- A subfolder
ScopeFoundryHW
containing hardware control code. There must be at least one file, typically ending with_hw.py
, that contains a subclass of typeHardwareComponent
. - Measurement files containing
Measurement
subclasses. - The actual app file where
Measurement
andHardwareComponent
are added to the main app. This is the file that gets run.
Congratulations, you have created your first microscope app and learned the three most important high-level concepts: HardwareComponent
and Measurement
can each have settings
.
Next Steps
Now that you have interacted with ScopeFoundry and built a microscope app with pre-built components, you probably want to build a system that allows you to perform real scientific experiments. To do this, have a look at tutorials on how to build:
- A custom Hardware Component.
- A custom Measurement.
Or make a quick detour to set up an IDE.