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

Gain computation with SPE fit and Photo-statistic methods #38

Merged
merged 100 commits into from
Mar 17, 2023
Merged
Changes from 1 commit
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
765a802
-NectarGAIN
guillaumegrolleron Nov 9, 2022
550f7a7
-clean
guillaumegrolleron Nov 9, 2022
269f6b7
cleaning
guillaumegrolleron Dec 14, 2022
8fa7805
-new code for the SPE fit
guillaumegrolleron Dec 14, 2022
72f3cd2
-utils for NectarGain
guillaumegrolleron Dec 14, 2022
d952ce1
-implementation of photo statistic method
guillaumegrolleron Dec 14, 2022
c0336d3
-NectarGAIN
guillaumegrolleron Nov 9, 2022
aabe571
-typo log
guillaumegrolleron Dec 15, 2022
59dd96c
-bugfix gain computation
guillaumegrolleron Dec 16, 2022
ff8951e
-add parent class for SPE fit
guillaumegrolleron Dec 16, 2022
b66ff99
-update to combined SPE fit
guillaumegrolleron Dec 16, 2022
2f29b77
-add not normalized gaussian
guillaumegrolleron Jan 3, 2023
362f536
-parent class NectarGainSPE
guillaumegrolleron Jan 3, 2023
a33f69f
-cleaning child methods following parent class
guillaumegrolleron Jan 3, 2023
782d8b9
NectarGainSPE fit combined for 1000V and 1400V
guillaumegrolleron Jan 3, 2023
3d55713
minor changes
guillaumegrolleron Jan 3, 2023
e4ebedd
-luminosity can now be different
guillaumegrolleron Jan 3, 2023
8dd7886
-minor change for prefit parameters initialization
guillaumegrolleron Jan 3, 2023
cb239d3
-add class for SPE fit for run at nominal
guillaumegrolleron Jan 3, 2023
381905a
-add write method in photostat
guillaumegrolleron Jan 3, 2023
1ab2945
user script modification
guillaumegrolleron Jan 4, 2023
a6269dc
update of Photostat with container
guillaumegrolleron Jan 4, 2023
c102c0f
clean
guillaumegrolleron Jan 4, 2023
834adfa
-add linear interpolation to correlation plot
guillaumegrolleron Jan 6, 2023
e048029
-treatment of broken pixels implemented
guillaumegrolleron Jan 6, 2023
b72aa3a
-error raised if SPE fit results pixels id
guillaumegrolleron Jan 12, 2023
4d9eb1f
-NectarGAIN
guillaumegrolleron Nov 9, 2022
1f0c443
-clean
guillaumegrolleron Nov 9, 2022
8cebc5f
cleaning
guillaumegrolleron Dec 14, 2022
3556893
-new code for the SPE fit
guillaumegrolleron Dec 14, 2022
0af4ca8
-utils for NectarGain
guillaumegrolleron Dec 14, 2022
5183136
-implementation of photo statistic method
guillaumegrolleron Dec 14, 2022
15c0244
-NectarGAIN
guillaumegrolleron Nov 9, 2022
cabeaa3
-typo log
guillaumegrolleron Dec 15, 2022
d7d7ebe
-bugfix gain computation
guillaumegrolleron Dec 16, 2022
547d242
-add parent class for SPE fit
guillaumegrolleron Dec 16, 2022
924de5b
-update to combined SPE fit
guillaumegrolleron Dec 16, 2022
3f95dda
-add not normalized gaussian
guillaumegrolleron Jan 3, 2023
28af7c7
-parent class NectarGainSPE
guillaumegrolleron Jan 3, 2023
08b6300
-cleaning child methods following parent class
guillaumegrolleron Jan 3, 2023
9bf3ea2
NectarGainSPE fit combined for 1000V and 1400V
guillaumegrolleron Jan 3, 2023
62bcaea
minor changes
guillaumegrolleron Jan 3, 2023
7646d03
-luminosity can now be different
guillaumegrolleron Jan 3, 2023
86d2ce0
-minor change for prefit parameters initialization
guillaumegrolleron Jan 3, 2023
967c959
-add class for SPE fit for run at nominal
guillaumegrolleron Jan 3, 2023
c3965e6
-add write method in photostat
guillaumegrolleron Jan 3, 2023
6c644a5
update of Photostat with container
guillaumegrolleron Jan 4, 2023
a40a3a9
clean
guillaumegrolleron Jan 4, 2023
eb11174
-add linear interpolation to correlation plot
guillaumegrolleron Jan 6, 2023
999e7c2
-treatment of broken pixels implemented
guillaumegrolleron Jan 6, 2023
0f5cfaa
-error raised if SPE fit results pixels id
guillaumegrolleron Jan 12, 2023
95a962d
-add mask to broken pixels
guillaumegrolleron Jan 18, 2023
2a50b98
-add 'is_valid' column in output table
guillaumegrolleron Jan 18, 2023
91ac964
user script modif
guillaumegrolleron Jan 23, 2023
dc9bb13
Merge branch 'SPEfit' of github.com:guillaumegrolleron/nectarchain in…
Jan 26, 2023
bf9a1f0
-first implementation of multiprocessing
Jan 26, 2023
a8ece91
-multiprocessing with pool
Jan 26, 2023
125458d
-follow up implemetation multiprocessing
Jan 30, 2023
7559feb
script for 1400V data SPE fit
Feb 1, 2023
48bb97b
-add docstring
Feb 3, 2023
aaa5a52
-multiprocessing implementation for SPE fit
Feb 3, 2023
8e34a02
-save memory in wfs computation script
Feb 3, 2023
3192dda
-improve script for gain computation
Feb 3, 2023
9bd2581
-add script for gain computation of nominal run by fixing shared
Feb 3, 2023
b6b7eb6
-bugfix : hg -> lg in histo computation
Feb 3, 2023
dd0fa3f
Merge branch 'container' into SPEfit
Feb 3, 2023
5be9ae2
improve logging get DIRAC path
Feb 3, 2023
2189e3b
Merge branch 'container' into SPEfit
Feb 4, 2023
a63e176
bugfic when updating mean starting value
Feb 5, 2023
a7c4dcc
script for gain computation
Feb 5, 2023
1803269
add pandas to dependencies
Feb 5, 2023
b96a353
-quite minuit in multiprocessing
Feb 5, 2023
9cfce1c
-cleaning
Feb 6, 2023
a55b080
-renaming scripts
Feb 6, 2023
5e2a426
bugfix masked columns in output table
Feb 6, 2023
7d62219
improve logging
Feb 6, 2023
69082c9
-bugfix : output pixels_id if SPE fit has failed
Feb 7, 2023
ddf2801
-use runs of different shapes in PhotoStat
Feb 7, 2023
058f7ea
-update logging in gain photo-stat script
Feb 7, 2023
411a594
Merge branch 'master' into SPEfit
Feb 10, 2023
34e442b
-typo
Feb 10, 2023
1b24a29
-moving in src
Feb 10, 2023
1b72d67
-clean imports
Feb 10, 2023
78a31c6
typo bugfix
Feb 10, 2023
dbc3336
PR corrections
Feb 15, 2023
dc371ef
-add docstring to link with paper Caroff et al 2019
Feb 16, 2023
b14ddfe
-corrections
Feb 16, 2023
7a5ac7c
bugfix : output path was not well built from
Feb 20, 2023
6938b27
bugfix :
Feb 20, 2023
3b3119d
more generic test path for user_scripts
Feb 21, 2023
ee1923e
new pp and n fixed value for SPE fit based on full free parameters
Feb 23, 2023
18d9049
-add parameters for charge
Feb 23, 2023
89d12cc
typo correction in Caroff et al 2019
Feb 23, 2023
68aadfb
bugfix : use correction coef between FF and Ped
Feb 23, 2023
b2886ba
charge have to be compute before outside
Feb 24, 2023
3b0551a
improvment scripts
Feb 24, 2023
9cc6011
typo
Feb 24, 2023
8f9fb1c
final correction of typo in equations
Mar 16, 2023
1a85aac
likelihood value and pvalue of fit in output
Mar 16, 2023
4e12a30
Merge branch 'master' into SPEfit
Mar 17, 2023
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
Prev Previous commit
Next Next commit
-treatment of broken pixels implemented
(preliminary)
  • Loading branch information
guillaumegrolleron committed Jan 6, 2023
commit e048029a97faa1bafee2e9e75ee503771de81451
2 changes: 1 addition & 1 deletion nectarchain/calibration/NectarGain/SPEfit/NectarGainSPE.py
Original file line number Diff line number Diff line change
@@ -97,7 +97,7 @@ def _get_parameters_gaussian_fit(charge_in, histo_in ,pixel : int,extension = ""
ax.set_ylabel("Events", size=15)
ax.legend(fontsize=15)
os.makedirs(f"{os.environ.get('NECTARCHAIN_LOG')}/figures/",exist_ok=True)
fig.savefig(f"{os.environ.get('NECTARCHAIN_LOG')}/figures/initialization_pixel{pixel}{extension}.pdf")
fig.savefig(f"{os.environ.get('NECTARCHAIN_LOG')}/figures/initialization_pixel{pixel}{extension}_{os.getpid()}.pdf")
fig.clf()
plt.close(fig)
del fig,ax
Original file line number Diff line number Diff line change
@@ -144,8 +144,11 @@ def save(self,path,**kwargs) :
def run(self,pixel : int = None,**kwargs):
if pixel is None :
for i in tqdm(range(self.npixels)) :
log.info(f"running SPE fit for pixel {i} (pixel_id = {self.__pixels_id[i]})")
self._run_obs(i,**kwargs)
if self.nectarGain.charge.mask[i].all() or self.nectarGainHHV.charge.mask[i].all() :
log.info(f'do not run fit on pixel {i} (pixel_id = {self.__pixels_id[i]}), it seems to be a broken pixel from charge computation')
else :
log.info(f"running SPE fit for pixel {i} (pixel_id = {self.__pixels_id[i]})")
self._run_obs(i,**kwargs)
else :
if not(isinstance(pixel,np.ndarray)) :
pixels = np.asarray([pixel],dtype = np.int16)
@@ -157,8 +160,11 @@ def run(self,pixel : int = None,**kwargs):
log.error(e,exc_info=True)
raise e
else :
log.info(f"running SPE fit for pixel {pixel} (pixel_id = {self.__pixels_id[pixel]})")
self._run_obs(pixel,**kwargs)
if self.nectarGain.charge.mask[i].all() or self.nectarGainHHV.charge.mask[i].all() :
log.info(f'do not run fit on pixel {i} (pixel_id = {self.__pixels_id[i]}), it seems to be a broken pixel from charge computation')
else :
log.info(f"running SPE fit for pixel {pixel} (pixel_id = {self.__pixels_id[pixel]})")
self._run_obs(pixel,**kwargs)
return 0

def _run_obs(self,pixel,**kwargs) :
Original file line number Diff line number Diff line change
@@ -79,8 +79,11 @@ def create_output_table(self) :
def run(self,pixel : int = None,**kwargs):
if pixel is None :
for i in tqdm(range(self.npixels)) :
log.info(f"running SPE fit for pixel {i} (pixel_id = {self.__pixels_id[i]})")
self._run_obs(i,**kwargs)
if self.charge.mask[i].all() :
log.info(f'do not run fit on pixel {i} (pixel_id = {self.__pixels_id[i]}), it seems to be a broken pixel from charge computation')
else :
log.info(f"running SPE fit for pixel {i} (pixel_id = {self.__pixels_id[i]})")
self._run_obs(i,**kwargs)
else :
if not(isinstance(pixel,np.ndarray)) :
pixels = np.asarray([pixel],dtype = np.int16)
@@ -92,8 +95,11 @@ def run(self,pixel : int = None,**kwargs):
log.error(e,exc_info=True)
raise e
else :
log.info(f"running SPE fit for pixel {pixel} (pixel_id = {self.__pixels_id[pixel]})")
self._run_obs(pixel,**kwargs)
if self.charge.mask[pixel].all() :
log.info(f'do not run fit on pixel {i} (pixel_id = {self.__pixels_id[i]}), it seems to be a broken pixel from charge computation')
else :
log.info(f"running SPE fit for pixel {pixel} (pixel_id = {self.__pixels_id[pixel]})")
self._run_obs(pixel,**kwargs)
return 0

def save(self,path,**kwargs) :