diff options
author | Aaron LI <aly@aaronly.me> | 2017-08-28 15:47:43 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-08-28 15:47:43 +0800 |
commit | 15ecc6b6df70efc905a4b360f6bd2e964aa13da8 (patch) | |
tree | 16f7e46c9e9e418fea33c2bd9cfbf446e18f4999 /fg21sim/configs | |
parent | 8fe6cfe2e78c21aeef10f39c90289a7cda38dced (diff) | |
download | fg21sim-15ecc6b6df70efc905a4b360f6bd2e964aa13da8.tar.bz2 |
configs: update "frequencies" property to be a numpy array
Diffstat (limited to 'fg21sim/configs')
-rw-r--r-- | fg21sim/configs/manager.py | 13 |
1 files changed, 7 insertions, 6 deletions
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 |