Browse Source

Freqrange option added. And fixed

master
Benito Marcote 4 years ago
parent
commit
f0aed0388a
  1. 23
      antabfs_nominal.py
  2. 40
      sefd_values.txt

23
antabfs_nominal.py

@ -9,14 +9,14 @@
# Date: 2018/04/12
#
# What's new in v. 3.0
# - new argument to set the freq. interval
# -
# - new argument to set the freq. interval (-fr / --freqrange)
#
# What's new in v. 2.0
# - interactive or argument-based
# - documentation!!
# - Takes SEFD values from status table of EVN
import sys
import argparse
import datetime as dt
from math import floor
@ -35,7 +35,7 @@ parser.add_argument('experiment', type=str, default=None, help='Experiment name'
parser.add_argument('start', type=str, default=None, help='Start time (DOY/HH:MM, YYYY/DOY/HH:MM or YYYY/MM/DD/HH:MM)')
parser.add_argument('-d', '--duration', type=float, default=24, help='Duration of the experiment (in hours). Default: 24 h')
parser.add_argument('-b', '--band', type=str, default=None, help='Observed band (in cm). Optional only if SEFD provided')
parser.add_argument('-fr', '--freqrange', type=list, default=[100,100000], help='Frequency range where the ANTAB is applicable. Default 100-100000.')
parser.add_argument('-fr', '--freqrange', type=str, default='100,100000', help='Frequency range where the ANTAB is applicable (lower and upper limit, in MHz). Default 100,100000 (please, do not use spaces between the numbers).')
parser.add_argument('-s', '--sefd', type=float, default=None, help='SEFD to be used (optional). Default values are loaded.')
parser.add_argument('-i', '--interval', type=float, default=0.25, help='Interval between Tsys measurements (in min). Default: 0.5')
parser.add_argument('-sb', '--subbands', type=int, default=8, help='Number of subbands in the experiment. Default: 8 = L1|R1 L2|R2 ... L8|R8')
@ -44,7 +44,7 @@ args = parser.parse_args()
i_already_warn_about_seconds = False
def read_sefd_table(tablename='/jop83_0/pipe/in/marcote/scripts/sefd_values.txt'):
def read_sefd_table(tablename='sefd_values.txt'):#'/jop83_0/pipe/in/marcote/scripts/sefd_values.txt'):
sefd_table = open(tablename, 'r')
titles = sefd_table.readline().strip().split('|')
titles = [t.strip() for t in titles]
@ -168,11 +168,19 @@ if args.start == None:
args.duration = float(dur)
if len(args.freqrange) != 2:
print('The frequency range (--freqrange) must contain two values (comma-separated): the lower and upper frequency limit.')
# Read and interpretate the freqrange.
if args.freqrange.count(',') != 1:
print('The frequency range (--freqrange) must contain two values (comma-separated): the lower and upper frequency limit in MHz (please, do not use spaces between the numbers).')
sys.exit(1)
args.freqrange = [int(i) for i in args.freqrange.split(',')]
if not (args.freqrange[0] < 30*1000/float(args.band) < args.freqrange[1]):
print('The provided frequency range must contain the frequency band, and this is not the case.')
print('Introduced band: {} GHz'.format(30/float(args.band)))
print('Introduced frequency range: {}-{} GHz'.format(args.freqrange[0]/1e3, args.freqrange[1]/1e3))
sys.exit(1)
sefd_info = read_sefd_table()
@ -195,3 +203,6 @@ antab_file.write('/\n') # antab expects trailing /
antab_file.close()
print('File {}{}.antabfs created successfully.'.format(args.experiment.lower(), args.antenna.lower()[:2]))

40
sefd_values.txt

@ -0,0 +1,40 @@
Band | 92 | 49 | 30 | 21 | 18 | 13 | 6 |5 | 3.6 | 1.3 |0.7
Jb1 | 132 | 83 | | 36 | 65 | | 80 | | | |
Jb2 | | | | 350 | 320 | | 320 | 300 | | 910 |
Cm | | | | 220 | 212 | | 136 | 410 | | 720 |
Wb |2100 | |1680 | 420 | 560 | 840 |1680 |1600 |1680 | |
Ef | 600 | 600 | 65 | 20 | 19 | 300 | 20 | 25 | 20 | 90 | 200
Mc | | | | 490 | 700 | 400 | 170 | 840 | 320 | 700 |
Nt | | | | 820 | 784 | 770 | 260 |1100 | 770 | 800 | 900
Nk | | | | | | |1800 |1800 | | |
Sr | | | | 67 | 67 | | | 50 | | 138 |
O8 | | | 900 | 320 | 320 | | 600 |1500 | | |
O6 | | | | | |1110 | | |1000 |1380 | 1310
Sh | | | | | 670 | 800 | 720 |1500 | 800 | |
T6 | | | | 39 | 39 | 46 | 26 | 26 | 48 | |
Ur | | | | 300 | 300 | 560 | 250 | | 350 | 850 |
Tr | | |2000 | 250 | 300 | | 220 | 650 | | 500 |
Mh | | | | | |4500 | | |3200 |2608 | 4500
Ys | | | | | | | 160 |160 | 200 | 200 | 480
Ar | 12 | | 3 | 3.5 | 3 | 3 | 5 | 5 | 6 | |
Wz | | | | | |1250 | | | 750 | |
Hh | | | | | 430 | 410 | 650 | 700 | 630 | |
Ht | | | | | |1050 | | |1400 | |
Sv | | | | 360 | 360 | 330 | 250 | | 200 | 710 |
Zc | | | | 300 | 300 | 330 | 400 | | 200 | 710 |
Bd | | | | 330 | 330 | 330 | 200 | | 200 | 710 |
Ky | | | | | | | | | |1288 | 1919
Ku | | | | | | | | | |1288 | 1919
Kt | | | | | | | | | |1288 | 1919
My | | | | | | | | | | |
Km | | | | | | 350 | 400 | 400 | 480 | |
Ro7 | | | | | 35 | 20 | | | 18 | 83 |
Ro3 | | | | | | 150 | | | 106 | |
Ny | | | | | | 850 | | |1255 | |
Ir | | | | |3600 | | 430 | 430 | | |
Ho | | | | 470 | 420 | 650 | 640 | 800 | 560 |1800 |
At | | | | 340 | 340 | 530 | 350 | 850 | 430 | 530 |
Mp | | | | 340 | 340 | 530 | 350 | 850 | 430 | 900 |
Pa | | | | 40 | 42 | 30 | 110 | 110 | 43 | 810 |
Ti | | | | | 23 | 16 | | | 25 | 60 |
Cd | | | | 500 | 500 | 400 | 550 | 450 | 600 |2500 |
Loading…
Cancel
Save