fermi-lat / Likelihood

BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Error while running gtexpcube2 #30

Closed okargaltsev closed 5 years ago

okargaltsev commented 5 years ago

Hello,

(fermi) Osly:J1016_Fermi_Jan13 okargaltsev$ conda list fermitools

packages in environment at /anaconda3/envs/fermi:

#

Name Version Build Channel

fermitools 1.0.0 py27h5b5c8cd_0 fermi fermitools-data 0.13 0 fermi fermitools-test-scripts 1.0 0 fermi fermitools-test-scripts-data 0.1 0 fermi

(fermi) Osly:J1016_Fermi_Jan13 okargaltsev$ uname -a Darwin Osly.local 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct 5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64

(fermi) Osly:J1016_Fermi_Jan13 okargaltsev$ echo $FERMI_DIR /anaconda3/envs/fermi/share/fermitools

I am have installed Fermi Science Tools using conda and I am trying to follow Binned Likelihood Tutorial from https://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/binned_likelihood_tutorial.html

I was able to get to

(fermi) Osly:J1016_Fermi_Jan13 okargaltsev$ gtexpcube2

WARNING: version mismatch between CFITSIO header (v3.43) and linked library (v3.41).

Livetime cube file[] j1016_ltcube.fits Counts map file[] Output file name[] j1016_allsky_expcube.fits Response functions to use[CALDB] P8R3_SOURCE_V2 Caught N3tip12TipExceptionE at the top level: File not found:

It does not work with CALDB too. I do not understand why it cannot find the IRFs. I can see them in

(fermi) Osly:J1016_Fermi_Jan13 okargaltsev$ ls /anaconda3/envs/fermi/share/fermitools/data/caldb/data/glast/lat/bcf/ ea irf_index.fits valid_evclass_selections.txt edisp psf valid_evtype_selections.txt

I checked the edisp directory and it does contain files with P8R3_SOURCE_V2 in their names.

Thank you,

Oleg

jasercion commented 5 years ago

Hi Oleg,

Do you still get the same error when you input the string none for the counts map file?

okargaltsev commented 5 years ago

Thank you! Yes, it worked. I somehow assumed that empty value means that the default is "none" but this is not the case apparently. Couple more things I noticed when I was doing this tutorial. One is that the tutorial recommends using make3FGLxml.py script. However, the one I downloaded from contributed scripts webpage on the Fermi website did not work. Firstly, it gave this error

Osly:J1016_Fermi_Jan13 okargaltsev$ ./make3FGLxml.py gll_psc_v16.fit j1016_region_filtered_gtfilt.fits -o j1016_input_model.xml -G $FERMI_DIR/refdata/fermi/galdiffuse/gll_iem_v06.fits -g gll_iem_v06 -i iso_P8R3_SOURCE_V2 -s 120 -p TRUE -v TRUE

env: python\r: No such file or directory

which I fixed by applying

dos2unix make3FGLxml.py

Then it gave another error:

./make3FGLxml.py:507: RuntimeWarning: divide by zero encountered in float_scalars f*=exp((p/c)**ei) Traceback (most recent call last): File "./make3FGLxml.py", line 732, in if name=='main': cli() File "./make3FGLxml.py", line 729, in cli sL.makeModel(args.galfile,args.galname,args.isofile,args.isoname,args.normsonly,args.extDir,args.radLim,args.maxRad,args.ExtraRad,args.sigFree,args.varFree,args.psForce,args.makeRegion,args.GIndexFree,args.edisp,args.writeDir,args.oldNames) File "./make3FGLxml.py", line 73, in makeModel addSrcsFITS(self,GDfile,GDname,ISOfile,ISOname,oldNames) File "./make3FGLxml.py", line 319, in addSrcsFITS spec,free=COspec(sL,f,i,p,c,ei,dist,TS,vi) File "./make3FGLxml.py", line 508, in COspec fscale=int(floor(log10(f))) OverflowError: cannot convert float infinity to integer

To fix it I had to go into the code and in f*=exp((p/c)**ei) change / to // .

Finally, before doing my source I ran the ST-AGN-thread-test-Binned test and had multiple errors with this message in the .log file:

dyld: Library not loaded: @rpath/libssl.1.0.0.dylib Referenced from: /anaconda3/envs/fermi/lib/root/libNet.5.so

It took me quite a while to find the solution which does exist under Fermi-Tools-conda "Tools depend on older version of openssl library" but not easy to find. Perhaps it should be mentioned in the tutorials on the Fermi website. I will post more here if I encounter any other issues in the Binned Likelihood tutorial.

okargaltsev commented 5 years ago

There may be another issue with which I used to produce the xml input model file. I am getting the following warning and error from the gtsrcmaps tool:

(fermi) Osly:J1016_Fermi_Jan13 okargaltsev$ gtsrcmaps

WARNING: version mismatch between CFITSIO header (v3.43) and linked library (v3.41).

Exposure hypercube file[3C279_binned_ltcube.fits] j1016_ltcube.fits Counts map file[3C279_binned_ccube.fits] j1016_region_filtered_ccube.fits Source model file[/anaconda3/envs/fermi/share/fermitools/data/test-scripts/3C279-binned-input-model.xml] j1016_input_model.xml Binned exposure map[3C279_binned_allsky_expcube.fits] j1016_allsky_expcube.fits Source maps output file[3C279_binned_srcmaps.fits] j1016_binned_srcmaps.fits Response functions[CALDB] difference in gti interval found

WARNING: AppHelpers::checkTimeCuts: Time range cuts and GTI extensions in files j1016_region_filtered_ccube.fitsand j1016_ltcube.fits[Exposure] do not agree. Aggregate absolute differences in GTI start times (s): 8.27546e+11 Aggregate absolute differences in GTI stop times (s): 8.27357e+11

Parameter::extractDomData: In the XML description of parameter Cutoff, An attempt has been made to set the parameter value outside of the specified bounds. Caught St12out_of_range at the top level: Parameter::extractDomData: In the XML description of parameter Cutoff, An attempt has been made to set the parameter value outside of the specified bounds.

Indeed when I look into the xml input model file I see lines like:

parameter free="0" max="1e5" min="1e1" name="Cutoff" scale="1.0" value="-inf" parameter free="0" max="5" min="0" name="Index2" scale="1.0" value="-inf"

where the value seems to be outside of the allowed range. Any suggestions? Also, should I be worried about the warning about Time range cuts and GTI extensions not agreeing between the ccube and ltcube files?

Thank you!

nmirabal commented 5 years ago

This is most likely related to the settings "value=-inf". Not sure why is showing up there. Try changing to 1000.0 and 1.0 respectively.

nmirabal commented 5 years ago

Actually since this sounds like an XML for "PLSuperExpCutoff2" so parameter free="0" max="5" min="0" name="Index2" scale="1.0" value="0.666667"

donhorner commented 5 years ago

@okargaltsev was this issue resolved for you? I'd like to close it, if so.

jasercion commented 5 years ago

Closing issue. @okargaltsev please reopen if the problems persist.