Closed AaronDJohnson closed 2 years ago
@AaronDJohnson the command you used here is an e_e
command. Can you say a little bit about why you think this is an enterprise
issue? Also, we should assign Michele since it is his commit.
@AaronDJohnson the command you used here is an
e_e
command. Can you say a little bit about why you think this is anenterprise
issue? Also, we should assign Michele since it is his commit.
The error also happens when models.append(s(p)) is called without e_e
. I have another file which uses the same model but in "verbose" format using only enterprise
(a modified 12.5 year stochastic tutorial file). By dropping out signals from this file, I was able to determine that ecorr was causing the error.
@vallis do you have any idea how that particular commit could be involved with this error?
I think the big clue here is that the errors are happening on B1937 and J1713, which are the only two pulsars with TOAs from both telescopes. Michele was working on being able to split the TOAs to look for ORFs separately at different telescopes.
Hmm... my changes to split common GPs by telescope are still in a PR and not merged yet.
The function quant2ind
that fails says that it only works for sorted TOAs. Both Pulsar versions do the sorting. But perhaps having two telescopes the vector still looks unsorted?
Does this problem occur using Nihan's pickles or reading from par/tim?
@vallis as far as I can tell it must only occur with the par/tim files from the 12.5 year data set. Nihan's pickles must have been free of this problem, because the OSU group used the newest version of enterprise (as far as I know) to analyze the pickles the other day.
Can you reproduce the problem by loading either B1937 or J1713 from par/tim, and instantiating the ECORR model?
error_example.zip This contains the 12.5 year par and tim file for B1937 along with the following code to reproduce the error:
import glob
from enterprise.pulsar import Pulsar
from enterprise.signals import selections, parameter, white_signals
ephemeris = 'DE438'
parfiles = sorted(glob.glob('./B1937*par'))
timfiles = sorted(glob.glob('./B1937*tim'))
for p, t in zip(parfiles, timfiles):
psr = Pulsar(p, t, ephem=ephemeris, timing_package='pint')
selection = selections.Selection(selections.by_backend)
ecorr = parameter.Constant()
ec = white_signals.EcorrKernelNoise(log10_ecorr=ecorr, selection=selection)
ec(psr)
OK, I found the problem. It's potentially dangerous. In commit 1d4975, I dropped a critical indexing step at line 266 in pulsar.py, which uses the toas sorting index to sort the backend_flags array. This resulted in scrambled selection masks when loading B1937 with PINT (but not with tempo2, which must do some sorting of its own). I just put in a PR to fix this on enterprise/master.
Nice catch @vallis !!
Thanks (although it was my fault originally). Fixed and merged in #297.
For B1937+21 and J1713+0747 I am getting the following error when running
pta_pint = models.model_2a([psr], noisedict=noise_params, gamma_common=4.33)
.The error starts with 07e1150673b44f8727add92890238b1564ea040c. Removing ecorr from the model fixes the error.