From c3eabf30ebcf96bc1b7c78e6d137c86d4b613b0b Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Sun, 24 May 2026 12:05:28 +0200 Subject: [PATCH] added mapping of IP to beamline --- stand/beamline.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 stand/beamline.py diff --git a/stand/beamline.py b/stand/beamline.py new file mode 100644 index 0000000..5c540ec --- /dev/null +++ b/stand/beamline.py @@ -0,0 +1,19 @@ + +SUBNET_TO_BEAMLINE = { + "129.129.242": "SARESA", + "129.129.243": "SARESB", + "129.129.244": "SARESC", + "129.129.245": "SATESD", + "129.129.246": "SATESE", + "129.129.247": "SATESF" +} + + +def get_beamline(ip): + if ip == "127.0.0.1": + return "stand" + subnet = ".".join(ip.split(".")[:3]) + return SUBNET_TO_BEAMLINE[subnet] + + +