VERITAS-Observatory / V2DL3

VERITAS (VEGAS and Eventdisplay) to DL3 Converter
BSD 3-Clause "New" or "Revised" License
8 stars 1 forks source link

Add helper function for reading epoch and effarea #211

Closed tobiaskleiner closed 3 months ago

tobiaskleiner commented 3 months ago

Adding a small function to read out epoch and effective area from the anasum.root files using uproot. This avoids using the printAnasumRunParameter in the V2DL3 run script for containerized use with HTCondor.

GernotMaier commented 3 months ago

Could you change also the integration test (after lines https://github.com/VERITAS-Observatory/V2DL3/blob/6d232b683989978cec1ef32d5a9d974cc582c196/.github/workflows/v2dl3-eventdisplay.yml#L52 ) to run without the effective area on the command line.

Does this actually work with the changes you have applied?

e.g.,

python pyV2DL3/script/v2dl3_for_Eventdisplay.py \
               -f ./64080.anasum.root \
                  --logfile test-pointlike.fits.log \
                  test-pointlike-CI.fits.gz|

Meaning only one argument for -f?

GernotMaier commented 3 months ago

What is going wrong?

V2DL3="../../V2DL3/"
ANASUMFILE="/lustre/fs24/group/veritas/shared/processed_data_v490.7//AP/anasum_moderate2tel/6//64554.anasum.root"
RUN=64554

result=$(python -c "from ${V2DL3}/utils/query_anasum_runparameters import get_epoch_effective_area; get_epoch_effective_area(${ANASUMFILE}, ${RUN})")
EPOCH=$(echo $result | cut -d',' -f1)
EFFAREA=$(echo $result | cut -d',' -f2)

gives me

%./dl3_test.sh
  File "<string>", line 1
    from ../../V2DL3//utils/query_anasum_runparameters import get_epoch_effective_area; get_epoch_effective_area(/lustre/fs24/group/veritas/shared/processed_data_v490.7//AP/anasum_moderate2tel/6//64554.anasum.root, 64554)
                                                                                                                                                                                                         ^
SyntaxError: invalid decimal literal