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

David mts #279

Open
wants to merge 138 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
419b0db
charge linearity and resolution as cli scripts
calispac Oct 29, 2018
dfcdd82
fixed scale correction for p.e.
calispac Oct 29, 2018
945baa7
charge linearity and resolution as cli scripts
calispac Oct 29, 2018
3c7858b
saving waveform std
calispac Oct 29, 2018
deaeeb5
remove check if output file exists
calispac Oct 29, 2018
c4a4516
adding nsb_computation from baseline std
calispac Oct 29, 2018
88a05e8
compute waveform std
calispac Oct 30, 2018
06814dd
take similar indices for baseline and dark charge
calispac Oct 30, 2018
b82d536
pep8
calispac Oct 30, 2018
b92b152
fmpe plot also plot baseline distribution
calispac Oct 31, 2018
5d5a010
use matplotlibrc file
calispac Oct 31, 2018
f041fbc
renamed charge method and docstring
calispac Nov 1, 2018
3846bab
pep8
calispac Nov 1, 2018
f7efc07
use matplotlibrc file
calispac Nov 1, 2018
79403c9
cleanup and choose integration method
calispac Nov 1, 2018
89e1ab1
adding shift option
calispac Nov 1, 2018
8f003ed
use matplotlibrc file
calispac Nov 1, 2018
e98f061
use matplotlibrc file
calispac Nov 1, 2018
7093c9a
function renaming
calispac Nov 1, 2018
f898b72
saving results to fits table
calispac Nov 1, 2018
3667399
saving results to fits file
calispac Nov 1, 2018
c09773d
saving results to fits file
calispac Nov 1, 2018
bce2ac4
input files for --display changed
calispac Nov 5, 2018
1ea9193
removed commented stuff
calispac Nov 6, 2018
7c55caa
update histogram version
calispac Nov 7, 2018
5464218
abstractclassmethod deprecated since py3.3.
calispac Nov 7, 2018
4b714db
testing and improvement for LightSource
calispac Nov 7, 2018
f071a67
fixes and tests for ACLED
calispac Nov 7, 2018
4b4df48
cleanup
calispac Nov 7, 2018
1c77956
Merge remote-tracking branch 'origin/master' into charge_resolution
calispac Nov 7, 2018
284b015
saving ACLED calibration at the end of --fit
calispac Nov 7, 2018
d109ad6
adding main.sh to create env. variables for job
calispac Nov 8, 2018
6429455
results filename as input
calispac Nov 8, 2018
f2785b2
plot leds
calispac Nov 8, 2018
fb3712d
change LEDs init according to new __init__
calispac Nov 8, 2018
177cdf5
more bash scripts for calibration
calispac Nov 8, 2018
850556a
fmpe choose output filenames
calispac Nov 8, 2018
d4ae053
returns histo if exists
calispac Nov 9, 2018
f774fae
fixing mem issue by loading slices of the histogram at each iteration
calispac Nov 9, 2018
fa94e2d
export in 0_main.sh
calispac Nov 9, 2018
f1e35d9
Merge remote-tracking branch 'origin/update_env' into charge_resolution
calispac Nov 9, 2018
6ae4b70
renamed cli argument "pixel" to "pixels"
calispac Nov 12, 2018
547de55
saving spe results as fits
calispac Nov 12, 2018
d479420
trying to set correclty values in pandas DF
calispac Nov 12, 2018
a67d151
remove unecessary fit call
calispac Nov 12, 2018
3fe191e
fits output for timing analysis
calispac Nov 12, 2018
07d258f
typo
calispac Nov 12, 2018
a0f25d1
typo
calispac Nov 13, 2018
fd6ccbf
removed unecessary call
calispac Nov 13, 2018
13b6e7e
change output to fits
calispac Nov 13, 2018
65f57b2
typo
calispac Nov 13, 2018
a29acd1
typo
calispac Nov 13, 2018
1157f74
fiy timing import and load fmpe slice
calispac Nov 13, 2018
bc21e06
load mpe histo by index
calispac Nov 13, 2018
ad671ae
Merge remote-tracking branch 'origin/master'
calispac Nov 21, 2018
f97996f
Merge remote-tracking branch 'origin/master'
calispac Nov 26, 2018
37253fb
Merge branch 'toy_data'
calispac Nov 26, 2018
8b01cd8
Merge remote-tracking branch 'origin/master'
calispac Nov 26, 2018
89976e3
Merge branch 'master' into charge_resolution
calispac Nov 29, 2018
1b06e18
create simple gain drop computation
calispac Nov 29, 2018
587e5f5
first compute raw distributions
calispac Nov 29, 2018
3a79efa
loading gain and templates
calispac Nov 29, 2018
aa11e13
fixes
calispac Nov 29, 2018
56e8942
fixes
calispac Nov 29, 2018
f0bda4f
adding rate scan computation from dark and ghv
calispac Dec 3, 2018
aa13914
submit all jobs to baobab
calispac Dec 3, 2018
78c1e9d
submit all jobs to baobab
calispac Dec 3, 2018
7f1f603
use trigger v2
calispac Dec 6, 2018
0eb5f3b
change cell capacitance
calispac Dec 6, 2018
dad8446
change how figures are saved
calispac Dec 6, 2018
c3a2633
typo
calispac Dec 6, 2018
9a4c39b
saving fmpe to pixel
calispac Dec 6, 2018
3da1537
...to pdf
calispac Dec 6, 2018
904f950
plot in log
calispac Dec 6, 2018
af02fb2
combined mpe fit first with 4 parameters
calispac Dec 7, 2018
039d3ca
pep8
calispac Dec 7, 2018
2a26eb0
change ndf computation
calispac Dec 7, 2018
1e2cbe0
pep8
calispac Dec 7, 2018
55db10b
progress
calispac Dec 10, 2018
f5b33aa
progress
calispac Dec 10, 2018
e0a809f
moved histogram fitters to utils.fitter
calispac Dec 12, 2018
2fe61fe
pep8
calispac Jan 23, 2019
dd27fd8
SPE results to fits table
calispac Jan 23, 2019
1d9324b
saving timing info to calibration files
calispac Jan 23, 2019
b0e7359
saving more info on timing
calispac Jan 23, 2019
b5c86c2
reading Timing in FMPE.py
calispac Jan 23, 2019
10a3d4d
properly reading results filename
calispac Jan 23, 2019
c7d731a
rename docopt args
calispac Jan 23, 2019
9a60b94
fits output correction
calispac Jan 23, 2019
01f67ba
subcommands added for CLI usage
calispac Jan 24, 2019
6ba98b5
update CLI
calispac Jan 24, 2019
2e9c35e
update cli
calispac Jan 24, 2019
e499c5f
fixes for CLI and output to fits files
calispac Feb 19, 2019
ed2d790
Merge remote-tracking branch 'origin/master' into charge_resolution
calispac Feb 19, 2019
fdbfdc6
fix --event_id option
calispac Feb 19, 2019
ccd0208
rm printout
calispac Feb 19, 2019
772032a
Merge remote-tracking branch 'origin/pipeline-simtel' into charge_res…
calispac Feb 25, 2019
ac9c4ae
use return instead of StopIteration for latter python versions
calispac Feb 25, 2019
406971b
baseline_filename is converted already to None
calispac Feb 25, 2019
106aef5
renamed variable
calispac Feb 25, 2019
188f450
commit simel calibration bash files
calispac Feb 25, 2019
3ceb6eb
squeez adc_samples array (avoid channel dimension)
calispac Feb 25, 2019
6bde21d
add gaussian fiting of raw histogram
calispac Feb 25, 2019
1b1ce27
bash script update
calispac Feb 25, 2019
ba333b9
bash script update
calispac Feb 25, 2019
cc11dab
cleanup
calispac Feb 25, 2019
050d3a0
add simple_waveform computation per pixel
calispac Feb 28, 2019
5f8d0d2
saving template to FITS table and testing
calispac Feb 28, 2019
a8b695f
type
calispac Feb 28, 2019
151a7c4
adding a test
calispac Feb 28, 2019
99ae994
typos
calispac Feb 28, 2019
7e8adf1
remove baseline before computation
calispac Feb 28, 2019
7064ee4
cleanup
calispac Feb 28, 2019
2a4aa8f
try to fix 'ImportError: dlopen: cannot load any more object with sta…
yrenier Apr 18, 2019
d0ab6c3
pep8
yrenier Apr 18, 2019
7084ee8
pep8
yrenier Apr 18, 2019
8120e9a
try to fix 'ImportError: dlopen: cannot load any more object with sta…
yrenier Apr 18, 2019
97f5c7b
test triggered from travis website execute all tests
yrenier Apr 18, 2019
6d22faf
try to fix 'ImportError: dlopen: cannot load any more object with sta…
yrenier Apr 18, 2019
b8207c6
try to fix 'ImportError: dlopen: cannot load any more object with sta…
yrenier Apr 18, 2019
35e19cd
update viewer to deal with tels_with_data beeing a set
calispac May 20, 2019
2b4c196
adding depedency for eventio
calispac May 20, 2019
adac496
add integral order into template
calispac May 20, 2019
6520d09
Merge remote-tracking branch 'origin/master' into charge_resolution
calispac May 20, 2019
b7d999e
add instrument info for simtel files
calispac May 20, 2019
f4bdc00
adding option to selected sub samples for waveform, extend bin edges …
davidsudm Aug 22, 2019
f4bbeb6
updating the simtel bash scripts
calispac Aug 26, 2019
5d93ea1
adding option to selected sub samples for waveform, extend bin edges …
davidsudm Aug 26, 2019
5b5a0cb
creating module for optical elements
calispac Aug 26, 2019
098fc4e
fixing bugs in event_stream
calispac Aug 26, 2019
536b76a
fixing bugs in simtel reader
calispac Aug 26, 2019
cb5e542
default mpe fitter
calispac Aug 26, 2019
a118869
Merge remote-tracking branch 'origin/pipeline-simtel' into pipeline-s…
davidsudm Aug 26, 2019
0570226
Merge remote-tracking branch 'origin/charge_resolution' into mts_anal…
davidsudm Aug 26, 2019
59bdb81
initialize_fit works now with customize bin_width
davidsudm Aug 26, 2019
e5554c6
update before repairing
davidsudm Sep 9, 2019
70ec001
update before repairing
davidsudm Oct 15, 2019
b9d762f
fix pixel list indexing that leads to trouble in the option --fit com…
davidsudm Oct 17, 2019
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ script:
- pytest digicampipe
- make -C docs/ html
- |
if [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then
if [ "${TRAVIS_EVENT_TYPE}" == "cron" ] || [ "${TRAVIS_EVENT_TYPE}" == "api" ]; then
travis_wait 30 pytest -c all_tests.ini digicampipe
fi
env:
Expand Down
83 changes: 83 additions & 0 deletions bash/0_main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/bin/env bash

source $HOME/.bashrc
$HOME/.miniconda3/bin/activate digicampipe

export MATPLOTLIBRC='../matplotlibrc'


### INPUT FILES ###

export DIGICAM_GHV_OFF_FILES=($(echo /sst1m/raw/2018/06/27/SST1M_01/SST1M_01_20180627_{1292..1299}.fits.fz))
export DIGICAM_GHV_ON_FILES=($(echo /sst1m/raw/2018/06/27/SST1M_01/SST1M_01_20180627_{1286..1292}.fits.fz))
export DIGICAM_DARK_FILES=($(echo /sst1m/raw/2018/06/27/SST1M_01/SST1M_01_20180627_{1276..1279}.fits.fz))
export DIGICAM_AC_FILES=($(echo /sst1m/raw/2018/06/28/SST1M_01/SST1M_01_20180628_{1350..1454}.fits.fz))
export DIGICAM_DC_FILES=($(echo /sst1m/raw/2018/06/28/SST1M_01/SST1M_01_20180628_{1455..1504}.fits.fz))
export DIGICAM_AC_DC_FILES_1=($(echo /sst1m/raw/2018/06/28/SST1M_01/SST1M_01_20180628_{1505..2087}.fits.fz))
export DIGICAM_AC_DC_FILES_2=($(echo /sst1m/raw/2018/07/01/SST1M_01/SST1M_01_20180701_{434..497}.fits.fz))


export DIGICAM_AC_LEVEL=({0..19..1} {20..35..5} {45..445..5})
export DIGICAM_AC_LEVEL_1=({0..18..2} {20..440..10})
export DIGICAM_AC_LEVEL_2=({0..18..2} {20..440..20})
export DIGICAM_DC_LEVEL=({200..445..5})
export DIGICAM_DC_LEVEL_1=({200..440..10})
export DIGICAM_DC_LEVEL_2=(${DIGICAM_DC_LEVEL_1[@]:12:2})
export DIGICAM_DC_LEVEL_1=(${DIGICAM_DC_LEVEL_1[@]:0:11})

PIXEL=$1

if [ -z "$PIXEL" ]; then
export DIGICAM_PIXELS=({0..1295..1})
else
export DIGICAM_PIXELS=($PIXEL)
fi


export DIGICAM_INTEGRAL_WIDTH=7
export DIGICAM_INTEGRAL_SHIFT=0
export DIGICAM_N_SAMPLES=50
export DIGICAM_GAIN_APPROX=20
export DIGICAM_LSB_MIN=-10
export DIGICAM_LSB_MAX=3000
export DIGICAM_LSB_BIN=1
export DIGICAM_SATURATION_THRESHOLD=3000

function tolist () {
local array="$@"
array=$(echo ${array[@]} | tr -s ' ' ',')
echo $array
}

export -p tolist
# echo ${DIGICAM_PIXELS[@]}
# a=$(tolist "${DIGICAM_PIXELS[@]}")

### OUTPUT FILES ###

# DATE=`date +%Y%m%d`
DATE=20190123
export DIGICAM_FOLDER='/sst1m/analyzed/calib/'$DATE'/'
mkdir -p $DIGICAM_FOLDER
mkdir -p $DIGICAM_FOLDER'figures/'

export GHV_OFF_RAW_HISTO=$DIGICAM_FOLDER'ghv_off_raw_histo.fits'
export GHV_OFF_RATE_SCAN=$DIGICAM_FOLDER'ghv_off_rate_scan.fits'
export GHV_ON_RAW_HISTO=$DIGICAM_FOLDER'ghv_on_raw_histo.fits'
export GHV_ON_RATE_SCAN=$DIGICAM_FOLDER'ghv_on_rate_scan_histo.fits'
export DARK_RAW_HISTO=$DIGICAM_FOLDER'dark_raw_histo.fits'
export DARK_RATE_SCAN=$DIGICAM_FOLDER'dark_rate_scan.fits'
export DARK_MAX_HISTO=$DIGICAM_FOLDER'dark_max_histo.fits'
export DARK_CHARGE_HISTO=$DIGICAM_FOLDER'dark_charge_histo.fits'
export SPE_RESULTS=$DIGICAM_FOLDER'spe_results.fits'
export TIMING_HISTO=$DIGICAM_FOLDER'timing_histo.fits'
export TIMING_RESULTS=$DIGICAM_FOLDER'timing_results.fits'
export FMPE_CHARGE_HISTO=$DIGICAM_FOLDER'fmpe_charge_histo.fits'
export FMPE_AMPLITUDE_HISTO=$DIGICAM_FOLDER'fmpe_amplitude_histo.fits'
export FMPE_RESULTS=$DIGICAM_FOLDER'fmpe_results.fits'
export MPE_CHARGE_HISTO=$DIGICAM_FOLDER'mpe_charge_histo.fits'
export MPE_RESULTS=$DIGICAM_FOLDER'mpe_results.fits'
export AC_LED_FILE=$DIGCAM_FOLDER'ac_led.fits'
export TEMPLATE_FILE=$DIGICAM_FOLDER'pulse_shape.fits'
export BASELINE_SHIFT_RESULTS=$DIGICAM_FOLDER'baseline_shift_results.fits'
export CALIBRATION_FILE=$DIGICAM_FOLDER'calibration_results.fits'
10 changes: 10 additions & 0 deletions bash/10_templates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

output_path=/sst1m/analyzed/template_scan/20180702
digicam_path=~/ctasoft/digicampipe
DATA_BASE_DIR=/sst1m/raw/2018/

source 0_main.sh

rm $TEMPLATE_FILE
digicam-pulse-template --output=$TEMPLATE_FILE --per_pixel ${DIGICAM_AC_FILES[@]:20:10}
12 changes: 12 additions & 0 deletions bash/1_raw_ghv_off.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/env bash
#SBATCH --time=01:00:00
#SBATCH --partition=mono
#SBATCH --mem=4G
#SBATCH --output=/home/%u/job_logs/%x-%A_%a.out
#SBATCH --job-name='ghv-off'

source 0_main.sh

digicam-raw compute --output=$GHV_OFF_RAW_HISTO ${DIGICAM_GHV_OFF_FILES[@]}
digicam-raw save_figure --output=$DIGICAM_FOLDER'figures/raw_ghv_off_histo.pdf' $GHV_OFF_RAW_HISTO
digicam-rate-scan --compute --output=$GHV_OFF_RATE_SCAN --threshold_step=1 ${DIGICAM_GHV_OFF_FILES[@]}
16 changes: 16 additions & 0 deletions bash/2_raw_ghv_on.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

#SBATCH --time=01:00:00
#SBATCH --partition=mono
#SBATCH --mem=4G
#SBATCH --output=/home/%u/job_logs/%x-%A_%a.out
#SBATCH --job-name='ghv-on'

source 0_main.sh


pixels=$(echo ${DIGICAM_PIXELS[@]} | tr -s ' ' ',')

digicam-raw compute --output=$GHV_ON_RAW_HISTO --pixel=$pixels ${DIGICAM_GHV_ON_FILES[@]}
digicam-rate-scan --compute --output=$GHV_ON_RATE_SCAN --threshold_step=1 ${DIGICAM_GHV_ON_FILES[@]}
digicam-raw save_figure --output=$DIGICAM_FOLDER'figures/raw_ghv_on_histo.pdf' $GHV_ON_RAW_HISTO
14 changes: 14 additions & 0 deletions bash/3_raw_dark.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
#SBATCH --time=06:00:00
#SBATCH --partition=mono
#SBATCH --mem=4G
#SBATCH --output=/home/%u/job_logs/%x-%A_%a.out
#SBATCH --job-name='dark'

source 0_main.sh

pixels=$(echo ${DIGICAM_PIXELS[@]} | tr -s ' ' ',')

digicam-raw compute --output=$DARK_RAW_HISTO --pixel=$pixels ${DIGICAM_DARK_FILES[@]}
digicam-rate-scan --compute --output=$DARK_RATE_SCAN --threshold_step=10 --threshold_end=100 ${DIGICAM_DARK_FILES[@]}
digicam-raw save_figure --output=$DIGICAM_FOLDER'figures/raw_histo.pdf' $DARK_RAW_HISTO
13 changes: 13 additions & 0 deletions bash/4_spe.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
#SBATCH --time=04:00:00
#SBATCH --partition=mono-shared
#SBATCH --mem=12G
#SBATCH --output=/home/%u/job_logs/%x-%A_%a.out
#SBATCH --job-name='spe'

source 0_main.sh

pixel=$(echo ${DIGICAM_PIXELS[@]} | tr -s ' ' ',')

digicam-spe --compute --pixel=$pixel --max_histo_filename=$DARK_MAX_HISTO --charge_histo_filename=$DARK_CHARGE_HISTO --raw_histo_filename=$DARK_RAW_HISTO --output=$CALIBRATION_FILE --integral_width=$DIGICAM_INTEGRAL_WIDTH --shift=$DIGICAM_INTEGRAL_SHIFT --n_samples=$DIGICAM_N_SAMPLES ${DIGICAM_DARK_FILES[@]}
digicam-spe --fit --pixel=$pixel --max_histo_filename=$DARK_MAX_HISTO --charge_histo_filename=$DARK_CHARGE_HISTO --raw_histo_filename=$DARK_RAW_HISTO --output=$CALIBRATION_FILE --integral_width=$DIGICAM_INTEGRAL_WIDTH --shift=$DIGICAM_INTEGRAL_SHIFT --n_samples=$DIGICAM_N_SAMPLES ${DIGICAM_DARK_FILES[@]}
15 changes: 15 additions & 0 deletions bash/5_timing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
#SBATCH --time=02:00:00
#SBATCH --partition=mono
#SBATCH --mem=4G
#SBATCH --output=/home/%u/job_logs/%x-%A_%a.out
#SBATCH --job-name='timing'

source 0_main.sh

pixels=$(tolist "${DIGICAM_PIXELS[@]}")
ac_levels=$(tolist "${DIGICAM_AC_LEVEL[@]}")

digicam-timing --compute --pixels=$pixels --output=$CALIBRATION_FILE --timing_histo_filename=$TIMING_HISTO --n_samples=$DIGICAM_N_SAMPLES --ac_levels=$ac_levels ${DIGICAM_AC_FILES[@]}
digicam-timing --fit --pixels=$pixels --output=$CALIBRATION_FILE --timing_histo_filename=$TIMING_HISTO --n_samples=$DIGICAM_N_SAMPLES --ac_levels=$ac_levels ${DIGICAM_AC_FILES[@]}
digicam-timing --display --output=$CALIBRATION_FILE --timing_histo_filename=$TIMING_HISTO --n_samples=$DIGICAM_N_SAMPLES --ac_levels=$ac_levels ${DIGICAM_AC_FILES[@]}
12 changes: 12 additions & 0 deletions bash/6_fmpe.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
#SBATCH --time=06:00:00
#SBATCH --partition=mono
#SBATCH --mem=8G
#SBATCH --output=/home/%u/job_logs/%x-%A_%a.out
#SBATCH --job-name='fmpe'

source 0_main.sh

digicam-fmpe --compute --charge_histo_filename=$FMPE_CHARGE_HISTO --amplitude_histo_filename=$FMPE_AMPLITUDE_HISTO --output=$CALIBRATION_FILE --pixels=$(tolist "${DIGICAM_PIXELS[@]}") --estimated_gain=$DIGICAM_GAIN_APPROX --n_samples=$DIGICAM_N_SAMPLES --shift=$DIGICAM_INTEGRAL_SHIFT --integral_width=$DIGICAM_INTEGRAL_WIDTH ${DIGICAM_AC_FILES[@]}
digicam-fmpe --fit --charge_histo_filename=$FMPE_CHARGE_HISTO --amplitude_histo_filename=$FMPE_AMPLITUDE_HISTO --output=$CALIBRATION_FILE --pixels=$(tolist "${DIGICAM_PIXELS[@]}") --estimated_gain=$DIGICAM_GAIN_APPROX --n_samples=$DIGICAM_N_SAMPLES --shift=$DIGICAM_INTEGRAL_SHIFT --integral_width=$DIGICAM_INTEGRAL_WIDTH ${DIGICAM_AC_FILES[@]}
digicam-fmpe --charge_histo_filename=$FMPE_CHARGE_HISTO --amplitude_histo_filename=$FMPE_AMPLITUDE_HISTO --output=$CALIBRATION_FILE --pixels=$(tolist "${DIGICAM_PIXELS[@]}") --figure_path=$DIGICAM_FOLDER'figures/fmpe.pdf' --estimated_gain=$DIGICAM_GAIN_APPROX --n_samples=$DIGICAM_N_SAMPLES --shift=$DIGICAM_INTEGRAL_SHIFT --integral_width=$DIGICAM_INTEGRAL_WIDTH ${DIGICAM_AC_FILES[@]}
31 changes: 31 additions & 0 deletions bash/7_mpe.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
#SBATCH --time=06:00:00
#SBATCH --partition=mono-shared
#SBATCH --mem=4G
#SBATCH --output=/home/%u/job_logs/%x-%A_%a.out
#SBATCH --job-name='mpe'

source 0_main.sh ${SLURM_ARRAY_TASK_ID} $1 $2


DIGICAM_INTEGRAL_WIDTH=$1
DIGICAM_INTEGRAL_SHIFT=$2

PIXEL=${DIGICAM_PIXELS[0]}
output=$(printf $DIGICAM_FOLDER'calibration_results_window_%03d_shift_%03d_pixel_%04d.fits' $DIGICAM_INTEGRAL_WIDTH $DIGICAM_INTEGRAL_SHIFT $PIXEL)
figure_path=$(printf $DIGICAM_FOLDER'figures/mpe_fit_window_%03d_shift_%03d_pixel_%04d.fits' $DIGICAM_INTEGRAL_WIDTH $DIGICAM_INTEGRAL_SHIFT $PIXEL)


exit
if [[ -z "${SLURM_ARRAY_TASK_ID}" ]];
then
digicam-mpe compute --output=$MPE_CHARGE_HISTO --ac_levels=$(tolist "${DIGICAM_AC_LEVEL[@]}") --calib=$CALIBRATION_FILE --shift=$DIGICAM_INTEGRAL_SHIFT --integral_width=$DIGICAM_INTEGRAL_WIDTH --adc_min=$DIGICAM_LSB_MIN --adc_max=$DIGICAM_LSB_MAX --pixel=$(tolist "${DIGICAM_PIXELS[@]}") ${DIGICAM_AC_FILES[@]}
# digicam-mpe fit summed --output=$CALIBRATION_FILE --ac_levels=$(tolist "${DIGICAM_AC_LEVEL[@]}") --pixel=$(tolist "${DIGICAM_PIXELS[@]}") $MPE_CHARGE_HISTO
# digicam-mpe fit combined --output=$CALIBRATION_FILE --ac_levels=$(tolist "${DIGICAM_AC_LEVEL[@]}") --pixel=$(tolist "${DIGICAM_PIXELS[@]}") $MPE_CHARGE_HISTO
# digicam-mpe fit single --output=$CALIBRATION_FILE --ac_levels=$(tolist "${DIGICAM_AC_LEVEL[@]}") --pixel=$(tolist "${DIGICAM_PIXELS[@]}") $MPE_CHARGE_HISTO
else

digicam-mpe fit combined --output=$output --ac_levels=$(tolist "${DIGICAM_AC_LEVEL[@]}") --pixel=$PIXEL $MPE_CHARGE_HISTO
#digicam-mpe save_figure --output=$figure_path --calib=$output --ac_levels=$(tolist "${DIGICAM_AC_LEVEL[@]}") $MPE_CHARGE_HISTO
fi
# digicam-mpe --display --compute_output=$MPE_CHARGE_HISTO --fit_output=$MPE_RESULTS --shift=$DIGICAM_INTEGRAL_SHIFT --integral_width=$DIGICAM_INTEGRAL_WIDTH --timing=$TIMING_RESULTS --gain=$FMPE_RESULTS --adc_min=$DIGICAM_LSB_MIN --adc_max=$DIGICAM_LSB_MAX --pixel=$(tolist "${DIGICAM_PIXELS[@]}") --ac_levels=$(tolist "${DIGICAM_AC_LEVEL[@]}") ${DIGICAM_AC_FILES[@]}
68 changes: 68 additions & 0 deletions bash/8_baseline_shift.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env bash
#SBATCH --time=04:00:00
#SBATCH --partition=mono
#SBATCH --mem=8G
#SBATCH --output=/home/%u/job_logs/%x-%A_%a.out
#SBATCH --job-name='baseline-shift'

source 0_main.sh



i=0

histo_files=()

for file in "${DIGICAM_DC_FILES[@]}"
do
output=$DIGICAM_FOLDER'histo_dc_level_'${DIGICAM_DC_LEVEL[$i]}'.fits'
histo_files+=($output)
# echo digicam-raw --compute --output=$output $file
i=$((i + 1))
done
# digicam-baseline-shift --compute --output=$BASELINE_SHIFT_RESULTS --integral_width=$DIGICAM_INTEGRAL_WIDTH --dark=${histo_files[0]} --dc_levels=$(tolist "${DIGICAM_DC_LEVEL[@]}") ${histo_files[@]}
# digicam-baseline-shift --fit --output=$BASELINE_SHIFT_RESULTS --integral_width=$DIGICAM_INTEGRAL_WIDTH --template=$TEMPLATE_FILE --gain=$FMPE_RESULTS --dark=${histo_files[0]} --dc_levels=$(tolist "${DIGICAM_DC_LEVEL[@]}") ${histo_files[@]}
# digicam-baseline-shift --display --output=$BASELINE_SHIFT_RESULTS --integral_width=$DIGICAM_INTEGRAL_WIDTH --template=$TEMPLATE_FILE --gain=$FMPE_RESULTS --dark=${histo_files[0]} --dc_levels=$(tolist "${DIGICAM_DC_LEVEL[@]}") ${histo_files[@]}


i=0
k=0
N_AC=${#DIGICAM_AC_LEVEL_1[@]}
histo_files=()
for file in "${DIGICAM_AC_DC_FILES_1[@]}"
do
j=$(($i % $N_AC))

if [[ "$j" -eq "0" ]]; then

output=$DIGICAM_FOLDER'histo_dc_level_'${DIGICAM_DC_LEVEL_1[$k]}'_from_acdc_scan.fits'
histo_files+=($output)
# echo digicam-raw --compute --output=$output $file
k=$(($k + 1))
fi

i=$((i + 1))
done

i=0
k=0
N_AC=${#DIGICAM_AC_LEVEL_2[@]}
for file in "${DIGICAM_AC_DC_FILES_2[@]}"
do
j=$(($i % $N_AC))

if [[ "$j" -eq "0" ]]; then

output=$DIGICAM_FOLDER'histo_dc_level_'${DIGICAM_DC_LEVEL_2[$k]}'_from_acdc_scan.fits'
histo_files+=($output)
digicam-raw --compute --output=$output $file
k=$(($k + 1))
fi

i=$((i + 1))
done

dc_levels=("${DIGICAM_DC_LEVEL_1[@]}" "${DIGICAM_DC_LEVEL_2[@]}")
digicam-baseline-shift --compute --output=$DIGICAM_FOLDER'baseline_shift_acdc_scan.fits' --integral_width=$DIGICAM_INTEGRAL_WIDTH --dark=${histo_files[0]} --dc_levels=$(tolist "${dc_levels[@]}") ${histo_files[@]}
# digicam-baseline-shift --fit --output=$DIGICAM_FOLDER'baseline_shift_acdc_scan.fits' --integral_width=$DIGICAM_INTEGRAL_WIDTH --template=$TEMPLATE_FILE --gain=$FMPE_RESULTS --dark=${histo_files[0]} --dc_levels=$(tolist "${DIGICAM_DC_LEVEL_1[@]}") ${histo_files[@]}
# digicam-baseline-shift --display --output=$DIGICAM_FOLDER'baseline_shift_acdc_scan.fits' --integral_width=$DIGICAM_INTEGRAL_WIDTH --template=$TEMPLATE_FILE --gain=$FMPE_RESULTS --dark=${histo_files[0]} --dc_levels=$(tolist "${DIGICAM_DC_LEVEL_1[@]}") ${histo_files[@]}
23 changes: 23 additions & 0 deletions bash/baobab_submit_calibration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/env bash

# sbatch 1_raw_ghv_off.sh
# sbatch 2_raw_ghv_on.sh
# sbatch 3_raw_dark.sh
# sbatch 4_spe.sh
# job1=$(sbatch --parsable 5_timing.sh);

# job3=$(sbatch --parsable 7_mpe.sh);
# sbatch --dependency=afterok:${job3} --array=0-1295 7_mpe.sh
# sbatch --array=558 7_mpe.sh

for width in {1..20};
do
for shift in {-4..4};
do

sbatch 9_charge_linearity.sh $width $shift
done
done

# sbatch --dependency=afterany:${job2} 7_mpe.sh
# sbatch 8_baseline_shift.sh
Loading