sergiohcdna / ctadmtool

Analysis scripts for DM cluster searches
Other
1 stars 3 forks source link

Missing .fits file in notebooks folder #6

Closed lpin0002 closed 3 years ago

lpin0002 commented 3 years ago

Hey there, I was just working through the notebooks folder and the get_dmulimits.ipynb is requiring a fits file that isn't generated in the notebooks folder and I can't find it anywhere else. It's called "dmspectrum.fits" and the script itself throws the error,

RuntimeError: *** ERROR in GFits::open(GFilename&, bool&): Unable to open FITS file "dmspectrum.fits" (status=104)

Thanks for any help in advance.

sergiohcdna commented 3 years ago

Hi!

Yeah, I thought I updated the instructions to run the notebook. I am going to update the instructions. You can create the fits file using the script create_dmtable.py under the examples folder.

To check all the options you can use $ python create_dmtable.py --help

To create the spectrum file used for the TCAP DM session you can use:

$ python create_dmtable.py --srcname AquariusII --jfactor 1.8621e+18 --sigmav 3.0e-26 --z 0 --mpoints 100 --emin 30.0 --nebins 450

Let me know if this work for you!

lpin0002 commented 3 years ago

Hey there!

Thanks for that! So I tried creating my own spectral table file for a few different sources, however now I get another error.

ValueError: *** ERROR in GOptimizerPar::factor_value(double&): Invalid argument. Specified value factor 1.875 is larger than the maximum boundary 1.125.

This seems more like an error in how it's implementing gammalib, not your repository, but the documentation for it is attrocious. So any help here would be appreciated.

Thanks!

kjrule commented 3 years ago

Hi!

Yeah, I thought I updated the instructions to run the notebook. I am going to update the instructions. You can create the fits file using the script create_dmtable.py under the examples folder.

To check all the options you can use $ python create_dmtable.py --help

To create the spectrum file used for the TCAP DM session you can use:

$ python create_dmtable.py --srcname AquariusII --jfactor 1.8621e+18 --sigmav 3.0e-26 --z 0 --mpoints 100 --emin 30.0 --nebins 450

Let me know if this work for you!

Hi,

I'm following along with this issue and got a seperate error to the user above after creating the .fits file using create)dmtable.py .

ERROR in GObservation::npred(GModel&): Gradient vector size 1 mismatches number 0 of model parameters.

I can't find any relevant gammalib documentation on this error. Any help on how to resolve this would be much appreciated.

Kind regards

phesh commented 3 years ago

Hi,

@lpin0002 I also got a similar error: dmspec['Channel'].value(channel) ValueError: *** ERROR in GOptimizerPar::factor_value(double&): Invalid argument. Specified value factor 1.375 is larger than the maximum boundary 1.125.

This error was related to the "channel" and "dch" parameter in the example script. In the example script the channel is set to "11", but the default create_dmtable.py is set with EW0, and there is only up to channel "9" without EW correction. And dch is only valid if it is "b|Mu|Tau|t|W|Z", I got it to work with
channel=5 # Mu dch = "Mu"

@kjrule Did you get the error during "create_dmtable.py"?

EDIT: I see we are working with different notebooks, but the error might be related. Try with channel = "Mu"

sergiohcdna commented 3 years ago

Hey there!

Thanks for that! So I tried creating my own spectral table file for a few different sources, however now I get another error.

ValueError: *** ERROR in GOptimizerPar::factor_value(double&): Invalid argument. Specified value factor 1.875 is larger than the maximum boundary 1.125.

This seems more like an error in how it's implementing gammalib, not your repository, but the documentation for it is attrocious. So any help here would be appreciated.

Thanks!

Hi there!

Can you upload the exact command you are using? Just to check what is the parameter involved in this error. I think the solution is simple, just to change the parameter range

sergiohcdna commented 3 years ago

Hi,

@lpin0002 I also got a similar error: dmspec['Channel'].value(channel) ValueError: *** ERROR in GOptimizerPar::factor_value(double&): Invalid argument. Specified value factor 1.375 is larger than the maximum boundary 1.125.

This error was related to the "channel" and "dch" parameter in the example script. In the example script the channel is set to "11", but the default create_dmtable.py is set with EW0, and there is only up to channel "9" without EW correction. And dch is only valid if it is "b|Mu|Tau|t|W|Z", I got it to work with channel=5 # Mu dch = "Mu"

@kjrule Did you get the error during "create_dmtable.py"?

EDIT: I see we are working with different notebooks, but the error might be related. Try with channel = "Mu"

Hi @phesh

Thanks for your help. As you said, the error can be solved changing the parameter ranges. Use parameter_name.range(min_value, max_value) for example.

lpin0002 commented 3 years ago

Hey there,

I did try different channels, and for Mu it doesn't show errors, but my python kernel dies whenever I run it. It's probably an issue with my installation as I'm pretty new to Linux. So I'll consider the issue with ctaAnalysis fixed for now.

Thanks for all the help. And I'll close this issue for now and hopefully it works out when I reinstall Linux.