-
Notifications
You must be signed in to change notification settings - Fork 77
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
Error running lstchain_mc_sensitivity.py script #299
Comments
Hi @andres-baquero, the minimum energy ( |
Hi @rlopezcoto. I'm using a dl1 file of gamma point merged with all runs produced from: |
Those are DL0 according to the directory, right? |
Yes. I'm using DL1 files for protons and gammas that have been produced from this DL0 files. |
Can you give me the exact command you are using (with all the input files) so I can try to reproduce the error? |
Thanks @rlopezcoto for your help. I'm using this:
|
Did that ever work? Seems to me the values mc_par_g['emin'] are those directly read from the hdf5 file, so they have no associated units. Hence we should do mc_par_g['emin']*u.TeV (if the number stored in the file is in TeV), and then do the conversion to GeV. |
Hi @moralejo yes that was the problem in this case. |
Hi @andres-baquero Thanks. |
Hi @vuillaut . Ok I will make the PR. Just one question @rlopezcoto the script receive 4 DL2 files:
Which is the difference between this DL2 files ?. |
Hi @andres-baquero ,
But with DL1 file which I generated by using the latest lstchain, mc_par_g['emin'] has TeV unit.
|
Actually I am puzzled with the bug here. As pointed by @SeiyaNozaki, the issue here could be that the files were generated with an older version of lstchain where units were not applied (but in this case I would have expected the reading to fail - so before the attempted conversion). As @moralejo also asked for it, we'll reduce the MC production with the latest release. |
So @vuillaut the PR is still needed ?. |
If I am correct, actually not. |
Hi @andres-baquero |
Sorry for arriving so late at the discussion. |
Fixed in #299 |
I'm using lstchain v0.4.4 and I've installed ctaplot.
I'm getting this error running lstchain_mc_sensitivity.py:
`AttributeErrorTraceback (most recent call last)
in
6 n_bins_energy, n_bins_gammaness,
7 n_bins_theta2, noff,
----> 8 obstime)
/fefs/home/andres.baquero/lstchain-dev/lstchain_v044/cta-lstchain/lstchain/mc/sensitivity.py in find_best_cuts_sensitivity(simtelfile_gammas, simtelfile_protons, dl2_file_g, dl2_file_p, nfiles_gammas, nfiles_protons, n_bins_energy, n_bins_gammaness, n_bins_theta2, noff, obstime)
332
333 # Pass units to GeV and cm2
--> 334 mc_par_g['emin'] = mc_par_g['emin'].to(u.GeV)
335 mc_par_g['emax'] = mc_par_g['emax'].to(u.GeV)
336
AttributeError: 'numpy.float64' object has no attribute 'to'
`
Thanks for your help
The text was updated successfully, but these errors were encountered: