Skip to content

Commit

Permalink
Fix environment.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
watsonjj committed Nov 7, 2024
1 parent 228c87f commit 87f7f64
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 12 deletions.
5 changes: 0 additions & 5 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: sstcam-simulation
channels:
- defaults
- conda-forge
- cta-observatory
dependencies:
- anaconda-client
- pip
- numpy~=1.21
- scipy
Expand All @@ -18,8 +16,5 @@ dependencies:
- requests
- tqdm
- pytest
- notebook
- ctapipe~=0.9.0
- eventio>=1.4.1
- pip:
- "--editable=git+https://github.com/sstcam/CHECLabPy#egg=CHECLabPy"
21 changes: 16 additions & 5 deletions scratch/extract_candidate_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
Prod4Window,
DurhamNeedleWindowD2208Prod1FilterAR,
AkiraWindow,
NoWindow,
)
import numpy as np
import pandas as pd
from scipy.interpolate import RegularGridInterpolator
from tqdm import tqdm

SIM_PATH = "/Users/Jason/Software/sstcam-simulation/optimisation_studies/overvoltage/performance.h5"
SIM_PATH = "/Users/Jason/Software/sstcam/sstcam-simulation/optimisation_studies/overvoltage/performance.h5"


class PEInterpolator:
Expand Down Expand Up @@ -62,6 +63,7 @@ def main():
)

window_candidates = dict(
no_window=NoWindow(),
durham_needle=WindowDurhamNeedle(),
run2=SSTWindowRun2(),
run3=SSTWindowRun3(),
Expand Down Expand Up @@ -91,10 +93,19 @@ def main():
camera_cherenkov_pde = eff.camera_cherenkov_pde
mv_per_pe = 3.2
nominal_nsb_rate = eff.nominal_nsb_rate.to_value("MHz")
mia_pe = mia_gamma_interp(opct, nominal_nsb_rate, mv_per_pe)[0]
mia_photons = mia_pe / camera_cherenkov_pde
trig_thresh_pe = trigger_threshold_mean_interp(opct, nominal_nsb_rate, mv_per_pe)[0]
trig_thresh_photons = trig_thresh_pe / camera_cherenkov_pde

try:
mia_pe = mia_gamma_interp(opct, nominal_nsb_rate, mv_per_pe)[0]
mia_photons = mia_pe / camera_cherenkov_pde
except ValueError:
mia_photons = np.nan

try:
trig_thresh_pe = trigger_threshold_mean_interp(opct, nominal_nsb_rate, mv_per_pe)[0]
trig_thresh_photons = trig_thresh_pe / camera_cherenkov_pde
except ValueError:
trig_thresh_pe = np.nan
trig_thresh_photons = np.nan

d_list.append(dict(
sipm_candidate=sipm_candidate,
Expand Down
4 changes: 2 additions & 2 deletions scratch/resolution_calculators.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -876,7 +876,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.0"
"version": "3.9.18"
}
},
"nbformat": 4,
Expand Down
11 changes: 11 additions & 0 deletions sstcam_simulation/utils/window_durham_needle.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,17 @@ def weight_by_incidence_angle(self, off_axis_angle: float):
return self.transmission[0]


class NoWindow(Window):
def __init__(self):
super().__init__(
incidence_angles=np.array([0]),
transmission=np.full((1, 800), 0.9),
)

def weight_by_incidence_angle(self, off_axis_angle: float):
return self.transmission[0]


class AkiraWindow(Window):
def __init__(self):
path = get_data("datasheet/efficiency/akira_window.csv")
Expand Down

0 comments on commit 87f7f64

Please sign in to comment.