From 0cf31a0a6114bfe008133c197a730221934b8c39 Mon Sep 17 00:00:00 2001 From: KenichiKaratsu Date: Mon, 2 Sep 2024 16:09:49 +0200 Subject: [PATCH 1/3] Add files via upload Modified some bugs --- scripts/terahertzsweep/AnaSpectrum.py | 5 +++-- scripts/terahertzsweep/Configure.py | 4 ++-- scripts/terahertzsweep/FitSweep.py | 4 +++- scripts/terahertzsweep/KIDCorresp.py | 11 +++++++---- scripts/terahertzsweep/SaveFits.py | 4 +++- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/scripts/terahertzsweep/AnaSpectrum.py b/scripts/terahertzsweep/AnaSpectrum.py index 841a9a3..cde3581 100755 --- a/scripts/terahertzsweep/AnaSpectrum.py +++ b/scripts/terahertzsweep/AnaSpectrum.py @@ -7,7 +7,7 @@ import copy import matplotlib.pyplot as plt -import mkid_data as md +#import mkid_data as md import numpy as np from astropy.io import fits @@ -15,7 +15,7 @@ libpath = os.path.join(os.path.dirname(script_dir), 'libs') sys.path.append(libpath) -from common import * +#from common import * import pandas as pd import scipy.optimize import lmfit @@ -673,5 +673,6 @@ def Plot(mode, kidid, result_F0, result_fit, pp, opt): from fit.confidence_band import confidence_band from matplotlib.backends.backend_pdf import PdfPages + import mkid_data as md main() diff --git a/scripts/terahertzsweep/Configure.py b/scripts/terahertzsweep/Configure.py index d35ba4d..e5bc496 100755 --- a/scripts/terahertzsweep/Configure.py +++ b/scripts/terahertzsweep/Configure.py @@ -104,8 +104,8 @@ def complete(text, state): measure_id = os.path.basename(os.path.dirname(targetdir)) #print("mkdir -p /home/deshima/data/analysis/%s/%s"%(run_id, measure_id)) #os.system("mkdir -p /home/deshima/data/analysis/%s/%s"%(run_id, measure_id)) - print("mkdir -p /Users/sfujita/Desktop/DESHIMA/toptica/analysis/%s/%s"%(run_id, measure_id)) - os.system("mkdir -p /Users/sfujita/Desktop/DESHIMA/toptica/analysis/%s/%s"%(run_id, measure_id)) +# print("mkdir -p /Users/sfujita/Desktop/DESHIMA/toptica/analysis/%s/%s"%(run_id, measure_id)) +# os.system("mkdir -p /Users/sfujita/Desktop/DESHIMA/toptica/analysis/%s/%s"%(run_id, measure_id)) outdir = args.outdir or input('out directory (e.g., out_test):') confdir = outdir + '/conf' disabled_kid_file = outdir + '/disabled_kids.dat' diff --git a/scripts/terahertzsweep/FitSweep.py b/scripts/terahertzsweep/FitSweep.py index 8c5a326..b2c4004 100755 --- a/scripts/terahertzsweep/FitSweep.py +++ b/scripts/terahertzsweep/FitSweep.py @@ -22,7 +22,7 @@ from collections import OrderedDict import matplotlib.pyplot as plt -import mkid_data as md +#import mkid_data as md import numpy as np def get_kids_from_db(runid): @@ -353,6 +353,8 @@ def Plot(kids, force, test, NCPU): """ def plot_multi(params): + import mkid_data as md + i = params["i"] kid = params["kid"] plotdir = params["plotdir"] diff --git a/scripts/terahertzsweep/KIDCorresp.py b/scripts/terahertzsweep/KIDCorresp.py index b023b9d..0d1fa15 100755 --- a/scripts/terahertzsweep/KIDCorresp.py +++ b/scripts/terahertzsweep/KIDCorresp.py @@ -8,7 +8,8 @@ import sqlite3 import datetime import numpy as np -dbname = '/Users/sfujita/Desktop/DESHIMA/toptica/kid_test.db' +#dbname = '/Users/sfujita/Desktop/DESHIMA/toptica/kid_test.db' +dbname = '../kid_test.db' conn = sqlite3.connect(dbname, detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES) @@ -204,12 +205,14 @@ def collision_handler(): import json ## add wideband KID ref_list = [] - line_count = 0 with open(os.path.join(outdir, "reference.dat")) as f: for line in f: - if line_count != 0: + if line[0] == '#': + continue + elif len(line[:-1]) == 0: + continue + else: ref_list.append(int(line.split("\n")[0])) - line_count += 1 print("reference.dat = ", ref_list) tmpdict = {} if len(ref_list)>=4: diff --git a/scripts/terahertzsweep/SaveFits.py b/scripts/terahertzsweep/SaveFits.py index db83f15..d13030d 100755 --- a/scripts/terahertzsweep/SaveFits.py +++ b/scripts/terahertzsweep/SaveFits.py @@ -241,8 +241,8 @@ def Plot(kids, plot_tod_ratio, force, blindtone, test, NCPU): else: os.symlink(plotdir, calibtoddir) + blinddir = outdir + '/figSaveFits.Blindtone' if blindtone: - blinddir = outdir + '/figSaveFits.Blindtone' if force: try: shutil.rmtree(blinddir) @@ -281,6 +281,8 @@ def Plot(kids, plot_tod_ratio, force, blindtone, test, NCPU): # # if test and i>10: break def plot_multi(params): + import mkid_data as md + i = params["i"] kid = params["kid"] plotdir = params["plotdir"] From 769d197841a7221eb84d9f3cccb474f9caaf60cc Mon Sep 17 00:00:00 2001 From: KenichiKaratsu Date: Mon, 2 Sep 2024 16:12:11 +0200 Subject: [PATCH 2/3] Add files via upload Update database file --- scripts/kid_test.db | Bin 552960 -> 573440 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/scripts/kid_test.db b/scripts/kid_test.db index 42c6b8dda98fcaa3b4723649cc22086d74116239..d84c41c97cd526422e418a17565dc75b7b11f24f 100755 GIT binary patch delta 12958 zcmZvi2UJwo_J`+ApMja7C`FxPi#^!8(HvA_RIs9`s3?M!fvLcZ<$ABdhFD`S*gN*# zqKPGn#Mq6!cWjA0>i^uid*{8p^=B>LT6w>34#Uhn=k9OcJ^E(((W5I)EgjrKp-@a> z|L})Q`?{W{g`(yFg^-ey!sVnWb5c~>Q`CzyDp=G$h55F*jA>=y^}ufea*UUaQHIL; zfx33ueww2itJ=3UI4EA-Rwx&t3$Ip9DR|xelhaaTsny^i_WJ++FU6!* zU1Fl+W6H%xw~UP`SK;63jDxDg4wb`o;ZadaVI(Y8w_&}c@6v`08tj(Vi;e&He=ElS z?}Go%r6tE5^QhTB4g06vdCa40@*zmW{(Pn7we%t6T0UA{?+m8OW0o1^g39v~g>?4+ zPVk!8|9Ux-!g9}Y!m`0K-Qu#uTN+rx%x}$?%)8C=%)`yS&CSik^u=`3bjY;SG{%%- ziZN9-=>i`H9uHg_m>ZZD7#A27XbLC}C<-VD$P2Iq#05kJn2g27B4dFu&uBBo8KaCQ zL$RUAP+-V2*bH$7K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bN`Xj7)p;h@$=MfR?jpGq$E|2QC zUmsrG%*rlI+1^-peiRbYoCllL@#K9Fu9~(G(XVgp_A?TJ`poFxU!j@Rg>4NgcOfD; z95(`i+Wu$AG_%kJa%R(U1f0v}b zM(%twAGd^vAaR@r35#@aTj{X1T}yU4VI`s&t_e2+0rJpJnyaZR>a~`L;BcG^0j)f> zV~aj_gb5ZA!QnV30{)qp29!?^Yo9(NaXJw};y4EoB|rJAP@4YY*NzK7f1c&1?5co@;+_Cp=J@NXJtwaQeO>9!*OW{-1pa~)N$fI3GBtbFK{?+7y`HC=^bZm=@FlM^dllT z95>VtFgq#ff0~j-oxgvqzM-0%h#+y?5M1JtJip`Wng7eSH|%B)4#y2f;4Eu*u>l^} zeR%{)1c&1WA#lpy{h;p56(1cRj}j3ajvI*EqonjM*$j^-fNp82W6dbMFjH}fqms8T zrk>>?(_19w5CJTXOF`h!1Xk*NKXdY(Q`%_o-Q4|rtAc67tCuu_BwnE)gr0KLJq zsRN!@jUG${4*PHn6*ijP?up<4pgRKo`B=U*wc8Af%&vY!umjNz3Fr;l?{?|ZrqDrz z3;^O0fZm{^@26;Yi&>I42br7xXVBiuo~%b(Dp*wJ$L2!wdUKvR-5k$=|N7a=MlQ^J z1e?3~9|sKr2W2A{Qu1F48YCMbPFvuy7Acj?zFTyN@_5(z6 Date: Tue, 3 Sep 2024 14:39:11 +0200 Subject: [PATCH 3/3] Add files via upload New correspondence algorithm by Arend --- scripts/terahertzsweep/KIDCorresp.py | 51 +++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/scripts/terahertzsweep/KIDCorresp.py b/scripts/terahertzsweep/KIDCorresp.py index 0d1fa15..d45e87c 100755 --- a/scripts/terahertzsweep/KIDCorresp.py +++ b/scripts/terahertzsweep/KIDCorresp.py @@ -107,27 +107,68 @@ def kid_corresp(kids, args): ax.set_ylabel('F_filter [GHz]') fig.savefig(os.path.join(plotdir, 'raw.pdf')) fig.savefig(os.path.join(plotdir, 'raw.png'), dpi = 300) + plt.close() + plt.clf() + plt.cla() + # fig.savefig(os.path.join(plotdir, 'raw.design.pdf')) # fig.savefig(os.path.join(plotdir, 'raw.design.png'), dpi = 300) ########################## adjust + + + #### Arend's adjustment + # Split into left and right of LO + measured_idx_sort = np.argsort(f_KID_measured) + design_idx_sort = np.argsort(f_KID_design) + + F_filter_measured = F_filter_measured[measured_idx_sort] + F_filter_design = F_filter_design[design_idx_sort] + f_KID_measured = np.sort(f_KID_measured) + f_KID_design = np.sort(f_KID_design) + + max_idx_measured = np.argmax(np.diff(f_KID_measured)) + max_idx_design = np.argmax(np.diff(f_KID_design)) + + f_KID_measured_lo = f_KID_measured[:max_idx_measured+1] + f_KID_measured_hi = f_KID_measured[max_idx_measured+1:] + f_KID_design_lo = f_KID_design[:max_idx_design+1] + f_KID_design_hi = f_KID_design[max_idx_design+1:] + def adjust(a, b): ''' supposing a and b are numpy array''' return a, (a.std()/b.std())*(b - b.mean()) + a.mean() - print( f_KID_design, f_KID_measured ) + fKda_lo, fKma_lo = adjust(f_KID_design_lo, f_KID_measured_lo) + fKda_hi, fKma_hi = adjust(f_KID_design_hi, f_KID_measured_hi) + + # Also adjust whole arrays, for the Y-axis rectification fKda, fKma = adjust(f_KID_design, f_KID_measured) Ffda, Ffma = adjust(F_filter_design, F_filter_measured) + + def rectify(a, b, offset): + """ offset parameter to move to left and right of LO gap """ + return a - a.mean() - offset, (b - b.mean())*a.std()/b.std() - def rectify(a, b): - return a - a.mean(), (b - b.mean())*a.std()/b.std() + X_design_lo, Y_design_lo = rectify(fKda_lo, Ffda, offset=0.5) + X_design_hi, Y_design_hi = rectify(fKda_hi, Ffda, offset=-0.5) + _, Y_design = rectify(fKda, Ffda, offset=0) + X_design = np.append(X_design_lo, X_design_hi) + #Y_design = np.append(Y_design_lo, Y_design_hi) - X_design, Y_design = rectify(fKda, Ffda) C_design = X_design + 1j*Y_design - X_measured, Y_measured = rectify(fKma, Ffma) + + X_measured_lo, Y_measured_lo = rectify(fKma_lo, Ffma, offset=0.5) + X_measured_hi, Y_measured_hi = rectify(fKma_hi, Ffma, offset=-0.5) + _, Y_measured = rectify(fKma, Ffma, offset=0) + X_measured = np.append(X_measured_lo, X_measured_hi) + #Y_measured = np.append(Y_measured_lo, Y_measured_hi) + C_measured = X_measured + 1j*Y_measured + #### End of Arend's adjustment + ############# adj plot fig, ax = plt.subplots(figsize = (8,8)) ax.scatter(X_measured, Y_measured, label = 'Measured')