Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script to fit NET vs. PWV #1

Open
wants to merge 44 commits into
base: SAT_PBDRv4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
156c55b
Add script to fit NET vs. PWV
keskitalo May 20, 2022
0da3a72
adding AoA models
JohnRuhl Jun 21, 2022
bee3e60
moved recent results to new directory
JohnRuhl Jun 21, 2022
2dd06ee
updated SAT yamls to reflect correct layout, horn diameters, in MFs
JohnRuhl Jun 28, 2022
c1e98a7
adding some notebooks with band and atmos investigations in jr_runs d…
JohnRuhl Aug 1, 2022
85a8c3e
fixing jr_runs by adding symlinks
JohnRuhl Aug 1, 2022
886facb
PBDR_2023 dierectory added
JohnRuhl Feb 5, 2023
6cc71f0
added BandOptimization notebook
JohnRuhl Feb 6, 2023
42494b6
LF_band edges update, with synch sensitivity, and moving transition f…
JohnRuhl Feb 27, 2023
329e813
deleting LF_band_edges, b/c won't push
JohnRuhl Feb 28, 2023
b13a7a8
readding LF_band_edges notebook
JohnRuhl Feb 28, 2023
b7c1090
test.txt
JohnRuhl Feb 28, 2023
261274e
remove test.txt
JohnRuhl Feb 28, 2023
9a4d23a
updating pbdr calculations with current models
JohnRuhl Mar 19, 2023
fdf4b30
LF band edges, fixed last plot
JohnRuhl Mar 22, 2023
4de38d9
getting PBDR straight, should be near final version
JohnRuhl Apr 12, 2023
85a128b
adding toml outputs
JohnRuhl Apr 12, 2023
7899ce5
adding bk ratio stuff
JohnRuhl May 31, 2023
5f97e14
added psats toml, and notebook showing how nets change with varying m…
JohnRuhl Feb 25, 2024
0ba13ca
added 2D (elev,pwv) output toml file
JohnRuhl Apr 13, 2024
1871959
updated elev_pwv_2D file to include Pelec, which goes below zero when…
JohnRuhl Apr 13, 2024
c1f6048
Added 2D (elev,pwv) outputs
JohnRuhl Apr 13, 2024
1dfc328
updating AoA with previous work
JohnRuhl Jun 18, 2024
2342b56
moved existing files to 2022 subdirectory
JohnRuhl Jun 18, 2024
fc6eb0d
aperture funcs moved, but symbolic link?
JohnRuhl Jun 18, 2024
62543da
adding AoA/2024
JohnRuhl Jun 19, 2024
f2c776b
writing mapping speed ratios
JohnRuhl Jun 19, 2024
d7a2b9c
new AoA 2024 SAT beam estimates
JohnRuhl Jun 23, 2024
a663dfd
Both LATs in Chile, notebook and yamls added
JohnRuhl Jul 15, 2024
7c693c7
updated AoA/2024 yamls and notebooks
JohnRuhl Sep 17, 2024
8d7dc55
update to SAT NETs
JohnRuhl Sep 28, 2024
12b138b
fixed bug found by Michel Piat, re mistake in keeping psats fixed. W…
JohnRuhl Oct 10, 2024
83fabd8
Add yaml file for Phase 2 case
smsimon Nov 21, 2024
70ad7fd
Create test.txt
smsimon Nov 21, 2024
b2997bf
Noises run with Phase 2 configuration
smsimon Nov 21, 2024
fb2b880
Delete jbolo/AoA/2024/tomls_20241121/test.txt
smsimon Nov 21, 2024
5cdce4e
Notebook used for Phase 2 Noise Calculations
smsimon Nov 21, 2024
e8cf568
Non-split band configuration (MF2 is the MF band)
smsimon Nov 22, 2024
8037646
Non-split band configuration (MF2 is the MF band)
smsimon Nov 22, 2024
cbad153
adding 2025 directory, with Chile-optimization, exploration, files
JohnRuhl Feb 11, 2025
dec81b1
SAT comparisons study
JohnRuhl Feb 19, 2025
055a075
fixing SAT_comparisions notebook
JohnRuhl Feb 19, 2025
45766ab
SAT comparisons things
JohnRuhl Feb 26, 2025
8f11cc7
cleanup/corrections to models
JohnRuhl Feb 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions bolo-calc/pbdr_v2/fit_NET_v_pwv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import os
import sys

import matplotlib.pyplot as plt
import numpy as np
import toml


table = toml.load("outputs_july27/NET_v_pwv.toml")

pwv_ref = 1.0

nrow, ncol = 2, 2
fig = plt.figure(figsize=[12 * ncol, 6 * nrow])
iplot = 0

for key in table.keys():
if key.endswith(".yaml"):
subtable = table[key]
iplot += 1
ax = fig.add_subplot(nrow, ncol, iplot)
ax.set_title(key)
for band in subtable:
pwv = np.array(subtable[band]["pwv"]) * 1e-3
net = np.array(subtable[band]["NET"])
pivot_pwv = subtable[band]["xdefault"] * 1e-3
p = np.polyfit(pwv, net, 2)
pivot_net = np.polyval(p, pivot_pwv)
plt.plot(pwv, net / pivot_net, label=f"{band} : {pivot_net:.1f}", lw=3)
#plt.plot(np.log(pwv), np.log((net / pivot_net) ** 2), label=f"{band} : {pivot_net:.1f}", lw=3)
p /= pivot_net
x = np.linspace(0, 6, 100)
plt.plot(x, np.polyval(p, x), "k--", label=f"{band} : fit = {p[2]:.6f}, {p[1]:.6f}, {p[0]:.6f}")
#plt.plot(np.log(x), np.log(np.polyval(p, x) ** 2), "k--", label=f"{band} : fit = {p[2]:.6f}, {p[1]:.6f}, {p[0]:.6f}")
print(f"{key} {band} {p[2]:.6f}, {p[1]:.6f}, {p[0]:.6f}")
ax.set_ylim([0, 3])
ax.set_xlabel("PWV [mm]")
ax.set_ylabel("NET factor")
plt.legend(loc="best")
fig.savefig("NET_v_pwv_fit.png")
plt.show()
609 changes: 609 additions & 0 deletions jbolo/2025/SAT_NETs_Chile_Phase2.ipynb

Large diffs are not rendered by default.

631 changes: 631 additions & 0 deletions jbolo/2025/SAT_comparisons.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions jbolo/2025/atmos
Binary file added jbolo/2025/yamls/.Bicep3_90GHz.yaml.swp
Binary file not shown.
94 changes: 94 additions & 0 deletions jbolo/2025/yamls/Bicep3_90GHz.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
version: {date: 20250210, name: 'Bicep3_orig'}
# Fixed LF wafer counts, which were off by a factor of two, and adjusted MF/HF for pixels lost to pins.
# Setting spillovers to those calculated by P. Grimes here:
# https://docs.google.com/spreadsheets/d/1dppe8RRixXaNPDD-mv_Fw45q-ndAt2ETHffZ9tGA1W0/edit?gid=439824212#gid=439824212
#
config:
dnu: 0.1 # GHz frequency resolution for integrals
# We set dust and synchrotron very small so they are ignored. Zero eventually throws an error.
sources:
cmb: {source_type: blackbody, T: 2.726, emiss: 1.0}
# dust: {source_type: greybody, amplitude: 1e-5, scale_frequency: 353.0, scale_temperature: 19.7}
# synchrotron: {source_type: powerlaw, spectral_index: -3.0, amplitude: 1e-10, scale_frequency: 30.0}
atmosphere:
# This shows how to do it with the bolo-calc hdf5 file.
source_type: hdf5 #
file: '../atmos/atm_20201217.hdf5'
site: 'Pole'
pwv: 321 # microns, from 0 to 8000. 321u for Pole from Kuo's paper, ~8 month observing season.
elevation: 55 # degrees, integer from 1 to 90
optics_defaults: {temperature: 250.0, reflection: 0.0, scatter_frac: 0.0, spillover: 0.0, absorption: 0.0}
optical_elements:
# requires python 3.7 or later, because we assume dict{} is ordered.
# This list of elements starts with the one closest to the sky, and moves toward the detector.
baffle: {obj_type: Bespoke, absorption: 0.0045} # CV says 2021 paper value is not right, more like 3.3KRJ at 90GHz.
##window: {obj_type: LossTangent, reflection: 0.003, thickness: 0.010, index: 1.525, loss_tangent: 2.22E-4}
window: {obj_type: LossTangent, temperature: 260.0,reflection: 0.003, thickness: 0.03175, index: 1.525, loss_tangent: 2.22E-4}
RTMLI_10 : {obj_type: Bespoke, temperature: 150.0,absorption: [0.006, 0.006] } # 10 layers
hwp: {obj_type: Bespoke, temperature: 1.0, absorption: [0.00001, 0.00001] }
alumina_filt: {obj_type: LossTangent, temperature: 50.0, reflection: 0.02, thickness: 0.010, index: 3.1, loss_tangent: 3.0E-4}
lyot: {obj_type: Bespoke, temperature: 5.5, absorption: [0.13, 0.06]} # 0.13 is from Bicep3 paper
lens1: {obj_type: LossTangent, temperature: 5.5, reflection: 0.02, thickness: 0.021, index: 3.1, loss_tangent: 3.0E-4}
nylon_filt: {obj_type: Bespoke, temperature: 5.5, reflection: 0.01, absorption: [0.006, 0.025]}
lens2: {obj_type: LossTangent, temperature: 5.5, reflection: 0.02, thickness: 0.027, index: 3.1, loss_tangent: 3.0E-4}
lowpass: {obj_type: Bespoke, temperature: 5.0, absorption: 0.01, reflection: 0.05}
bolo_config:
# For aperture stop calcs
waist_factor: 3.0
f_number: 1.45 #
#
N_polarizations: 1
#
AOmega_method: ModeCount # or "Fixed"
N_modes: 1 # required if method == "ModeCount"
#
# # options: "from_optical_power", in which case psat = P_optical * psat_factor,
# or "specified", in which case it is given for each detector channel explicitly.
psat_method: 'from_optical_power'
psat_factor: 2.5 # must a number if psat_method is "from_optical_power"
beta: 2.5 # (from arXiv:1403.4302 for Bicep3, n=2.5) this is beta = n-1. bolo-calc called it "carrier index". Note that G_dynamic is found from psat, T_c, and carrier_index
#
T_bath: 0.268
T_c: 0.48
R_bolo: 0.08 # as biased in operation, ie less than R_normal
yield: 0.8
num_wafers_per_tube: 12
optically_good_det_fraction: 1.0
readout:
# method: 'fraction' #in anticipation of getting NEI number/formula.
method: 'from_NEI' # uses channels readout_NEI
channels:
MF_1:
chnum: 0 # This sets the order of lists in optical elements, must start at zero and increment from there.
band_center: 96.1 # not used
# Based on quoted bandwidth in paper
nu_low: 82.5 # if a band_response file is given, these set the low and high limits of integration.
nu_high: 109.9
#
# Based on H.Hui's email saying he used 25% bandwidth
#nu_low: 84.09
#nu_high: 108.11
#
#read_frac: 0.05
readout_NEI: 12.0e-12 # A/rtHz, see fig 21 of arXiv:2110.00482, then multiply by sqrt(2) to get from uArtsec to uA/rtHz.
band_response : {method: flat}
#band_response : {method: bandfile, fname : spt3g_90_pixelband.txt }
det_eff: 0.480
#psat: 4.60e-12 # see psat_method above.
horn_diameter: 7.5e-3 # square patch size from Bicep3 paper.
pixel_spacing: 8.0e-3
num_det_per_wafer: 100 # 9/24/2024, 215 actual pixels (217-2 for pins), 430 detectors/band
MF_2:
chnum: 1 # This sets the order of lists in optical elements, must start at zero and increment from there.
band_center: 150.0 # not used
nu_low: 131.25 # centered at 150GHz, 25% fractional bandwidth.
nu_high: 168.75
#read_frac: 0.05
readout_NEI: 8.0e-12 # A/rtHz, see fig 21 of arXiv:2110.00482
band_response : {method: flat}
#band_response : {method: bandfile, fname : spt3g_90_pixelband.txt }
det_eff: 0.50
#psat: 4.60e-12 # see psat_method above.
horn_diameter: 7.5e-3 # meters
pixel_spacing: 8.0e-3
num_det_per_wafer: 100 # 9/24/2024, 215 actual pixels (217-2 for pins), 430 detectors/band
173 changes: 173 additions & 0 deletions jbolo/2025/yamls/SAT_HWP_aggr_20241121_phase2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
version: {date: 20241121, name: 'S4_aggr+HWP_phase2'}
# Fixed LF wafer counts, which were off by a factor of two, and adjusted MF/HF for pixels lost to pins.
# Setting spillovers to those calculated by P. Grimes here:
# https://docs.google.com/spreadsheets/d/1dppe8RRixXaNPDD-mv_Fw45q-ndAt2ETHffZ9tGA1W0/edit?gid=439824212#gid=439824212
#
config:
dnu: 0.1 # GHz frequency resolution for integrals
# We set dust and synchrotron very small so they are ignored. Zero eventually throws an error.
sources:
cmb: {source_type: blackbody, T: 2.726, emiss: 1.0}
# dust: {source_type: greybody, amplitude: 1e-5, scale_frequency: 353.0, scale_temperature: 19.7}
# synchrotron: {source_type: powerlaw, spectral_index: -3.0, amplitude: 1e-10, scale_frequency: 30.0}
atmosphere:
# This shows how to do it with the bolo-calc hdf5 file.
source_type: hdf5 #
file: '../atmos/atm_20201217.hdf5'
site: 'Atacama'
pwv: 993 # microns, from 0 to 8000. 321u for Pole from Kuo's paper, ~8 month observing season.
elevation: 50 # degrees, integer from 1 to 90
optics_defaults: {temperature: 273.0, reflection: 0.0, scatter_frac: 0.0, spillover: 0.0, absorption: 0.0}
optical_elements:
# requires python 3.7 or later, because we assume dict{} is ordered.
# This list of elements starts with the one closest to the sky, and moves toward the detector.
baffle: {obj_type: Bespoke, absorption: 0.01}
window: {obj_type: LossTangent, reflection: 0.003, thickness: 0.020, index: 1.525, loss_tangent: 3.0E-4}
RTMLI_10 : {obj_type: Bespoke, temperature: 150.0, absorption: [0.00399, 0.00399, 0.00399, 0.00399, 0.00399, 0.00399, 0.00435, 0.0083] } # 10 layers
hwp: {obj_type: LossTangent, temperature: 55.0, reflection: 0.02, thickness: 0.004, index: 3.1, loss_tangent: 3.0E-4}
alumina_filt: {obj_type: LossTangent, temperature: 50.0, reflection: 0.02, thickness: 0.010, index: 3.1, loss_tangent: 3.0E-4}
nylon_filt: {obj_type: Bespoke, temperature: 4.0, reflection: 0.01, absorption: [0.0003, 0.0007, 0.0056, 0.0075, 0.0223, 0.0265, 0.0698, 0.123 ]}
lens1: {obj_type: LossTangent, temperature: 1.0, reflection: 0.02, thickness: 0.055, index: 1.52, loss_tangent: 1.0E-4}
# lyot abs numbers from Grimes:
# https://docs.google.com/spreadsheets/d/1dppe8RRixXaNPDD-mv_Fw45q-ndAt2ETHffZ9tGA1W0/edit?gid=439824212#gid=439824212
lyot: {obj_type: Bespoke, temperature: 1.0, absorption: [0.482, 0.227, 0.512, 0.458, 0.160, 0.127, 0.06, 0.02]}
lens2: {obj_type: LossTangent, temperature: 1.0, reflection: 0.02, thickness: 0.059, index: 1.52, loss_tangent: 1.0E-4}
lowpass: {obj_type: Bespoke, temperature: 0.1, absorption: 0.01, reflection: 0.05}
bolo_config:
# For aperture stop calcs
waist_factor: 3.0
f_number: 1.45 #
#
N_polarizations: 1
#
AOmega_method: ModeCount # or "Fixed"
N_modes: 1 # required if method == "ModeCount"
#
# # options: "from_optical_power", in which case psat = P_optical * psat_factor,
# or "specified", in which case it is given for each detector channel explicitly.
psat_method: 'from_optical_power'
psat_factor: 2.5 # must a number if psat_method is "from_optical_power"
beta: 2.7 # this is beta = n-1. bolo-calc called it "carrier index". Note that G_dynamic is found from psat, T_c, and carrier_index
#
T_bath: 0.1
T_c: 0.16
R_bolo: 0.006 # as biased in operation, ie less than R_normal
yield: 0.8
num_wafers_per_tube: 12
optically_good_det_fraction: 1.0
readout:
# method: 'fraction' #in anticipation of getting NEI number/formula.
method: 'from_NEI' # uses channels readout_NEI
channels:
LF_1:
chnum: 0 # This sets the order of lists in optical elements, must start at zero and increment from there.
band_center: 24.75 # not used
nu_low: 21.50 # if a band_response file is given, these set the low and high limits of integration.
nu_high: 28.00
#read_frac: 0.05
readout_NEI: 45.0e-12 # A/rtHz
band_response : {method: flat}
#band_response : {method: bandfile, fname : spt3g_90_pixelband.txt }
det_eff: 0.65
#psat: 1.0e-12 # see psat_method above.
horn_diameter: 18.95e-3 # meters
pixel_spacing: 19.1e-3
num_det_per_wafer: 74 #9/24/2024, 19 pixels/wafer
LF_2:
chnum: 1 # This sets the order of lists in optical elements, must start at zero and increment from there.
band_center: 36.5 # not used
nu_low: 28.0 # if a band_response file is given, these set the low and high limits of integration.
nu_high: 45.0
#read_frac: 0.05
readout_NEI: 45.0e-12 # A/rtHz
band_response : {method: flat}
#band_response : {method: bandfile, fname : spt3g_90_pixelband.txt }
det_eff: 0.65
#psat: 4.18e-12 # see psat_method above.
horn_diameter: 18.95e-3 # meters
pixel_spacing: 19.1e-3
num_det_per_wafer: 74 #9/24/2024, 19 pixels/wafer
MF_1_1:
chnum: 2 # This sets the order of lists in optical elements, must start at zero and increment from there.
band_center: 85.0 # not used
nu_low: 74.8 # if a band_response file is given, these set the low and high limits of integration.
nu_high: 95.2
#read_frac: 0.05
readout_NEI: 45.0e-12 # A/rtHz
band_response : {method: flat}
#band_response : {method: bandfile, fname : spt3g_90_pixelband.txt }
det_eff: 0.65
#psat: 4.60e-12 # see psat_method above.
horn_diameter: 5.15e-3 # meters
pixel_spacing: 5.3e-3
num_det_per_wafer: 860 # 9/24/2024, 215 actual pixels (217-2 for pins), 430 detectors/band
MF_2_1:
chnum: 3 # This sets the order of lists in optical elements, must start at zero and increment from there.
band_center: 95.0 # not used
nu_low: 83.6 # if a band_response file is given, these set the low and high limits of integration.
nu_high: 106.4
#read_frac: 0.05
readout_NEI: 45.0e-12 # A/rtHz
band_response : {method: flat}
#band_response : {method: bandfile, fname : spt3g_90_pixelband.txt }
det_eff: 0.65
#psat: 12.51e-12 # see psat_method above.
horn_diameter: 5.15e-3 # meters
pixel_spacing: 5.30e-3
num_det_per_wafer: 860 # 9/24/2024, 269 actual pixels, (271-2 for pins), so 538
MF_1_2:
chnum: 4 # This sets the order of lists in optical elements, must start at zero and increment from there.
band_center: 145.0 # not used
nu_low: 129.05 # if a band_response file is given, these set the low and high limits of integration.
nu_high: 160.95
#read_frac: 0.05
readout_NEI: 45.0e-12 # A/rtHz
band_response : {method: flat}
#band_response : {method: bandfile, fname : spt3g_90_pixelband.txt }
det_eff: 0.65
#psat: 4.60e-12 # see psat_method above.
horn_diameter: 5.15e-3 # meters
pixel_spacing: 5.3e-3
num_det_per_wafer: 860 # 9/24/2024, 215 actual pixels (217-2 for pins), 430 detectors/band
MF_2_2:
chnum: 5 # This sets the order of lists in optical elements, must start at zero and increment from there.
band_center: 155.0 # not used
nu_low: 137.95 # if a band_response file is given, these set the low and high limits of integration.
nu_high: 172.05
#read_frac: 0.05
readout_NEI: 45.0e-12 # A/rtHz
band_response : {method: flat}
#band_response : {method: bandfile, fname : spt3g_90_pixelband.txt }
det_eff: 0.65
#psat: 4.60e-12 # see psat_method above.
horn_diameter: 5.15e-3 # meters
pixel_spacing: 5.3e-3
num_det_per_wafer: 860 # 9/24/2024, 269 actual pixels, (271-2 for pins), so 538
HF_1:
chnum: 6 # This sets the order of lists in optical elements, must start at zero and increment from there.
band_center: 227.0 # not used
nu_low: 198.0 # if a band_response file is given, these set the low and high limits of integration.
nu_high: 256.0
#read_frac: 0.05
readout_NEI: 45.0e-12 # A/rtHz
band_response : {method: flat}
#band_response : {method: bandfile, fname : spt3g_90_pixelband.txt }
det_eff: 0.65
#psat: 1.0e-12 # see psat_method above.
horn_diameter: 5.05e-3 # meters
pixel_spacing: 5.2e-3
num_det_per_wafer: 934
HF_2:
chnum: 7 # This sets the order of lists in optical elements, must start at zero and increment from there.
band_center: 285.5 # not used
nu_low: 256.0 # if a band_response file is given, these set the low and high limits of integration.
nu_high: 315.0
#read_frac: 0.05
readout_NEI: 45.0e-12 # A/rtHz
band_response : {method: flat}
#band_response : {method: bandfile, fname : spt3g_90_pixelband.txt }
det_eff: 0.65
#psat: 4.18e-12 # see psat_method above.
horn_diameter: 5.05e-3 # meters
pixel_spacing: 5.2e-3
num_det_per_wafer: 934
Loading