Conversation
|
preliminary testing show that the Fourier basis SWGP is >2x faster overall than the time independent deterministic solar wind gp. |
| return (n_earth * AU_light_sec * AU_pc / r_earth) | ||
|
|
||
|
|
||
| def _dm_solar(n_earth, theta, r_earth): |
There was a problem hiding this comment.
I don't think this is necessary. I think the np.sinc in make_solardm should be faster than using a jnp.where. Note that the definition of np.sinc is sin(pi * x) / (pi * x) hence the 1 - theta / pi in the argument. But make_solardm above should give back the You 2007 function.
|
@jeremy-baier @meyers-academic I've been testing this PR out with some slight modifications to def fourierbasis_solar_dm(psr,
components,
T=None):
"""
From enterprise_extions: construct DM-Solar Model Fourier design matrix.
:param psr: Pulsar object
:param components: Number of Fourier components in the model
:param T: Total timespan of the data
:return: F: SW DM-variation fourier design matrix
:return: f: Sampling frequencies
"""
# get base Fourier design matrix and frequencies
f, df, fmat = fourierbasis(psr, components, T)
dm_sol_wind = make_solardm(psr)(1.0)
return f, df, fmat * dm_sol_wind[:, None]Solar wind can now be put in commongp = [
ds.makecommongp_fourier(
psrs,
ds.powerlaw,
30,
fourierbasis=ds.fourierbasis_solar_dm,
T=Tspan ,
common=["sw_gp_log10_A", "sw_gp_gamma"],
name="sw_gp",
),
] |
|
i think this branch was on my old fork of discovery. i am going to close this and open a new PR. see #98 |
Copying over from enterprise extensions.
Adds Fourier basis solar wind dm gp and time domain sw gp with a linear interpolation.
Bug fix (taken from Pat) for deterministic solar wind.