Closed cbrisboi closed 4 years ago
Starting from commit 862df321d4353c2affed5b0fbcba6b517fec5617
I addressed each error encountered in the master branch for hawc_hal
and put it in this branch.
https://github.com/cbrisboi/hawc_hal/tree/py3_back_to_future
This does not solve everything, but it does minimally solve the issue for this environment and minimal_fail.py
. I will now switch to testing on the script provided on the hawc public page to examine the remaining things not updated a bit more widely. I was inspired to this approach by @ndilalla's statement that
I tried to check out the HAL master before the merge of the py3 pull request and I am able to reproduce the correct results (with the last version of threeML and astromodels). So this confirms us it is something we introduced with the last pull request
My assumption/hope is that by carefully updating errors as they are encountered we can overcome/identify where problems were introduced.
This is the output of minimal_fail.py
on this branch
/Users/chad/miniconda3/envs/hal_test/lib/python3.7/site-packages/astromodels/core/parameter.py:555: UserWarning: We have set the min_value of xc to 1e-99 because there was a postive transform
warnings.warn('We have set the min_value of %s to 1e-99 because there was a postive transform' % self.path)
WARNING UserWarning: Using default configuration from /Users/chad/miniconda3/envs/hal_test/lib/python3.7/site-packages/threeML/data/threeML_config.yml. You might want to copy it to /Users/chad/.threeML/threeML_config.yml to customize it and avoid this warning.
WARNING RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
WARNING RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
WARNING RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
WARNING RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
WARNING RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
WARNING RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
WARNING RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
WARNING RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
WARNING RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
WARNING RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
WARNING RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
WARNING RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
Creating singleton for /Users/chad/science/hal_tests/HAWC_9bin_507days_crab_response.hd5
WARNING UserWarning: We have set the min_value of crab.spectrum.main.Powerlaw.K to 1e-99 because there was a postive transform
WARNING RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
trial values: -23,-2.5 -> logL = -23541.653
trial values: -22.951,-2.5 -> logL = -23453.068
trial values: -23.049,-2.5 -> logL = -23623.529
trial values: -22.995,-2.5 -> logL = -23533.102
trial values: -23.005,-2.5 -> logL = -23550.137
trial values: -23,-2.4947 -> logL = -23539.912
trial values: -23,-2.5053 -> logL = -23543.351
trial values: -23,-2.4973 -> logL = -23540.757
trial values: -23,-2.5027 -> logL = -23542.537
trial values: -22.995,-2.5 -> logL = -23533.102
trial values: -22.976,-2.5 -> logL = -23498.220
trial values: -22.927,-2.5 -> logL = -23406.155
trial values: -22.783,-2.5 -> logL = -23085.517
trial values: -22.364,-2.5 -> logL = -21676.379
trial values: -21.235,-2.5 -> logL = -25312.888
trial values: -21.774,-2.5 -> logL = -18997.740
trial values: -21.236,-2.5 -> logL = -25304.889
trial values: -21.499,-2.5 -> logL = -19436.746
trial values: -21.773,-2.5 -> logL = -18993.470
trial values: -21.776,-2.5 -> logL = -19002.054
trial values: -21.774,-2.5 -> logL = -18995.816
trial values: -21.775,-2.5 -> logL = -18999.673
trial values: -21.774,-2.4975 -> logL = -18999.332
trial values: -21.774,-2.5025 -> logL = -18996.161
trial values: -21.629,-2.7871 -> logL = -19213.789
trial values: -21.721,-2.6081 -> logL = -18833.180
trial values: -21.72,-2.6081 -> logL = -18832.284
trial values: -21.721,-2.6081 -> logL = -18834.091
trial values: -21.721,-2.6062 -> logL = -18833.452
trial values: -21.721,-2.6101 -> logL = -18832.933
trial values: -21.721,-2.6069 -> logL = -18833.344
trial values: -21.721,-2.6094 -> logL = -18833.025
trial values: -21.662,-2.6025 -> logL = -18808.553
trial values: -21.677,-2.604 -> logL = -18804.106
trial values: -21.677,-2.604 -> logL = -18804.124
trial values: -21.678,-2.604 -> logL = -18804.100
trial values: -21.677,-2.6028 -> logL = -18803.980
trial values: -21.677,-2.6053 -> logL = -18804.245
trial values: -21.672,-2.5737 -> logL = -18804.071
trial values: -21.675,-2.5887 -> logL = -18803.305
trial values: -21.674,-2.5887 -> logL = -18803.312
trial values: -21.675,-2.5887 -> logL = -18803.306
trial values: -21.675,-2.5877 -> logL = -18803.308
trial values: -21.675,-2.5898 -> logL = -18803.310
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5888 -> logL = -18803.309
trial values: -21.676,-2.5888 -> logL = -18803.309
trial values: -21.675,-2.5877 -> logL = -18803.309
trial values: -21.675,-2.5898 -> logL = -18803.309
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5888 -> logL = -18803.309
trial values: -21.676,-2.5888 -> logL = -18803.309
trial values: -21.675,-2.5877 -> logL = -18803.309
trial values: -21.675,-2.5898 -> logL = -18803.309
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5886 -> logL = -18803.304
trial values: -21.675,-2.589 -> logL = -18803.304
trial values: -21.675,-2.5877 -> logL = -18803.310
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5886 -> logL = -18803.304
trial values: -21.675,-2.589 -> logL = -18803.304
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5887 -> logL = -18803.304
trial values: -21.675,-2.5888 -> logL = -18803.304
trial values: -21.675,-2.5886 -> logL = -18803.304
Best fit values:
result unit
parameter
crab.spectrum.main.Powerlaw.K (2.113 +/- 0.028) x 10^-22 1 / (cm2 keV s)
crab.spectrum.main.Powerlaw.index -2.589 +/- 0.012
Correlation matrix:
col0 col1
---- ----
1.00 0.36
0.36 1.00
Values of -log(likelihood) at the minimum:
-log(likelihood)
HAWC 18803.304206
total 18803.304206
Values of statistical measures:
statistical measures
AIC 37610.608552
BIC 37629.339351
Thank you @cbrisboi! I am more or less doing the same thing. I am working on this branch here: https://github.com/threeML/hawc_hal/tree/fix_py3_pull_request We carefully need to understand which changes have affected the outcome of the analysis.
This issue is fixed in the pull request #35 that is almost ready to ship to master.
Currently running a test fit using the public dataset on (https://data.hawc-observatory.org/datasets/crab_data/index.php) is broken, after some discussion internally it appears more complicated scripts are breaking in a similar way.
I set up an environment using these lines:
Using the data on the public page linked previously, I stripped down that fit example to the following: minimal_fail.py
Changing between minimizers (minuit and scipy) do not appear to affect the outcome, as shown in the logs below. minuit: failure_minimizer_minuit.log
scipy: failure_minimizer_scipy.log