#%matplotlib inline
%matplotlib notebook
#%matplotlib widget
import sys
import os
try:
hostname = os.environ['HOSTNAME']
except KeyError:
hostname = 'juno'
print('HOSTNAME:', hostname)
#os.path.exists('/home/chust/tch')
if hostname == 'juno' and not '/home/chust/tch' in sys.path:
sys.path.append('/home/chust/tch')
print('sys.path:', sys.path, '\n')
import matplotlib.pyplot as plt
import numpy as np
import glob
from lib_lfr.global_params import *
from lib_lfr.load_routines import get_lfr_decom_l1_asm
from lib_lfr.calib_routines import calibrate_sm
from lib_lfr.time_routines import index_from_date
from lib_io.store_routines import json2data
dir_root = '/WIN/Users/chust/DD CHUST' if hostname == 'PC-CHUST2.lpp.polytechnnique.fr' else \
'/home/chust/DD pc-p-chust' if hostname == 'pc-p-chust' else \
'/home/thomas/Labo' if hostname == 'pc-tango2' else 'ERROR!'
dir_DATA1 = '/DATA1' if hostname == 'PC-CHUST2.lpp.polytechnnique.fr' else \
'/home/chust/DATA' if hostname in ['pc-p-chust', 'juno'] else \
'/home/thomas/Labo/DATA' if hostname == 'pc-tango2' else 'ERROR!'
dir_DATA3 = '/run/media/chust/Samsung_T5'
dir_plots = '/home/thomas/Labo/Plots' if hostname == 'pc-tango2' else '/home/chust/Plots'
dir_storage = '/home/thomas/Labo/Storage' if hostname == 'pc-tango2' else '/home/chust/Storage'
#dir_data1 = dir_DATA1 + '/SO/Tests/2022_03_04_Bruno_FSW_3.3.0.7'
dir_data1 = dir_DATA1 + '/SO/Tests/2022_03_10_Bruno_FSW_3.3.0.7'
dir_data2 = dir_DATA1 + '/SO/Tests/2022_03_14_Bruno_FSW_3.2.0.24'
print('dir_root:', dir_root)
print('dir_data1:', dir_data1)
print('dir_data2:', dir_data2)
HOSTNAME: PC-CHUST2.lpp.polytechnnique.fr sys.path: ['/WIN/Users/chust/DD CHUST/Missions/Solar Orbiter/LFR/Python/Alexis', '/WIN/Users/chust/DD CHUST/Missions/Solar Orbiter/LFR/Python/tch', '/usr/lib64/python310.zip', '/usr/lib64/python3.10', '/usr/lib64/python3.10/lib-dynload', '', '/home/lab-lpp.local/chust/venv_py3/lib64/python3.10/site-packages', '/home/lab-lpp.local/chust/venv_py3/lib/python3.10/site-packages', '/usr/lib64/python3.10/site-packages', '/usr/lib/python3.10/site-packages'] dir_root: /WIN/Users/chust/DD CHUST dir_data1: /DATA1/SO/Tests/2022_03_10_Bruno_FSW_3.3.0.7 dir_data2: /DATA1/SO/Tests/2022_03_14_Bruno_FSW_3.2.0.24
/home/lab-lpp.local/chust/venv_py3/lib64/python3.10/site-packages/spacepy/time.py:2365: UserWarning: Leapseconds may be out of date. Use spacepy.toolbox.update(leapsecs=True) warnings.warn('Leapseconds may be out of date.'
Matrices de passage par défaut pour les ASM : à valider
Comparaison/validation FSW 3.2.0.24 vs 3.3.0.7 avec matrices unitaires.
Mapping Discospace :
Analog Discovery 1 : E1/E2
Analog Discovery 2 : B1/B2
Analog Discovery 3 : B3
files = glob.glob(dir_root + '/Missions/Solar Orbiter/LFR/Ground Segment/ROB kcoefficients' +
'/kcoefficients update #3/ASM_calibration_default-full-tables*')
for file in files:
print(os.path.basename(file))
[freq_cal, B_cal, E_cal] = json2data(file)
index_freq = 3*[None]
print(" freq_cal | B_cal | E_cal")
for F in [0, 1, 2]:
index_freq[F] = freq_cal[F].nonzero()[0]
print("F%s: %s %3d"%(F, freq_cal[F].shape, len(index_freq[F])), B_cal[F].shape, E_cal[F].shape)
index_freq
F=0
freq_cal[F][index_freq[F]]
F=1
freq_cal[F][index_freq[F]]
F=2
freq_cal[F][index_freq[F]]
B_cal[2][index_freq[F], ...]
case = 'F0-3168Hz-2Vpp_on_E1E2B1B2B3-UnitKCOEFFMatrices'
dir_Packets = dir_data1 + '/' + case + '/decom'
files = glob.glob(dir_Packets + '/*.af0')
files.sort()
print(len(files))
for file in files:
print(os.path.basename(file))
asm_unit = get_lfr_decom_l1_asm(file)
1 2022_03_10_15_12_03_packet_record_NORMAL.af0
case = 'F0-3168Hz-2Vpp_on_E1E2B1B2B3-DefaultKCOEFFMatrices'
dir_Packets = dir_data1 + '/' + case + '/decom'
files = glob.glob(dir_Packets + '/*.af0')
files.sort()
print(len(files))
for file in files:
print(os.path.basename(file))
asm_default = get_lfr_decom_l1_asm(file)
print('asm mode :', asm_unit['mode'], '@F%d'%(LFR_Fs2F(asm_unit['fe'])))
print('asm time :', asm_unit['relative_time'])
print('asm shape:', asm_unit['asm_idl'].shape)
nspec, nfreq, ndim, ndim = asm_unit['asm_idl'].shape
asm mode : NORMAL @F0 asm time : [ 0. 3.99992371 7.99984741 11.99977112 15.99969482 19.99961853 23.99954224 27.99946594 31.99938965 35.99931335 39.99923706 43.99916077 47.99908447 51.99899292 55.99891663 59.99884033] asm shape: (16, 88, 5, 5)
print('asm mode :', asm_default['mode'], '@F%d'%(LFR_Fs2F(asm_default['fe'])))
print('asm time :', asm_default['relative_time'])
print('asm shape:', asm_default['asm_idl'].shape)
F = 0
calib_mat_freqs_asm_BE = np.zeros((nfreq, ndim, ndim), dtype=complex)
calib_mat_freqs_asm_BE[:, 0:3, 0:3] = B_cal[F][index_freq[F], ...]
calib_mat_freqs_asm_BE[:, 3:5, 3:5] = E_cal[F][index_freq[F], ...]
asm_unit_calibrated = calibrate_sm(asm_unit['asm_idl'], calib_mat_freqs_asm_BE, echo=True)
i1 = index_from_date(3168, asm_unit['freq'], epsi=None)
i2 = index_from_date(3168, asm_default['freq'], epsi=None)
i1, asm_unit['freq'][i1], i2, asm_default['freq'][i1]
np.array(asm_unit['freq'])
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_unit['asm_idl'][:, i1, i, j]))
print(np.angle(asm_unit['asm_idl'][:, i1, i, j], deg=True))
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_default['asm_idl'][:, i1, i, j]))
print(np.angle(asm_default['asm_idl'][:, i1, i, j], deg=True))
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_unit_calibrated[:, i1, i, j]))
print(np.angle(asm_unit_calibrated[:, i1, i, j], deg=True))
i = 0
j = 1
print(np.abs(asm_unit_calibrated[:, i1, i, j] / asm_default['asm_idl'][:, i2, i, j]))
print(np.angle(asm_unit_calibrated[:, i1, i, j] / asm_default['asm_idl'][:, i2, i, j], deg=True))
k0 = 1
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d => %8.5f %8.5f %5.3f %5.3f"%(i, j,
np.min(np.abs(asm_unit_calibrated[k0:, i1, i, j] / asm_default['asm_idl'][k0:, i2, i, j])),
np.max(np.abs(asm_unit_calibrated[k0:, i1, i, j] / asm_default['asm_idl'][k0:, i2, i, j])),
np.min(abs(np.angle(asm_unit_calibrated[k0:, i1, i, j] / asm_default['asm_idl'][k0:, i2, i, j], deg=True))),
np.max(abs(np.angle(asm_unit_calibrated[k0:, i1, i, j] / asm_default['asm_idl'][k0:, i2, i, j], deg=True))))
)
case = 'F0-3168Hz-2Vpp_on_E1E2B1B2B3_FSW_3.2.0.24'
dir_Packets = dir_data2 + '/' + case + '/decom'
files = glob.glob(dir_Packets + '/*.af0')
files.sort()
print(len(files))
for file in files:
print(os.path.basename(file))
asm_32024 = get_lfr_decom_l1_asm(file)
1 2022_03_14_16_37_12_packet_record_NORMAL.af0
print('asm mode :', asm_32024['mode'], '@F%d'%(LFR_Fs2F(asm_32024['fe'])))
print('asm time :', asm_32024['relative_time'])
print('asm shape:', asm_32024['asm_idl'].shape)
nspec, nfreq, ndim, ndim = asm_32024['asm_idl'].shape
asm mode : NORMAL @F0 asm time : [ 0. 3.99993896 7.99989319 11.99983215 15.99977112 19.99971008 23.99964905 27.99958801 31.99954224 35.9994812 39.99942017 43.99935913 47.9992981 51.99923706 55.99917603 59.99911499] asm shape: (16, 88, 5, 5)
i1 = index_from_date(3168, asm_unit['freq'], epsi=None)
i2 = index_from_date(3168, asm_32024['freq'], epsi=None)
i1, asm_unit['freq'][i1], i2, asm_32024['freq'][i1]
(16, 3168.0, 16, 3168.0)
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_unit['asm_idl'][:, i1, i, j]))
print(np.angle(asm_unit['asm_idl'][:, i1, i, j], deg=True))
i=0, j=0 : [1.7031250e+00 2.0179524e+07 2.0183552e+07 2.0189182e+07 2.0192142e+07 2.0189408e+07 2.0183824e+07 2.0179234e+07 2.0180634e+07 2.0185390e+07 2.0190542e+07 2.0191966e+07 2.0188116e+07 2.0181438e+07 2.0179392e+07 2.0181008e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=0, j=1 : [5.9302425e-01 2.0704750e+07 2.0709092e+07 2.0715752e+07 2.0718586e+07 2.0716286e+07 2.0709424e+07 2.0704552e+07 2.0706194e+07 2.0711516e+07 2.0717270e+07 2.0718516e+07 2.0714076e+07 2.0707248e+07 2.0704624e+07 2.0707044e+07] [-10.37236 0.36110428 0.36207673 0.3620051 0.3639064 0.36444402 0.36382058 0.36269024 0.36065224 0.363144 0.36456618 0.36435312 0.3650324 0.36174795 0.3609276 0.36296123] i=0, j=2 : [5.7709765e-01 1.9743272e+07 1.9766876e+07 1.9783888e+07 1.9760480e+07 1.9781506e+07 1.9769554e+07 1.9752470e+07 1.9757908e+07 1.9791438e+07 1.9777100e+07 1.9760246e+07 1.9815364e+07 1.9765490e+07 1.9803520e+07 1.9770006e+07] [ -33.403233 31.458881 89.91196 148.39124 -153.46336 -95.138 -36.7243 21.807304 80.48189 139.30005 -163.25691 -104.54899 -46.868984 10.970469 68.92569 126.64537 ] i=0, j=3 : [9.9144906e-01 1.9214894e+07 1.9222062e+07 1.9247918e+07 1.9239050e+07 1.9237340e+07 1.9251444e+07 1.9250224e+07 1.9246500e+07 1.9278356e+07 1.9276824e+07 1.9277470e+07 1.9285338e+07 1.9269530e+07 1.9294014e+07 1.9245966e+07] [ 12.283956 38.128067 113.342514 -171.49811 -96.42323 -21.454256 53.442364 127.913284 -157.26578 -82.64235 -8.607178 65.26556 139.28949 -146.63483 -72.948364 1.0895917] i=0, j=4 : [8.0332106e-01 1.9280230e+07 1.9287762e+07 1.9314208e+07 1.9304714e+07 1.9302952e+07 1.9317626e+07 1.9315810e+07 1.9311984e+07 1.9344248e+07 1.9342822e+07 1.9342960e+07 1.9351404e+07 1.9335162e+07 1.9360106e+07 1.9311410e+07] [ -7.2632456 38.076633 113.29046 -171.54974 -96.47696 -21.507225 53.390293 127.86016 -157.31903 -82.69299 -8.659789 65.213036 139.23843 -146.687 -72.99957 1.0375913] i=1, j=1 : [8.7760419e-01 2.1243642e+07 2.1248314e+07 2.1256056e+07 2.1258758e+07 2.1256920e+07 2.1248712e+07 2.1243544e+07 2.1245446e+07 2.1251360e+07 2.1257730e+07 2.1258804e+07 2.1253746e+07 2.1246756e+07 2.1243530e+07 2.1246796e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=1, j=2 : [2.2729467e-01 2.0257190e+07 2.0281540e+07 2.0299876e+07 2.0275634e+07 2.0297802e+07 2.0284292e+07 2.0266642e+07 2.0272500e+07 2.0307372e+07 2.0293146e+07 2.0275522e+07 2.0331568e+07 2.0280500e+07 2.0318970e+07 2.0285440e+07] [ -18.01977 31.097504 89.54979 148.02888 -153.82732 -95.50284 -37.08816 21.444685 80.12145 138.93723 -163.62178 -104.91341 -47.23393 10.608889 68.5645 126.282646] i=1, j=3 : [4.8516539e-01 1.9715064e+07 1.9722542e+07 1.9749920e+07 1.9740598e+07 1.9739456e+07 1.9752678e+07 1.9751312e+07 1.9747778e+07 1.9780926e+07 1.9779846e+07 1.9780144e+07 1.9787720e+07 1.9771636e+07 1.9796206e+07 1.9747772e+07] [ 17.170563 37.76664 112.980316 -171.86058 -96.78721 -21.819237 53.078495 127.5507 -157.62617 -83.00507 -8.972123 64.901115 138.92456 -146.99635 -73.30964 0.72694427] i=1, j=4 : [3.8024402e-01 1.9782106e+07 1.9789954e+07 1.9817940e+07 1.9807976e+07 1.9806784e+07 1.9820582e+07 1.9818608e+07 1.9814966e+07 1.9848540e+07 1.9847566e+07 1.9847348e+07 1.9855504e+07 1.9838972e+07 1.9864014e+07 1.9814920e+07] [ 0.7848246 37.71519 112.92827 -171.91219 -96.84093 -21.872204 53.026417 127.49756 -157.67941 -83.05571 -9.024735 64.84861 138.87352 -147.04854 -73.36085 0.67494255] i=2, j=2 : [7.5260419e-01 2.1127778e+07 2.1138100e+07 2.1132304e+07 2.1126594e+07 2.1136940e+07 2.1135598e+07 2.1126382e+07 2.1135346e+07 2.1136678e+07 2.1126442e+07 2.1132216e+07 2.1138836e+07 2.1128024e+07 2.1130430e+07 2.1138548e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=2, j=3 : [4.4750011e-01 2.1090016e+07 2.1095094e+07 2.1088670e+07 2.1091348e+07 2.1093724e+07 2.1094980e+07 2.1097010e+07 2.1100818e+07 2.1095634e+07 2.1097174e+07 2.1104684e+07 2.1091988e+07 2.1100152e+07 2.1093414e+07 2.1096636e+07] [ 45.707317 6.668669 23.432804 40.114117 57.0336 73.681725 90.16245 106.10529 122.252106 138.05653 154.63943 169.82352 -173.84578 -157.61221 -141.869 -125.55751 ] i=2, j=4 : [3.5563803e-01 2.1161804e+07 2.1167162e+07 2.1161270e+07 2.1163420e+07 2.1165624e+07 2.1167504e+07 2.1168880e+07 2.1172702e+07 2.1167720e+07 2.1169364e+07 2.1176380e+07 2.1164114e+07 2.1172056e+07 2.1165446e+07 2.1168458e+07] [ 29.38061 6.6171823 23.380793 40.06244 56.98017 73.62894 90.11077 106.052345 122.19905 138.00569 154.5871 169.77104 -173.89696 -157.66475 -141.92021 -125.60975 ] i=3, j=3 : [1.7682291e+00 2.1197050e+07 2.1206518e+07 2.1196406e+07 2.1199898e+07 2.1206410e+07 2.1194606e+07 2.1203302e+07 2.1204554e+07 2.1194908e+07 2.1205346e+07 2.1202694e+07 2.1195884e+07 2.1206712e+07 2.1199554e+07 2.1197814e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=3, j=4 : [5.9676337e-01 2.1269218e+07 2.1278954e+07 2.1269370e+07 2.1272366e+07 2.1278680e+07 2.1267482e+07 2.1275536e+07 2.1276818e+07 2.1267322e+07 2.1277902e+07 2.1274724e+07 2.1268330e+07 2.1278986e+07 2.1271902e+07 2.1270000e+07] [-22.312138 -0.05151056 -0.05198732 -0.05172055 -0.0533449 -0.05274652 -0.0515978 -0.0528972 -0.05299045 -0.05089807 -0.05226056 -0.05242247 -0.05121182 -0.05263494 -0.05121881 -0.0522968 ] i=4, j=4 : [1.2630209e+00 2.1341638e+07 2.1351638e+07 2.1342586e+07 2.1345084e+07 2.1351202e+07 2.1340602e+07 2.1348012e+07 2.1349320e+07 2.1339984e+07 2.1350706e+07 2.1346996e+07 2.1341030e+07 2.1351510e+07 2.1344498e+07 2.1342438e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_32024['asm_idl'][:, i2, i, j]))
print(np.angle(asm_32024['asm_idl'][:, i2, i, j], deg=True))
i=0, j=0 : [1.5625000e+00 2.0150090e+07 2.0146934e+07 2.0150428e+07 2.0153300e+07 2.0157502e+07 2.0162528e+07 2.0163746e+07 2.0162798e+07 2.0161572e+07 2.0159498e+07 2.0153872e+07 2.0151512e+07 2.0149642e+07 2.0151802e+07 2.0155002e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=0, j=1 : [5.0389111e-01 2.0676622e+07 2.0674292e+07 2.0677646e+07 2.0680382e+07 2.0684498e+07 2.0687954e+07 2.0692116e+07 2.0690400e+07 2.0688776e+07 2.0686168e+07 2.0681336e+07 2.0678266e+07 2.0675926e+07 2.0677604e+07 2.0680406e+07] [-7.1250167 0.35894167 0.3650451 0.36680076 0.36168584 0.36423028 0.36334473 0.36150062 0.36176777 0.36195093 0.36404446 0.35983172 0.36178896 0.3614292 0.36452526 0.36052918] i=0, j=2 : [7.8616512e-01 1.9277930e+07 1.9272026e+07 1.9271176e+07 1.9255944e+07 1.9266568e+07 1.9279278e+07 1.9250860e+07 1.9237922e+07 1.9247184e+07 1.9211944e+07 1.9195348e+07 1.9196344e+07 1.9235854e+07 1.9195232e+07 1.9160040e+07] [ -32.005383 37.175568 109.67125 -178.04297 -105.24921 -32.49688 39.78425 113.00826 -173.96263 -100.42286 -26.334852 48.1418 122.59291 -163.46837 -89.48551 -14.369352] i=0, j=3 : [8.4983659e-01 1.8927318e+07 1.8937668e+07 1.8885438e+07 1.8856324e+07 1.8821278e+07 1.8787562e+07 1.8812498e+07 1.8781730e+07 1.8785402e+07 1.8709072e+07 1.8678726e+07 1.8656780e+07 1.8711616e+07 1.8693750e+07 1.8682584e+07] [ 11.309934 40.553185 122.69457 -154.98746 -71.18645 13.232499 98.428406 -176.0722 -90.850876 -5.0259647 81.70588 169.47351 -102.186 -14.129367 73.49299 161.47432 ] i=0, j=4 : [8.0498666e-01 1.8996398e+07 1.9005460e+07 1.8953344e+07 1.8925442e+07 1.8888190e+07 1.8856676e+07 1.8880384e+07 1.8848414e+07 1.8853322e+07 1.8777794e+07 1.8745444e+07 1.8722942e+07 1.8777778e+07 1.8760846e+07 1.8749326e+07] [ 10.437474 40.504677 122.641594 -155.03983 -71.23943 13.182326 98.38071 -176.12247 -90.903946 -5.0800414 81.65553 169.42337 -102.24224 -14.180585 73.4387 161.4276 ] i=1, j=1 : [8.3333331e-01 2.1216914e+07 2.1215446e+07 2.1218666e+07 2.1221246e+07 2.1225270e+07 2.1227074e+07 2.1234340e+07 2.1231810e+07 2.1229766e+07 2.1226594e+07 2.1222602e+07 2.1218794e+07 2.1215954e+07 2.1217132e+07 2.1219510e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=1, j=2 : [3.5600016e-01 1.9781888e+07 1.9776536e+07 1.9775464e+07 1.9759954e+07 1.9770144e+07 1.9781670e+07 1.9755466e+07 1.9741566e+07 1.9751018e+07 1.9713326e+07 1.9697626e+07 1.9698244e+07 1.9738682e+07 1.9696052e+07 1.9659236e+07] [ -20.556046 36.817062 109.308205 -178.40839 -105.6121 -32.860443 39.42151 112.6479 -174.32451 -100.784615 -26.6993 47.781765 122.23219 -163.83047 -89.8506 -14.730437] i=1, j=3 : [4.3351358e-01 1.9422138e+07 1.9433436e+07 1.9379642e+07 1.9349936e+07 1.9313202e+07 1.9277138e+07 1.9305628e+07 1.9273470e+07 1.9277244e+07 1.9197232e+07 1.9167452e+07 1.9144588e+07 1.9200820e+07 1.9181458e+07 1.9169312e+07] [ 35.217594 40.194748 122.3318 -155.35265 -71.54957 12.869044 98.06573 -176.43234 -91.21282 -5.387651 81.3413 169.11353 -102.54647 -14.491582 73.1278 161.11314 ] i=1, j=4 : [2.9017475e-01 1.9493026e+07 1.9503010e+07 1.9449322e+07 1.9420864e+07 1.9381858e+07 1.9348044e+07 1.9375292e+07 1.9341898e+07 1.9346940e+07 1.9267744e+07 1.9235922e+07 1.9212484e+07 1.9268714e+07 1.9250298e+07 1.9237788e+07] [ 21.03751 40.14625 122.2788 -155.40501 -71.602554 12.818878 98.01803 -176.48259 -91.2659 -5.4417315 81.29096 169.06337 -102.602715 -14.542807 73.07351 161.06642 ] i=2, j=2 : [9.7916669e-01 2.1087486e+07 2.1095874e+07 2.1098448e+07 2.1088726e+07 2.1091600e+07 2.1102690e+07 2.1093010e+07 2.1087822e+07 2.1099586e+07 2.1100078e+07 2.1088464e+07 2.1095054e+07 2.1102486e+07 2.1090890e+07 2.1091570e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=2, j=3 : [6.2151808e-01 2.1095772e+07 2.1108126e+07 2.1102252e+07 2.1090336e+07 2.1090344e+07 2.1088564e+07 2.1088366e+07 2.1086652e+07 2.1093532e+07 2.1083380e+07 2.1078880e+07 2.1079682e+07 2.1082302e+07 2.1083272e+07 2.1089054e+07] [ 50.44033 3.3794959 13.024399 23.066914 34.065033 45.735485 58.643272 70.92253 83.11255 95.40495 108.04457 121.33454 135.23042 149.33777 162.9704 175.84875 ] i=2, j=4 : [5.0732481e-01 2.1172728e+07 2.1183524e+07 2.1178178e+07 2.1167190e+07 2.1165648e+07 2.1165928e+07 2.1163886e+07 2.1161676e+07 2.1169966e+07 2.1160538e+07 2.1153772e+07 2.1154516e+07 2.1156694e+07 2.1158774e+07 2.1164566e+07] [ 19.179008 3.3297937 12.971131 23.014713 34.01245 45.68575 58.594822 70.87152 83.060745 95.35052 107.994 121.28301 135.17418 149.28557 162.91518 175.8015 ] i=3, j=3 : [1.8958334e+00 2.1156654e+07 2.1169038e+07 2.1167764e+07 2.1156870e+07 2.1169232e+07 2.1167878e+07 2.1159190e+07 2.1167806e+07 2.1170496e+07 2.1159440e+07 2.1169458e+07 2.1171566e+07 2.1163910e+07 2.1170658e+07 2.1171986e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=3, j=4 : [3.6383852e-01 2.1233818e+07 2.1244634e+07 2.1243938e+07 2.1233910e+07 2.1244878e+07 2.1245490e+07 2.1234864e+07 2.1243164e+07 2.1247248e+07 2.1236834e+07 2.1244618e+07 2.1246720e+07 2.1238578e+07 2.1246468e+07 2.1247844e+07] [-23.629375 -0.04985739 -0.05330686 -0.05220512 -0.05252147 -0.04965849 -0.04849208 -0.051121 -0.0515805 -0.0544753 -0.05056189 -0.05173631 -0.05620989 -0.05239764 -0.05542177 -0.04737882] i=4, j=4 : [1.7708334e+00 2.1311276e+07 2.1320506e+07 2.1320394e+07 2.1311238e+07 2.1320786e+07 2.1323390e+07 2.1310814e+07 2.1318796e+07 2.1324286e+07 2.1314508e+07 2.1320048e+07 2.1322150e+07 2.1313510e+07 2.1322550e+07 2.1323974e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
i = 3
j = 4
print(np.abs(asm_unit['asm_idl'][:, i1, i, j] / asm_32024['asm_idl'][:, i2, i, j]))
print(np.angle(asm_unit['asm_idl'][:, i1, i, j] / asm_32024['asm_idl'][:, i2, i, j], deg=True))
[1.6401874 1.0016671 1.0016155 1.0011971 1.0018109 1.001591 1.0010351 1.0019153 1.0015842 1.0009449 1.0019339 1.0014172 1.0010171 1.0019026 1.0011971 1.0010428] [ 1.3172396e+00 -1.6531727e-03 1.3195433e-03 4.8457106e-04 -8.2343392e-04 -3.0880237e-03 -3.1057189e-03 -1.7762037e-03 -1.4099554e-03 3.5772312e-03 -1.6986687e-03 -6.8615563e-04 4.9980716e-03 -2.3729571e-04 4.2029563e-03 -4.9179830e-03]
k0 = 1
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d => %8.5f %8.5f %5.3f %5.3f"%(i, j,
np.min(np.abs(asm_unit['asm_idl'][k0:, i1, i, j] / asm_32024['asm_idl'][k0:, i2, i, j])),
np.max(np.abs(asm_unit['asm_idl'][k0:, i1, i, j] / asm_32024['asm_idl'][k0:, i2, i, j])),
np.min(abs(np.angle(asm_unit['asm_idl'][k0:, i1, i, j] / asm_32024['asm_idl'][k0:, i2, i, j], deg=True))),
np.max(abs(np.angle(asm_unit['asm_idl'][k0:, i1, i, j] / asm_32024['asm_idl'][k0:, i2, i, j], deg=True))))
)
i=0, j=0 => 1.00077 1.00193 0.000 0.000 i=0, j=1 => 1.00060 1.00185 0.000 0.005 i=0, j=2 => 1.02414 1.03225 5.717 174.439 i=0, j=3 => 1.01502 1.03369 2.425 160.385 i=0, j=4 => 1.01485 1.03357 2.428 160.390 i=1, j=1 => 1.00043 1.00177 0.000 0.000 i=1, j=2 => 1.02403 1.03215 5.720 174.439 i=1, j=3 => 1.01488 1.03359 2.428 160.386 i=1, j=4 => 1.01471 1.03347 2.431 160.391 i=2, j=2 => 1.00121 1.00225 0.000 0.000 i=2, j=3 => 0.99936 1.00122 3.289 58.594 i=2, j=4 => 0.99920 1.00107 3.287 58.589 i=3, j=3 => 1.00115 1.00217 0.000 0.000 i=3, j=4 => 1.00094 1.00193 0.000 0.005 i=4, j=4 => 1.00074 1.00178 0.000 0.000
case = 'F1-912Hz-2Vpp_on_E1E2B1B2B3-UnitKCOEFFMatrices'
dir_Packets = dir_data1 + '/' + case + '/decom'
files = glob.glob(dir_Packets + '/*.af1')
files.sort()
print(len(files))
for file in files:
print(os.path.basename(file))
asm_unit = get_lfr_decom_l1_asm(file)
1 2022_03_10_14_58_28_packet_record_NORMAL.af1
case = 'F1-912Hz-2Vpp_on_E1E2B1B2B3-DefaultKCOEFFMatrices'
dir_Packets = dir_data1 + '/' + case + '/decom'
files = glob.glob(dir_Packets + '/*.af1')
files.sort()
print(len(files))
for file in files:
print(os.path.basename(file))
asm_default = get_lfr_decom_l1_asm(file)
print('asm mode :', asm_unit['mode'], '@F%d'%(LFR_Fs2F(asm_unit['fe'])))
print('asm time :', asm_unit['relative_time'])
print('asm shape:', asm_unit['asm_idl'].shape)
nspec, nfreq, ndim, ndim = asm_unit['asm_idl'].shape
asm mode : NORMAL @F1 asm time : [ 0. 3.99992371 7.99984741 11.99977112 15.99969482 19.99961853 23.99954224 27.99946594 31.99938965 35.99931335 39.99923706 43.99916077 47.99908447 51.99900818 55.99893188 59.99885559] asm shape: (16, 104, 5, 5)
print('asm mode :', asm_default['mode'], '@F%d'%(LFR_Fs2F(asm_default['fe'])))
print('asm time :', asm_default['relative_time'])
print('asm shape:', asm_default['asm_idl'].shape)
F = 1
calib_mat_freqs_asm_BE = np.zeros((nfreq, ndim, ndim), dtype=complex)
calib_mat_freqs_asm_BE[:, 0:3, 0:3] = B_cal[F][index_freq[F], ...]
calib_mat_freqs_asm_BE[:, 3:5, 3:5] = E_cal[F][index_freq[F], ...]
asm_unit_calibrated = calibrate_sm(asm_unit['asm_idl'], calib_mat_freqs_asm_BE, echo=True)
i1 = index_from_date(912, asm_unit['freq'], epsi=None)
i2 = index_from_date(912, asm_default['freq'], epsi=None)
i1, asm_unit['freq'][i1], i2, asm_default['freq'][i1]
np.array(asm_unit['freq'])
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_unit['asm_idl'][:, i1, i, j]))
print(np.angle(asm_unit['asm_idl'][:, i1, i, j], deg=True))
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_default['asm_idl'][:, i1, i, j]))
print(np.angle(asm_default['asm_idl'][:, i1, i, j], deg=True))
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_unit_calibrated[:, i1, i, j]))
print(np.angle(asm_unit_calibrated[:, i1, i, j], deg=True))
i = 0
j = 1
print(np.abs(asm_unit_calibrated[:, i1, i, j] / asm_default['asm_idl'][:-1, i2, i, j]))
print(np.angle(asm_unit_calibrated[:, i1, i, j] / asm_default['asm_idl'][:-1, i2, i, j], deg=True))
k0 = 1
k1= -1
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d => %8.5f %8.5f %5.3f %5.3f"%(i, j,
np.min(np.abs(asm_unit_calibrated[k0:, i1, i, j] / asm_default['asm_idl'][k0:k1, i2, i, j])),
np.max(np.abs(asm_unit_calibrated[k0:, i1, i, j] / asm_default['asm_idl'][k0:k1, i2, i, j])),
np.min(abs(np.angle(asm_unit_calibrated[k0:, i1, i, j] / asm_default['asm_idl'][k0:k1, i2, i, j], deg=True))),
np.max(abs(np.angle(asm_unit_calibrated[k0:, i1, i, j] / asm_default['asm_idl'][k0:k1, i2, i, j], deg=True))))
)
case = 'F1-912Hz-2Vpp_on_E1E2B1B2B3_FSW_3.2.0.24'
dir_Packets = dir_data2 + '/' + case + '/decom'
files = glob.glob(dir_Packets + '/*.af1')
files.sort()
print(len(files))
for file in files:
print(os.path.basename(file))
asm_32024 = get_lfr_decom_l1_asm(file)
1 2022_03_14_16_40_29_packet_record_NORMAL.af1
print('asm mode :', asm_32024['mode'], '@F%d'%(LFR_Fs2F(asm_32024['fe'])))
print('asm time :', asm_32024['relative_time'])
print('asm shape:', asm_32024['asm_idl'].shape)
nspec, nfreq, ndim, ndim = asm_32024['asm_idl'].shape
asm mode : NORMAL @F1 asm time : [ 0. 3.99995422 7.99989319 11.99983215 15.99977112 19.99971008 23.99966431 27.99960327 31.99954224 35.9994812 39.99943542 43.99937439 47.99932861 51.99926758 55.99920654 59.99916077] asm shape: (16, 104, 5, 5)
i1 = index_from_date(912, asm_unit['freq'], epsi=None)
i2 = index_from_date(912, asm_32024['freq'], epsi=None)
i1, asm_unit['freq'][i1], i2, asm_32024['freq'][i1]
(51, 912.0, 51, 912.0)
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_unit['asm_idl'][:, i1, i, j]))
print(np.angle(asm_unit['asm_idl'][:, i1, i, j], deg=True))
i=0, j=0 : [3.2812500e-01 2.0768036e+07 2.0764050e+07 2.0764100e+07 2.0762492e+07 2.0760184e+07 2.0761106e+07 2.0761324e+07 2.0762452e+07 2.0762996e+07 2.0764460e+07 2.0764748e+07 2.0767588e+07 2.0767156e+07 2.0769392e+07 2.0771470e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=0, j=1 : [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=0, j=2 : [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=0, j=3 : [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=0, j=4 : [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=1, j=1 : [7.8125000e-01 2.0622732e+07 2.0621126e+07 2.0619828e+07 2.0619380e+07 2.0618884e+07 2.0615356e+07 2.0619282e+07 2.0618502e+07 2.0620082e+07 2.0620030e+07 2.0621776e+07 2.0621248e+07 2.0624208e+07 2.0625696e+07 2.0627756e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=1, j=2 : [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=1, j=3 : [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=1, j=4 : [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=2, j=2 : [6.0937500e-01 2.0760014e+07 2.0757918e+07 2.0755192e+07 2.0755950e+07 2.0757776e+07 2.0761366e+07 2.0764350e+07 2.0764860e+07 2.0764542e+07 2.0764238e+07 2.0762556e+07 2.0757160e+07 2.0756748e+07 2.0755936e+07 2.0756840e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=2, j=3 : [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=2, j=4 : [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=3, j=3 : [8.7500000e-01 2.0512638e+07 2.0508508e+07 2.0507970e+07 2.0508914e+07 2.0510494e+07 2.0516198e+07 2.0518776e+07 2.0519032e+07 2.0518322e+07 2.0516156e+07 2.0511712e+07 2.0510064e+07 2.0509760e+07 2.0510830e+07 2.0515150e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=3, j=4 : [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=4, j=4 : [8.9062500e-01 2.0643796e+07 2.0639256e+07 2.0637216e+07 2.0640184e+07 2.0642284e+07 2.0646068e+07 2.0648228e+07 2.0647988e+07 2.0646124e+07 2.0645436e+07 2.0641624e+07 2.0638752e+07 2.0640480e+07 2.0640284e+07 2.0644842e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_32024['asm_idl'][:, i2, i, j]))
print(np.angle(asm_32024['asm_idl'][:, i2, i, j], deg=True))
i=0, j=0 : [1.1250000e+00 2.0745836e+07 2.0746516e+07 2.0748316e+07 2.0746544e+07 2.0741526e+07 2.0742090e+07 2.0743484e+07 2.0745378e+07 2.0737850e+07 2.0734920e+07 2.0741528e+07 2.0742474e+07 2.0743074e+07 2.0742490e+07 2.0739866e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=0, j=1 : [4.5069391e-01 2.0674444e+07 2.0672788e+07 2.0675460e+07 2.0674848e+07 2.0669608e+07 2.0670556e+07 2.0671436e+07 2.0667980e+07 2.0666684e+07 2.0664424e+07 2.0669362e+07 2.0667140e+07 2.0668498e+07 2.0669492e+07 2.0666856e+07] [-3.3690067e+01 3.5552401e-02 4.2591538e-02 3.7725348e-02 3.1946272e-02 3.3448819e-02 3.7870467e-02 3.0340124e-02 3.1185523e-02 3.5453819e-02 3.6842991e-02 4.0042803e-02 3.9615661e-02 3.7948392e-02 3.0722048e-02 3.6912125e-02] i=0, j=2 : [5.1538819e-01 2.0625482e+07 2.0625038e+07 2.0624708e+07 2.0620444e+07 2.0615498e+07 2.0614312e+07 2.0616348e+07 2.0620218e+07 2.0620188e+07 2.0622582e+07 2.0626016e+07 2.0622088e+07 2.0621036e+07 2.0619500e+07 2.0616646e+07] [ 14.036243 9.949817 31.27322 52.66089 74.12666 95.90265 117.73479 139.7036 161.45576 -176.72482 -155.22807 -133.80374 -112.1901 -90.61891 -68.84163 -47.197273] i=0, j=3 : [3.7500000e-01 2.0468548e+07 2.0467938e+07 2.0468904e+07 2.0464168e+07 2.0458970e+07 2.0459894e+07 2.0467140e+07 2.0469220e+07 2.0469540e+07 2.0470392e+07 2.0477110e+07 2.0470482e+07 2.0469146e+07 2.0467158e+07 2.0466814e+07] [ 0. 10.882222 35.270996 59.701633 84.18309 108.78432 133.50012 158.19481 -177.25166 -152.76523 -128.59892 -104.68735 -80.648735 -56.389984 -32.016056 -7.7684803] i=0, j=4 : [6.7314559e-01 2.0532268e+07 2.0532422e+07 2.0531060e+07 2.0526628e+07 2.0525162e+07 2.0524282e+07 2.0528802e+07 2.0532504e+07 2.0532018e+07 2.0534086e+07 2.0539948e+07 2.0535332e+07 2.0531926e+07 2.0529836e+07 2.0528444e+07] [ 21.80141 10.867166 35.255547 59.693428 84.16659 108.75488 133.47919 158.1801 -177.26433 -152.78194 -128.6203 -104.707054 -80.66339 -56.41149 -32.0291 -7.785965] i=1, j=1 : [5.0000000e-01 2.0603300e+07 2.0599318e+07 2.0602864e+07 2.0603394e+07 2.0597936e+07 2.0599270e+07 2.0599646e+07 2.0590870e+07 2.0595764e+07 2.0594170e+07 2.0597446e+07 2.0592080e+07 2.0594192e+07 2.0596756e+07 2.0594104e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=1, j=2 : [2.7950850e-01 2.0554642e+07 2.0551834e+07 2.0552308e+07 2.0549244e+07 2.0544268e+07 2.0543060e+07 2.0544934e+07 2.0543626e+07 2.0549278e+07 2.0552162e+07 2.0554346e+07 2.0547234e+07 2.0546722e+07 2.0546994e+07 2.0544196e+07] [ 26.565052 9.915253 31.230644 52.62388 74.09567 95.86905 117.696754 139.6724 161.42383 -176.76057 -155.26544 -133.84322 -112.23006 -90.65645 -68.87282 -47.233654] i=1, j=3 : [3.5355338e-01 2.0398270e+07 2.0395308e+07 2.0397054e+07 2.0393514e+07 2.0388314e+07 2.0389158e+07 2.0396264e+07 2.0393230e+07 2.0399128e+07 2.0400452e+07 2.0405970e+07 2.0396186e+07 2.0395362e+07 2.0395192e+07 2.0394902e+07] [ 45. 10.847799 35.228416 59.664734 84.15223 108.75069 133.46208 158.16348 -177.28368 -152.80101 -128.63637 -104.72674 -80.688736 -56.427452 -32.04731 -7.804801] i=1, j=4 : [5.5901700e-01 2.0461770e+07 2.0459562e+07 2.0458992e+07 2.0455762e+07 2.0454278e+07 2.0453324e+07 2.0457712e+07 2.0456276e+07 2.0461394e+07 2.0463930e+07 2.0468588e+07 2.0460796e+07 2.0457914e+07 2.0457652e+07 2.0456322e+07] [ 26.565052 10.832745 35.212967 59.65652 84.13573 108.72127 133.44116 158.14879 -177.29634 -152.81772 -128.65773 -104.74645 -80.70339 -56.448963 -32.060345 -7.822285] i=2, j=2 : [6.2500000e-01 2.0740684e+07 2.0737008e+07 2.0739480e+07 2.0737138e+07 2.0733700e+07 2.0735748e+07 2.0733996e+07 2.0742360e+07 2.0748358e+07 2.0745772e+07 2.0748350e+07 2.0746592e+07 2.0740236e+07 2.0740362e+07 2.0735182e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=2, j=3 : [1.2500000e-01 2.0617366e+07 2.0614034e+07 2.0614394e+07 2.0612672e+07 2.0609024e+07 2.0612540e+07 2.0615546e+07 2.0621644e+07 2.0624588e+07 2.0621972e+07 2.0624898e+07 2.0621948e+07 2.0617688e+07 2.0615914e+07 2.0612404e+07] [-90. 0.9312775 3.9982963 7.040396 10.055964 12.881508 15.765097 18.490843 21.293203 23.960651 26.628416 29.116266 31.541605 34.22838 36.82503 39.42894 ] i=2, j=4 : [5.0000000e-01 2.0681358e+07 2.0678778e+07 2.0677172e+07 2.0675538e+07 2.0675470e+07 2.0677418e+07 2.0677618e+07 2.0685344e+07 2.0687626e+07 2.0686218e+07 2.0687916e+07 2.0687056e+07 2.0680844e+07 2.0679348e+07 2.0674494e+07] [ 0. 0.9176344 3.9826658 7.032368 10.039541 12.851982 15.744254 18.476706 21.280775 23.943628 26.60748 29.096449 31.526459 34.20801 36.811714 39.410965 ] i=3, j=3 : [7.5000000e-01 2.0499796e+07 2.0497004e+07 2.0494226e+07 2.0493346e+07 2.0489460e+07 2.0494180e+07 2.0501832e+07 2.0505538e+07 2.0504698e+07 2.0502536e+07 2.0505078e+07 2.0501206e+07 2.0499634e+07 2.0495598e+07 2.0493554e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=3, j=4 : [3.9528471e-01 2.0563400e+07 2.0561346e+07 2.0556664e+07 2.0555840e+07 2.0555490e+07 2.0558688e+07 2.0563558e+07 2.0568874e+07 2.0567372e+07 2.0566418e+07 2.0567704e+07 2.0565908e+07 2.0562420e+07 2.0558694e+07 2.0555288e+07] [ 1.8434948e+01 -1.3442848e-02 -1.5657779e-02 -8.0055697e-03 -1.6422214e-02 -2.9538121e-02 -2.0834796e-02 -1.4078015e-02 -1.2404435e-02 -1.7051991e-02 -2.0887211e-02 -1.9827336e-02 -1.5199846e-02 -2.0226011e-02 -1.3352911e-02 -1.8035514e-02] i=4, j=4 : [1.1250000e+00 2.0627198e+07 2.0625892e+07 2.0619290e+07 2.0618520e+07 2.0621738e+07 2.0623400e+07 2.0625472e+07 2.0632408e+07 2.0630244e+07 2.0630496e+07 2.0630520e+07 2.0630816e+07 2.0625398e+07 2.0621990e+07 2.0617210e+07] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
i = 3
j = 4
print(np.abs(asm_unit['asm_idl'][:, i1, i, j] / asm_32024['asm_idl'][:, i2, i, j]))
print(np.angle(asm_unit['asm_idl'][:, i1, i, j] / asm_32024['asm_idl'][:, i2, i, j], deg=True))
[0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
k0 = 1
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d => %8.5f %8.5f %5.3f %5.3f"%(i, j,
np.min(np.abs(asm_unit['asm_idl'][k0:, i1, i, j] / asm_32024['asm_idl'][k0:, i2, i, j])),
np.max(np.abs(asm_unit['asm_idl'][k0:, i1, i, j] / asm_32024['asm_idl'][k0:, i2, i, j])),
np.min(abs(np.angle(asm_unit['asm_idl'][k0:, i1, i, j] / asm_32024['asm_idl'][k0:, i2, i, j], deg=True))),
np.max(abs(np.angle(asm_unit['asm_idl'][k0:, i1, i, j] / asm_32024['asm_idl'][k0:, i2, i, j], deg=True))))
)
i=0, j=0 => 1.00076 1.00152 0.000 0.000 i=0, j=1 => 0.00000 0.00000 0.000 0.000 i=0, j=2 => 0.00000 0.00000 0.000 180.000 i=0, j=3 => 0.00000 0.00000 0.000 180.000 i=0, j=4 => 0.00000 0.00000 0.000 180.000 i=1, j=1 => 1.00078 1.00163 0.000 0.000 i=1, j=2 => 0.00000 0.00000 0.000 180.000 i=1, j=3 => 0.00000 0.00000 0.000 180.000 i=1, j=4 => 0.00000 0.00000 0.000 180.000 i=2, j=2 => 1.00051 1.00146 0.000 0.000 i=2, j=3 => 0.00000 0.00000 0.000 0.000 i=2, j=4 => 0.00000 0.00000 0.000 0.000 i=3, j=3 => 1.00032 1.00107 0.000 0.000 i=3, j=4 => 0.00000 0.00000 0.000 0.000 i=4, j=4 => 1.00038 1.00134 0.000 0.000
case = 'F2-64Hz-2Vpp_on_E1E2B1B2B3-UnitKCOEFFMatrices'
dir_Packets = dir_data1 + '/' + case + '/decom'
files = glob.glob(dir_Packets + '/*.af2')
files.sort()
print(len(files))
for file in files:
print(os.path.basename(file))
asm_unit = get_lfr_decom_l1_asm(file)
1 2022_03_10_15_05_10_packet_record_NORMAL.af2
case = 'F2-64Hz-2Vpp_on_E1E2B1B2B3-DefaultKCOEFFMatrices'
dir_Packets = dir_DATA + '/' + case + '/decom'
files = glob.glob(dir_Packets + '/*.af2')
files.sort()
print(len(files))
for file in files:
print(os.path.basename(file))
asm_default = get_lfr_decom_l1_asm(file)
print('asm mode :', asm_unit['mode'], '@F%d'%(LFR_Fs2F(asm_unit['fe'])))
print('asm time :', asm_unit['relative_time'])
print('asm shape:', asm_unit['asm_idl'].shape)
nspec, nfreq, ndim, ndim = asm_unit['asm_idl'].shape
asm mode : NORMAL @F2 asm time : [ 0. 3.99992371 7.99984741 11.99978638 15.99971008 19.99963379 23.9995575 27.9994812 31.99940491 35.99932861 39.99925232 43.99919128 47.99911499 51.9990387 55.9989624 59.99888611] asm shape: (16, 96, 5, 5)
print('asm mode :', asm_default['mode'], '@F%d'%(LFR_Fs2F(asm_default['fe'])))
print('asm time :', asm_default['relative_time'])
print('asm shape:', asm_default['asm_idl'].shape)
F = 2
calib_mat_freqs_asm_BE = np.zeros((nfreq, ndim, ndim), dtype=complex)
calib_mat_freqs_asm_BE[:, 0:3, 0:3] = B_cal[F][index_freq[F], ...]
calib_mat_freqs_asm_BE[:, 3:5, 3:5] = E_cal[F][index_freq[F], ...]
asm_unit_calibrated = calibrate_sm(asm_unit['asm_idl'], calib_mat_freqs_asm_BE, echo=True)
i1 = index_from_date(64, asm_unit['freq'], epsi=None)
i2 = index_from_date(64, asm_default['freq'], epsi=None)
i1, asm_unit['freq'][i1], i2, asm_default['freq'][i1]
np.array(asm_unit['freq'])
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_unit['asm_idl'][:, i1, i, j]))
print(np.angle(asm_unit['asm_idl'][:, i1, i, j], deg=True))
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_default['asm_idl'][:, i1, i, j]))
print(np.angle(asm_default['asm_idl'][:, i1, i, j], deg=True))
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_unit_calibrated[:, i1, i, j]))
print(np.angle(asm_unit_calibrated[:, i1, i, j], deg=True))
i = 0
j = 3
k1= -4
print(np.abs(asm_unit_calibrated[:, i1, i, j] / asm_default['asm_idl'][:k1, i2, i, j]))
print(np.angle(asm_unit_calibrated[:, i1, i, j] / asm_default['asm_idl'][:k1, i2, i, j], deg=True))
k0 = 1
k1= -4
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d => %8.5f %8.5f %5.3f %5.3f"%(i, j,
np.min(np.abs(asm_unit_calibrated[k0:, i1, i, j] / asm_default['asm_idl'][k0:k1, i2, i, j])),
np.max(np.abs(asm_unit_calibrated[k0:, i1, i, j] / asm_default['asm_idl'][k0:k1, i2, i, j])),
np.min(abs(np.angle(asm_unit_calibrated[k0:, i1, i, j] / asm_default['asm_idl'][k0:k1, i2, i, j], deg=True))),
np.max(abs(np.angle(asm_unit_calibrated[k0:, i1, i, j] / asm_default['asm_idl'][k0:k1, i2, i, j], deg=True))))
)
case = 'F2-64Hz-2Vpp_on_E1E2B1B2B3_FSW_3.2.0.24'
dir_Packets = dir_data2 + '/' + case + '/decom'
files = glob.glob(dir_Packets + '/*.af2')
files.sort()
print(len(files))
for file in files:
print(os.path.basename(file))
asm_32024 = get_lfr_decom_l1_asm(file)
1 2022_03_14_16_43_17_packet_record_NORMAL.af2
print('asm mode :', asm_32024['mode'], '@F%d'%(LFR_Fs2F(asm_32024['fe'])))
print('asm time :', asm_32024['relative_time'])
print('asm shape:', asm_32024['asm_idl'].shape)
nspec, nfreq, ndim, ndim = asm_32024['asm_idl'].shape
asm mode : NORMAL @F2 asm time : [ 0. 3.99993896 7.99987793 11.99981689 15.99975586 19.99971008 23.99964905 27.99958801 31.99952698 35.99946594 39.99942017 43.99935913 47.9992981 51.99925232 55.99919128 59.99913025] asm shape: (16, 96, 5, 5)
i1 = index_from_date(64, asm_unit['freq'], epsi=None)
i2 = index_from_date(64, asm_32024['freq'], epsi=None)
i1, asm_unit['freq'][i1], i2, asm_32024['freq'][i1]
(57, 64.0, 57, 64.0)
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_unit['asm_idl'][:, i1, i, j]))
print(np.angle(asm_unit['asm_idl'][:, i1, i, j], deg=True))
i=0, j=0 : [ 0. 19569292. 19567126. 19568844. 19569488. 19569428. 19568360. 19566660. 19571348. 19569760. 19568978. 19569054. 19566608. 19569090. 19567220. 19568286.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=0, j=1 : [ 0. 19449690. 19447414. 19449352. 19449048. 19450874. 19448468. 19448326. 19449620. 19448744. 19448992. 19449074. 19446880. 19449558. 19447298. 19450496.] [ 0. 0.00977211 -0.00378954 0.00543076 -0.00094565 0.00067971 0.0048035 0.00336218 -0.00071805 0.00154738 -0.00336428 0.00324421 0.00269584 0.00208715 0.00567587 0.00223507] i=0, j=2 : [ 0. 19529524. 19528498. 19529714. 19530704. 19529444. 19528430. 19527610. 19530370. 19529268. 19528852. 19528724. 19527758. 19528250. 19526892. 19528632.] [ 0. 0.6479112 1.8407507 3.0333145 4.217862 5.4025974 6.578345 7.752088 8.931496 10.121181 11.30142 12.494687 13.6476145 14.811148 15.981337 17.156614 ] i=0, j=3 : [ 0. 19398270. 19397292. 19397690. 19397544. 19399638. 19397284. 19397256. 19398876. 19398064. 19397000. 19398094. 19395184. 19395760. 19397288. 19396122.] [ 0. 0.7747546 2.3025057 3.857883 5.40566 6.929376 8.437868 9.946199 11.45015 12.957338 14.466389 15.977189 17.471016 18.984085 20.497 22.025557 ] i=0, j=4 : [ 0. 19456838. 19456580. 19456174. 19457690. 19456736. 19456248. 19454642. 19457754. 19455152. 19456510. 19455592. 19456500. 19456742. 19453608. 19454778.] [ 0. 0.7748144 2.3043892 3.8560944 5.401253 6.9308887 8.436542 9.9428215 11.447791 12.958006 14.470352 15.981724 17.471436 18.99007 20.494686 22.022432 ] i=1, j=1 : [ 0. 19330820. 19328432. 19330588. 19329348. 19333036. 19329308. 19330708. 19328646. 19328476. 19329744. 19329828. 19327884. 19330760. 19328110. 19333412.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=1, j=2 : [ 0. 19410172. 19409026. 19410462. 19410506. 19411136. 19408774. 19409502. 19408894. 19408496. 19409122. 19409004. 19408268. 19408966. 19407224. 19411080.] [ 0. 0.63811386 1.844556 3.0278811 4.2188106 5.401916 6.5735593 7.748743 8.9322195 10.119621 11.304823 12.491437 13.644886 14.809051 15.975668 17.154404 ] i=1, j=3 : [ 0. 19279722. 19278622. 19279242. 19278166. 19282116. 19278430. 19279936. 19278220. 19278100. 19278080. 19279180. 19276504. 19277284. 19278416. 19279366.] [ 0. 0.764951 2.3063164 3.8524513 5.406609 6.928696 8.433087 9.942861 11.450873 12.955778 14.469806 15.973936 17.468279 18.981985 20.491335 22.023352 ] i=1, j=4 : [ 0. 19337928. 19337546. 19337370. 19337944. 19338868. 19337032. 19336976. 19336730. 19334838. 19337222. 19336326. 19337444. 19337890. 19334394. 19337670.] [ 0. 0.7650108 2.3082004 3.8506613 5.402202 6.9302077 8.43176 9.939482 11.448515 12.956447 14.473768 15.978472 17.4687 18.987974 20.489017 22.02023 ] i=2, j=2 : [ 0. 19490526. 19490592. 19491328. 19492652. 19490196. 19489202. 19489274. 19490104. 19489526. 19489468. 19489122. 19489602. 19488122. 19487298. 19489700.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=2, j=3 : [ 0. 19359708. 19359838. 19359764. 19359946. 19360836. 19358492. 19359354. 19359062. 19358750. 19358064. 19358936. 19357474. 19356090. 19358138. 19357634.] [0. 0.12686585 0.46176744 0.8245694 1.1878387 1.5267832 1.8595581 2.1941137 2.5186713 2.836186 3.164993 3.482489 3.8233678 4.172932 4.515667 4.868936 ] i=2, j=4 : [ 0. 19418160. 19419026. 19418132. 19419974. 19417822. 19417346. 19416634. 19417822. 19415718. 19417448. 19416318. 19418670. 19416942. 19414346. 19416186.] [0. 0.12692213 0.4636373 0.82278866 1.1834147 1.5282868 1.8582442 2.1907296 2.516293 2.8368587 3.1689372 3.4870286 3.823814 4.1788926 4.51333 4.865806 ] i=3, j=3 : [ 0. 19229808. 19230018. 19229154. 19228204. 19232384. 19228706. 19230344. 19228948. 19228894. 19227596. 19229668. 19226296. 19225006. 19229886. 19226518.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=3, j=4 : [ 0. 19287868. 19288812. 19287128. 19287820. 19288992. 19287168. 19287246. 19287310. 19285478. 19286578. 19286664. 19287076. 19285448. 19285722. 19284676.] [ 0.0000000e+00 5.5698009e-05 1.8654208e-03 -1.7779486e-03 -4.4276314e-03 1.5007883e-03 -1.3108074e-03 -3.3858055e-03 -2.3832012e-03 6.7365810e-04 3.9392267e-03 4.5415279e-03 4.5302912e-04 5.9530078e-03 -2.3440330e-03 -3.1322318e-03] i=4, j=4 : [ 0. 19346102. 19347788. 19345272. 19347620. 19345768. 19345804. 19344316. 19345850. 19342228. 19345740. 19343832. 19348044. 19346076. 19341720. 19343008.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d :"%(i, j))
print(np.abs(asm_32024['asm_idl'][:, i2, i, j]))
print(np.angle(asm_32024['asm_idl'][:, i2, i, j], deg=True))
i=0, j=0 : [ 0. 19546592. 19547196. 19548444. 19545834. 19548552. 19549080. 19545196. 19547488. 19549498. 19544010. 19546698. 19547836. 19548960. 19545452. 19544852.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=0, j=1 : [ 0. 19427048. 19427652. 19429244. 19426284. 19428616. 19427736. 19425946. 19427836. 19428580. 19425740. 19426954. 19427640. 19427764. 19425760. 19427198.] [ 0. -0.00077197 0.00307232 -0.00014229 0.00089588 0.00193899 0.00422174 0.00592765 0.0066909 0.00129537 -0.00190905 -0.00022341 0.00023815 0.00498926 0.01003706 0.00326704] i=0, j=2 : [ 0. 19507048. 19507148. 19507368. 19505458. 19507894. 19508982. 19506428. 19507456. 19506940. 19505994. 19504632. 19507398. 19507018. 19505234. 19505432.] [ 0. 0.7611862 2.2423363 3.720313 5.181583 6.6230555 8.060182 9.490416 10.93213 12.375956 13.806648 15.258013 16.701515 18.117037 19.53351 20.955965 ] i=0, j=3 : [ 0. 19376382. 19377160. 19377072. 19377548. 19378242. 19377664. 19376628. 19376810. 19379038. 19375734. 19379024. 19377812. 19377618. 19376870. 19377826.] [ 0. 0.8209145 2.4910073 4.1508746 5.7823215 7.4100866 9.049915 10.675605 12.32349 13.969639 15.593047 17.267982 18.93418 20.591724 22.260183 23.938456 ] i=0, j=4 : [ 0. 19436498. 19436924. 19436584. 19437852. 19438582. 19436616. 19436138. 19436244. 19435422. 19435456. 19434758. 19437276. 19437032. 19435526. 19434294.] [ 0. 0.8167133 2.487 4.1470003 5.7845902 7.4125004 9.051248 10.672749 12.313725 13.96345 15.593116 17.262756 18.929804 20.59444 22.258492 23.93754 ] i=1, j=1 : [ 0. 19308232. 19308836. 19310770. 19307462. 19309416. 19307148. 19307420. 19308916. 19308408. 19308184. 19307944. 19308182. 19307318. 19306800. 19310252.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=1, j=2 : [ 0. 19387742. 19387840. 19388412. 19386154. 19388198. 19387888. 19387416. 19388038. 19386266. 19387970. 19385150. 19387462. 19386084. 19385786. 19388004.] [ 0. 0.7619655 2.239244 3.7204921 5.1806874 6.621125 8.05597 9.484479 10.925438 12.374708 13.808532 15.258228 16.70128 18.11205 19.523499 20.952684 ] i=1, j=3 : [ 0. 19257874. 19258650. 19258910. 19259030. 19259340. 19257386. 19258408. 19258194. 19259152. 19258502. 19260312. 19258676. 19257490. 19258208. 19261166.] [ 0. 0.8216945 2.487913 4.1510572 5.781425 7.408159 9.045704 10.669667 12.316795 13.9684 15.594927 17.268194 18.933943 20.58674 22.25018 23.93517 ] i=1, j=4 : [ 0. 19317624. 19318046. 19318060. 19318964. 19319308. 19315972. 19317556. 19317264. 19315186. 19317862. 19315704. 19317774. 19316534. 19316504. 19317296.] [ 0. 0.8174932 2.4839048 4.147183 5.7836947 7.4105716 9.047035 10.666811 12.307032 13.96221 15.594997 17.262968 18.929567 20.589457 22.248487 23.934252 ] i=2, j=2 : [ 0. 19468568. 19468210. 19467372. 19466164. 19468268. 19469892. 19468692. 19468460. 19465382. 19469040. 19463644. 19468008. 19466102. 19466044. 19466998.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=2, j=3 : [ 0. 19338294. 19338606. 19337456. 19338624. 19338996. 19338978. 19339278. 19338214. 19337888. 19339164. 19338444. 19338838. 19337138. 19338118. 19339800.] [0. 0.05975183 0.24862508 0.43055743 0.60074914 0.78703004 0.98972833 1.1851975 1.3913196 1.5936533 1.7863714 2.009927 2.2326682 2.474674 2.7266722 2.9824955 ] i=2, j=4 : [ 0. 19398294. 19398246. 19396842. 19398804. 19399222. 19397802. 19398664. 19397534. 19394160. 19398770. 19394064. 19398178. 19396418. 19396644. 19396168.] [0. 0.05555079 0.24469428 0.4267025 0.60304725 0.78942347 0.99109304 1.1823256 1.3815904 1.5874897 1.7864399 2.0047264 2.2282941 2.4773886 2.7250068 2.9815745 ] i=3, j=3 : [ 0. 19208916. 19209876. 19208420. 19211932. 19210598. 19208962. 19210740. 19208860. 19211250. 19210176. 19214070. 19210552. 19209058. 19211062. 19213460.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] i=3, j=4 : [ 0. 19268510. 19269122. 19267410. 19271720. 19270424. 19267392. 19269732. 19267784. 19267152. 19269386. 19269332. 19269498. 19267944. 19269204. 19269462.] [ 0.0000000e+00 -4.2008758e-03 -3.9212378e-03 -3.8524473e-03 2.3011402e-03 2.3912359e-03 1.3693969e-03 -2.8744922e-03 -9.7238580e-03 -6.1586453e-03 6.8388421e-05 -5.1967916e-03 -4.3738605e-03 2.7141829e-03 -1.6614085e-03 -9.2175341e-04] i=4, j=4 : [ 0. 19328288. 19328548. 19326584. 19331692. 19330436. 19326000. 19328904. 19326886. 19323216. 19328774. 19324754. 19328624. 19327008. 19327520. 19325628.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
i = 0
j = 2
print(np.abs(asm_unit['asm_idl'][:, i1, i, j] / asm_32024['asm_idl'][:, i2, i, j]))
print(np.angle(asm_unit['asm_idl'][:, i1, i, j] / asm_32024['asm_idl'][:, i2, i, j], deg=True))
[ nan 1.0011522 1.0010943 1.0011456 1.0012944 1.0011047 1.0009968 1.001086 1.0011747 1.0011446 1.0011718 1.0012352 1.0010437 1.0010885 1.0011103 1.0011895] [ nan -0.11327494 -0.40158558 -0.686999 -0.9637208 -1.2204585 -1.481837 -1.7383275 -2.0006347 -2.2547748 -2.5052288 -2.7633274 -3.0539005 -3.3058877 -3.552173 -3.7993512 ]
/tmp/ipykernel_114611/4106238312.py:3: RuntimeWarning: invalid value encountered in true_divide print(np.abs(asm_unit['asm_idl'][:, i1, i, j] / asm_32024['asm_idl'][:, i2, i, j])) /tmp/ipykernel_114611/4106238312.py:4: RuntimeWarning: invalid value encountered in true_divide print(np.angle(asm_unit['asm_idl'][:, i1, i, j] / asm_32024['asm_idl'][:, i2, i, j], deg=True))
k0 = 1
for i in range(5):
for j in range(5):
if i <= j:
print("i=%d, j=%d => %8.5f %8.5f %5.3f %5.3f"%(i, j,
np.min(np.abs(asm_unit['asm_idl'][k0:, i1, i, j] / asm_32024['asm_idl'][k0:, i2, i, j])),
np.max(np.abs(asm_unit['asm_idl'][k0:, i1, i, j] / asm_32024['asm_idl'][k0:, i2, i, j])),
np.min(abs(np.angle(asm_unit['asm_idl'][k0:, i1, i, j] / asm_32024['asm_idl'][k0:, i2, i, j], deg=True))),
np.max(abs(np.angle(asm_unit['asm_idl'][k0:, i1, i, j] / asm_32024['asm_idl'][k0:, i2, i, j], deg=True))))
)
i=0, j=0 => 1.00096 1.00128 0.000 0.000 i=0, j=1 => 1.00099 1.00120 0.000 0.011 i=0, j=2 => 1.00100 1.00129 0.113 3.799 i=0, j=3 => 1.00090 1.00114 0.046 1.913 i=0, j=4 => 1.00093 1.00111 0.042 1.915 i=1, j=1 => 1.00101 1.00122 0.000 0.000 i=1, j=2 => 1.00107 1.00126 0.124 3.798 i=1, j=3 => 1.00093 1.00118 0.057 1.912 i=1, j=4 => 1.00093 1.00111 0.052 1.914 i=2, j=2 => 1.00099 1.00136 0.000 0.000 i=2, j=3 => 1.00092 1.00115 0.067 1.886 i=2, j=4 => 1.00091 1.00115 0.071 1.884 i=3, j=3 => 1.00068 1.00113 0.000 0.000 i=3, j=4 => 1.00079 1.00103 0.001 0.010 i=4, j=4 => 1.00073 1.00102 0.000 0.000