aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-12-11 00:00:15 +0800
committerAaron LI <aly@aaronly.me>2018-12-11 00:00:15 +0800
commit3179cc6c9efb166fa3a4e14aa3d682286b3e0cec (patch)
tree5b94faf2b741adc85582e616a33909f016a9ba95 /fg21sim
parent6e84d56ad43e82bd5339339013700f86e0b44400 (diff)
downloadfg21sim-3179cc6c9efb166fa3a4e14aa3d682286b3e0cec.tar.bz2
uvsim/telescope: Allow to specify position
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/uvsim/telescope.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/fg21sim/uvsim/telescope.py b/fg21sim/uvsim/telescope.py
index 16b627d..9e224a9 100644
--- a/fg21sim/uvsim/telescope.py
+++ b/fg21sim/uvsim/telescope.py
@@ -34,6 +34,8 @@ class SKA1Low:
----------
infile : str
Path to the SKA1-low layout data file
+ position : (float, float), optional
+ Telescope position on Earth. (longitude, latitude) [deg]
stn_antennas : int, optional
Number of antenna elements per station (default: 256)
stn_diameter : float, optional
@@ -56,9 +58,11 @@ class SKA1Low:
[3] Trott et al. 2017, MNRAS, 470, 455;
http://adsabs.harvard.edu/abs/2017MNRAS.470..455T
"""
- def __init__(self, infile, stn_antennas=256, stn_diameter=35.0,
- ant_min_sep=1.5, r_core=500.0, r_central=1700.0):
+ def __init__(self, infile, position=None, stn_antennas=256,
+ stn_diameter=35.0, ant_min_sep=1.5,
+ r_core=500.0, r_central=1700.0):
self.infile = infile
+ self.position = position
self.stn_antennas = stn_antennas
self.stn_diameter = stn_diameter # [m]
self.ant_min_sep = ant_min_sep # [m]
@@ -157,7 +161,6 @@ class SKA1Low:
fig.tight_layout()
fig.savefig(fpng)
logger.debug("Made plot for telescope all station: %s" % fpng)
- # TODO...
def make_oskar_model(self, outdir, clobber=False):
"""
@@ -173,12 +176,13 @@ class SKA1Low:
os.mkdir(outdir)
logger.info("Created telescope model at: %s" % outdir)
# Write position
+ position = self.position or self.position_wgs84
fposition = os.path.join(outdir, "position.txt")
open(fposition, "w").writelines([
"# SKA1-low layout: %s\n" % self.infile,
"# Telescope center position (WGS84)\n",
"# longitude[deg] latitude[deg]\n",
- "%.8f %.8f\n" % tuple(self.position_wgs84)
+ "%.8f %.8f\n" % tuple(position),
])
logger.info("Wrote telescope position: %s" % fposition)
# Write layout of stations