From df3db04a9d106739c0e16c3472424738a901803c Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Bayle <j2b.bayle@gmail.com>
Date: Thu, 26 Oct 2023 17:54:48 +0200
Subject: [PATCH] Refuse to use fplan file if no orbit files used

---
 lisainstrument/instrument.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisainstrument/instrument.py b/lisainstrument/instrument.py
index 9147bc2..39fa3ca 100755
--- a/lisainstrument/instrument.py
+++ b/lisainstrument/instrument.py
@@ -549,6 +549,9 @@ class Instrument:
         elif isinstance(fplan, str):
             logger.info("Using frequency-plan file '%s'", fplan)
             self.fplan_file = fplan
+            # Refuse to use a fplan file if no orbit files are used
+            if self.orbit_file is None:
+                raise ValueError("cannot use frequency-plan for non orbit files")
             # Without a standard lock config, there is no dataset
             # in the frequency-plan file and therefore we cannot use it
             if self.lock_config is None:
-- 
GitLab