<jupyter_start><jupyter_text>Finding rough minimum flux level required to detect<jupyter_code>sig = 34. # roughly 
time = 6406. / 60. # hours 
sens = sig / np.sqrt(time) # sensitivity 
t = (5./sens)**2 # time required to find 5 sigma 

print(sens)
print(t)<jupyter_output>3.29049378665
2.30896770473<jupyter_text>$$S = s / \sqrt{t}$$$$t = \left( \frac{s}{S} \right) ^2$$Poisson distribution can be approximated as Gaussian for $n>10$ events<jupyter_code>gam_rate = 0.1582244 * 60 # gamma / hour 
gam_err = 0.006188022 * 60 
#bg_rate = 
f = 1.75

print(gam_rate)
print(gam_err)
print(gam_rate*f)

max_exp = 3.0 # hours / night 
exposure = 3
assert(exposure <= max_exp)
num_evts = exposure * gam_rate

print(num_evts)
print(np.sqrt(num_evts))

# if flux increased 
f = 1.75
print(num_evts*f)
stdev_f = np.sqrt(num_evts*f)
print(stdev_f)
n_sigma = (num_evts*f-num_evts)/stdev_f

print(" a flux level of " + str(f) + " measured for " + str(exposure) + " hours"\
      " times the average rate would be " + str(n_sigma) \
      + " stdevs away from the average rate")<jupyter_output>28.480392
5.33670235258
49.840686
7.05979362305
 a flux level of 1.75 measured for 3 hours times the average rate would be 3.02562583845 stdevs away from the average rate<jupyter_text>$$ \frac{fN-N}{\sqrt{fN}} = t $$$$ \left(f-1\right)^2N^2 = t^2fN $$<jupyter_code>print(np.sqrt(gam_rate*85))
print(gam_err*85)<jupyter_output>28.4067675035
31.558912199999998
{'fraction_non_alphanumeric': 0.13997214484679665, 'fraction_numerical': 0.11281337047353761, 'mean_word_length': 4.61328125, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '520111', 'license': 'MIT', 'n_tokens_mistral': 709, 'n_tokens_neox': 600, 'n_words': 136, 'path': 'GC/flux_lvl_detection_rough.ipynb', 'repo_name': 'mbuchove/VEGAS_scripts', 'size': '1436'}