Browse Source

Bug fixed (INDEX line not properly recognized)

master
Benito Marcote 10 months ago
parent
commit
7072df2124
1 changed files with 10 additions and 6 deletions
  1. +10
    -6
      antabfs_interpolate.py

+ 10
- 6
antabfs_interpolate.py View File

@@ -10,12 +10,14 @@ However, it does not consider scan boundaries, so if Tsys are recorded in differ
it can introduce biases. Therefore, it assumes that the Tsys should not change quickly
(e.g. no change of sources).

Version: 2.0
Date: Aug 2018
Version: 2.1
Date: Nov 2020
Written by Benito Marcote (marcote@jive.eu)


version 2.0 changes
version 2.1 changes (Nov 2020)
- Bug fix: particular lines with INDEX were breaking the index recognition.
version 2.0 changes (Aug 2018)
- (MAJOR) Now it does an actual interpolation of the data (linear spline with smoothing).
- Keeps comment lines in the output file (except the ones within the data).
- Allows you to specify a custom time range for the final antab file.
@@ -59,9 +61,9 @@ antab_times = []
antab_data = []
indexes = []
for aline in antab:
if aline[0].lstrip().isdigit():
if aline.lstrip()[0].isdigit():
# Then this line is a Tsys input
temp = aline.split()
temp = [i.strip() for i in aline.split()]
# First column is DOY, second one is HH:MM.MM or HH:MM:SS
if temp[1].count(':') == 1:
temp2 = temp[1].split('.')
@@ -79,7 +81,9 @@ for aline in antab:
antab_data.append([float(i) for i in temp[2:]])
else:
if 'INDEX' in aline:
indexes = [i.replace("'", '').strip() for i in aline.split('=')[1].replace('/', '').replace('\n', '').split(',')]
# It must be only one entry
tmp = aline.split('INDEX')[1].replace('/', '').replace("'", "").replace('\n', '').strip()
indexes = [i.strip() for i in tmp.split('=')[1].split(',')]


antab_data = np.array(antab_data)


Loading…
Cancel
Save