diff --git a/examples/semi_coherent_twoglitch_search.py b/examples/semi_coherent_twoglitch_search.py index 6b0b77a3a3992df5069a5a61f95f5ca3e7596041..8514cbf57da235d5445f14fc999dcc7614ff87fd 100644 --- a/examples/semi_coherent_twoglitch_search.py +++ b/examples/semi_coherent_twoglitch_search.py @@ -19,12 +19,15 @@ theta_prior = {'F0': {'type': 'norm', 'loc': F0, 'scale': abs(1e-6*F0)}, 'delta_F0': {'type': 'halfnorm', 'loc': 0, 'scale': 1e-7*F0}, 'delta_F1': 0, - 'tglitch': {'type': 'unif', - 'lower': tstart+0.01*duration, - 'upper': tstart+0.99*duration}, + 'tglitch_0': {'type': 'unif', + 'lower': tstart+0.01*duration, + 'upper': tstart+0.5*duration}, + 'tglitch_1': {'type': 'unif', + 'lower': tstart+0.5*duration, + 'upper': tstart+0.99*duration}, } -nwalkers = 100 +nwalkers = 50 nsteps = [500, 500, 500] mcmc = pyfstat.MCMCGlitchSearch( diff --git a/pyfstat.py b/pyfstat.py index 73417bb1adbc6cdfff9d7bda6ff4eb6bcaf13d3f..c340cce07a37080741e9a72cce479b7e61c9e8f2 100755 --- a/pyfstat.py +++ b/pyfstat.py @@ -1297,6 +1297,10 @@ _ sftfilepath: str glitch_keys = ['delta_F0', 'delta_F1', 'tglitch'] full_glitch_keys = list(np.array( [[gk]*self.nglitch for gk in glitch_keys]).flatten()) + + if 'tglitch_0' in self.theta_prior: + full_glitch_keys[-self.nglitch:] = [ + 'tglitch_{}'.format(i) for i in range(self.nglitch)] full_theta_keys = ['F0', 'F1', 'F2', 'Alpha', 'Delta']+full_glitch_keys full_theta_keys_copy = copy.copy(full_theta_keys)