From 15ecc6b6df70efc905a4b360f6bd2e964aa13da8 Mon Sep 17 00:00:00 2001
From: Aaron LI <aly@aaronly.me>
Date: Mon, 28 Aug 2017 15:47:43 +0800
Subject: configs: update "frequencies" property to be a numpy array

---
 fg21sim/configs/manager.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

(limited to 'fg21sim/configs')

diff --git a/fg21sim/configs/manager.py b/fg21sim/configs/manager.py
index 3582437..bfadab0 100644
--- a/fg21sim/configs/manager.py
+++ b/fg21sim/configs/manager.py
@@ -22,6 +22,7 @@ import shutil
 
 from configobj import ConfigObj, ConfigObjError, flatten_errors
 from validate import Validator
+import numpy as np
 
 from .checkers import check_configs
 from ..errors import ConfigError
@@ -498,19 +499,19 @@ class ConfigManager:
 
         Returns
         -------
-        frequencies : list[float]
-            List of frequencies where the simulations are requested.
+        frequencies : 1D `~numpy.ndarray`
+            List of frequencies where to simulate the foreground.
+            Unit: [MHz]
         """
         if self.getn("frequency/type") == "custom":
             # The value is validated to be a float list
-            frequencies = self.getn("frequency/frequencies")
+            frequencies = np.array(self.getn("frequency/frequencies"))
         else:
-            # Calculate the frequency values
+            # Calculate the frequency values, including the stop frequency
             start = self.getn("frequency/start")
             stop = self.getn("frequency/stop")
             step = self.getn("frequency/step")
-            num = int((stop - start) / step + 1)
-            frequencies = [start + step*i for i in range(num)]
+            frequencies = np.arange(start, stop+step/2, step)
         return frequencies
 
     @property
-- 
cgit v1.2.2