gammasim / simtools

Tools and applications for the Simulation System of the CTA Observatory.
https://gammasim.github.io/simtools
BSD 3-Clause "New" or "Revised" License
10 stars 1 forks source link

Testing compare_cumulative_psf.py #82

Closed GernotMaier closed 3 years ago

GernotMaier commented 4 years ago

Using the example on https://gammasim.github.io/gammasim-tools/applications.html#module-compare_cumulative_psf , I run in the following problem:

python applications/compare_cumulative_psf.py --tel_name North-LST-1 --model_version prod4 --pars lst_pars.yml --data PSFcurve_data_v2.txt

INFO::db_handler(l508)::_getSiteParametersYaml::Reading DB file /workdir/external/simulation-model-description/configReports/parValues-Sites.yml
INFO::ray_tracing(l188)::simulate::Simulating RayTracing for offAxis=0.0, mirror=0
INFO::telescope_model(l396)::exportConfigFile::Writing config file - /workdir/external/output/simtools-files/compare_cumulative_psf/model/CTA-prod4-North-LST-1_compare_cumulative_psf.cfg
INFO::simtel_runner(l169)::run::Running (20x) with command:/workdir/sim_telarray/sim_telarray/bin/sim_telarray -c /workdir/external/output/simtools-files/compare_cumulative_psf/model/CTA-prod4-North-LST-1_compare_cumulative_psf.cfg -I../cfg/CTA -C IMAGING_LIST=/workdir/external/output/simtools-files/compare_cumulative_psf/ray-tracing/photons-North-LST-1-d10.0-za20.0-off0.000_compare_cumulative_psf.lis -C stars=/workdir/external/output/simtools-files/compare_cumulative_psf/ray-tracing/stars-North-LST-1-d10.0-za20.0-off0.000_compare_cumulative_psf.lis -C altitude=2147. -C telescope_theta=20.0 -C star_photons=10000 -C telescope_phi=0 -C camera_transmission=1.0 -C nightsky_background=all:0. -C trigger_current_limit=1e10 -C telescope_random_angle=0 -C telescope_random_error=0 -C convergent_depth=0 -C maximum_telescopes=1 -C show=all -C camera_filter=none /workdir/sim_telarray/run9991.corsika.gz 2>&1 > /workdir/external/output/simtools-files/compare_cumulative_psf/ray-tracing/log-North-LST-1-d10.0-za20.0-off0.000_compare_cumulative_psf.log 2>&1
INFO::psf_analysis(l93)::readSimtelFile::Reading SimtelFile /workdir/external/output/simtools-files/compare_cumulative_psf/ray-tracing/photons-North-LST-1-d10.0-za20.0-off0.000_compare_cumulative_psf.lis
INFO::ray_tracing(l341)::exportResults::Exporting results to /workdir/external/output/simtools-files/compare_cumulative_psf/ray-tracing/results/ray-tracing-North-LST-1-d10.0-za20.0_compare_cumulative_psf.cvs
d80 in cm = 3.4536989970304424
Traceback (most recent call last):
  File "applications/compare_cumulative_psf.py", line 205, in <module>
    dataToPlot['measured'] = loadData(dataFile)
  File "applications/compare_cumulative_psf.py", line 98, in loadData
    data = np.loadtxt(datafile, dtype=dType, usecols=(0, 2))
  File "/root/miniconda3/envs/gammasim-tools-dev/lib/python3.8/site-packages/numpy/lib/npyio.py", line 1139, in loadtxt
    for x in read_data(_loadtxt_chunksize):
  File "/root/miniconda3/envs/gammasim-tools-dev/lib/python3.8/site-packages/numpy/lib/npyio.py", line 1067, in read_data
    items = [conv(val) for (conv, val) in zip(converters, vals)]
  File "/root/miniconda3/envs/gammasim-tools-dev/lib/python3.8/site-packages/numpy/lib/npyio.py", line 1067, in <listcomp>
    items = [conv(val) for (conv, val) in zip(converters, vals)]
  File "/root/miniconda3/envs/gammasim-tools-dev/lib/python3.8/site-packages/numpy/lib/npyio.py", line 763, in floatconv
    return float(x)
ValueError: could not convert string to float: 'PSF'
(gammasim-tools-dev) [root@009f5c1daf7b gammasim-tools]#
(gammasim-tools-dev) [root@009f5c1daf7b gammasim-tools]# cat lst_pars.yml
mirror_reflection_random_angle: '0.0075,0.15,0.035'
mirror_align_random_horizontal: '0.0040,28.,0.0,0.0'
mirror_align_random_vertical: '0.0040,28.,0.0,0.0'

log-North-LST-1-d10.0-za20.0-off0.000_compare_cumulative_psf.log.gz

GernotMaier commented 4 years ago

Do I have an older version of PSFcurve_data_v2.txt ?

There is no commenting at the top, it looks like:

cat ./verification-process/dataFromInstrumentTeams/LST/optics/psf_LST_1/PSFcurve_data_v2.txt
PSF taken at Zd = ~20[deg], with Vega
radial distance [mm] differential_value integral_value
0.0     0.0     0.0
1.1601550664045037  100531.63333333333  100531.63333333333
2.3203101328090074  543254.5333333333   643786.1666666666
3.480465199213511   644307.5999999997   1288093.7666666664
4.640620265618015   966457.2499999988   2254551.016666665
5.800775332022519   1035933.4166666674  3290484.4333333327
orelgueta commented 3 years ago

I get the same error and my PSFcurve_data_v2.txt file also has no comments on the top. I guess @RaulRPrado you commented those lines in your local directory and didn't update GitLab?

RaulRPrado commented 3 years ago

I get the same error and my PSFcurve_data_v2.txt file also has no comments on the top. I guess @RaulRPrado you commented those lines in your local directory and didn't update GitLab?

Yes, that is right. I just updated the gitlab version and the problem is gone.