From b82074604991ed665e4de420bc89a73cc94e8f50 Mon Sep 17 00:00:00 2001 From: Serge Bazanski Date: Sun, 11 May 2025 00:12:10 +0200 Subject: [PATCH 1/2] obi: add nix derivation --- obi/obi.nix | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 obi/obi.nix diff --git a/obi/obi.nix b/obi/obi.nix new file mode 100644 index 0000000..e7a2a87 --- /dev/null +++ b/obi/obi.nix @@ -0,0 +1,50 @@ +# nix-build obi.nix + +# not callPackage because we need a very new nixpkgs for numpy2 +with import (builtins.fetchTarball { + name = "nixos-unstable-2025-10-05"; + url = "https://github.com/nixos/nixpkgs/archive/e06e469c8e2d893f1f0dcb55bbd9de8904ee0cf5.tar.gz"; + sha256 = "sha256:174gj7nxcmj4l5dr1iqfr67cl14x1aw3hxqzg716pw0g1qrmjs4w"; +}) {}; + +python3.pkgs.buildPythonApplication { + name = "open-beam-interface"; + src = fetchFromGitHub { + owner = "q3k"; + repo = "Open-Beam-Interface"; + rev = "7076782325fe04f146e6c3d126a4a1fe1ff9da8f"; + hash = "sha256-3Tu2nFx3V5XIgyRb0da/28CxkY7Lscln0F4T98PGyHY="; + }; + pyproject = true; + + nativeBuildInputs = [ + python3.pkgs.pdm-backend + ]; + + nativeCheckInput = [ + python3.pkgs.unittestCheckHook + ]; + + propagatedBuildInputs = [ + glasgow + yosys + nextpnr + icestorm + ] ++ (with python3.pkgs; [ + numpy + tifffile + pillow + tomlkit + pyqtgraph + pyqt6 + qasync + ]); + + check = false; + + preBuild = '' + export PDM_BUILD_SCM_VERSION=1.0 + cd software + ''; +} + From 4bc7409f4d844f36cd7619b0ef5c7e3b13f3c858 Mon Sep 17 00:00:00 2001 From: Serge Bazanski Date: Sun, 11 May 2025 00:12:49 +0200 Subject: [PATCH 2/2] obi: add microsope.toml --- obi/microscope.toml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 obi/microscope.toml diff --git a/obi/microscope.toml b/obi/microscope.toml new file mode 100644 index 0000000..7f0b3ad --- /dev/null +++ b/obi/microscope.toml @@ -0,0 +1,16 @@ +[instrument_info] +manufacturer='JEOL' +model='T330A' + +[beam.electron.pinout] +scan_enable = [-1] +blank = [2] + +[transforms] + +[timings] +ext_switch_delay_ms = 20 + +[server] +host = "10.250.240.1" +port = 1234