Version 1.4.0#
Breaking interface changes#
Important
Starting from v1.4.0, the
McmcSamplerclass does not use anymorelabelsanduse_labels_dict, to select the parameters used by the sampler. Starting from this version, all thefreeparameters will be sampled. To select sampled parameters, pleasefree/freezethem. Please read the caveats for the Bayesian model fitting for further details.
New features#
MCMC functionalities#
UltraNestsupport has been added. Please read the caveats for the Bayesian model fitting, for further details. Complete examples are available in:A complete example for the
emceebackend is available in the MCMC section of Model fitting 1: Only SSC and extended radio jet.UltraNestandemceeshare the same interface, except a few differences. Please read the caveats for the Bayesian model fitting for further details.The
McmcSampler.plot_model()method, by default, will plot the mcmc best-fit model. To plot the frequentist best-fit model, use (plot_mcmc_best_fit_model==False)# NOTE: plot_mcmc_best_fit_model=True gets the parameters corresponding to the max log-like p=mcmc.plot_model(sed_data=sed_data,fit_range=[1E11, 2E27],size=1000,quantiles=[0.01,0.99],plot_mcmc_best_fit_model=False) p.setlim(y_min=1E-14,x_min=1E6,x_max=2E28)
The mcmc best-fit model can be easily restored:
mcmc.reset_to_mcmc_best_fit()
The method:meth:.McmcSampler.set_bounds now can be also used for individual parameters:
mcmc.set_bounds(comp_name='jet_leptonic',par_name='N',par_bounds=[1E-5,10])
After running the mcmc sample, the input
burninvalue can be updated by using the autocorrelation time of emcee. This method, is not implemented and is not needed for UltraNest.mcmc.tune_burnin()
Leptonic equilibrium#
Added support for leptonic equilibrium jet models using injected emitters distributions. See Leptonic equilibrium
The model can be created by passing an
InjEmittersFactorydistribution toJet:from jetset.jet_model import Jet from jetset.jet_emitters_factory import InjEmittersFactory q_inj = InjEmittersFactory().create_inj_emitters('pl') my_jet = Jet(emitters_distribution=q_inj)
Validation against the Fokker-Planck time-dependent solution in
JetTimeEvol: Validation of the leptonic equilibrium against the Fokker-Plank equation solutionEnd-to-end model fitting workflow with MCMC for leptonic equilibrium models: Model fitting: Leptonic equilibrium SSC
Radio component in composite models#
Added a new analytical radio component,
RadioSpectrum, for extended jet radio emission with self-absorption turnover and high-frequency cutoff. See Jet Radio Component: RadioSpectrumRadioSpectrumcan be combined with a jet model inFitModel:from jetset.jet_radio_component import RadioSpectrum from jetset.model_manager import FitModel fit_model = FitModel(jet=prefit_jet, name='SSC-best-fit-lsb', template=None) fit_model.add_component(RadioSpectrum()) fit_model.composite_expr = '(jet_leptonic+radio_spectrum)'
A complete fitting workflow (SSC + extended radio component, minuit and MCMC) is available in Model fitting 1: Only SSC and extended radio jet
Corona#
Added EC support for Corona, see: Example for using a Corona within the EC scenario.
data handling#
UL are handled when rebinning SED data
added nu min/max to rebin
ASI ssdc sedbuilder
Pair production for external fields#
added pair production absorption for Dusty Torus, Broad Line Region and Corona.
internal absorption can be enabled for EC components (DT/BLR) and used in fitting workflows. See Internal absorption and Model fitting 3: External Compton
optional
use_R_H_profile_extrapolationin internal absorption setup to speed up evaluations:jetset_model.enable_internal_absorption('DT', use_R_H_profile_extrapolation=True)
A complete fitting workflow with EC and internal absorption see: Model fitting 3: External Compton
bug fixing#
minor bug fixes
fixed typos in variable names
fixed a bug in serialization of depending parameter.
C codebase#
Substantial refactoring of the C code, dividing the blob structure in several sub-structures, with hierarchy.
installation#
Added source installation via
./install.sh.Detects if you are in a conda/mamba/micromamba evn or a pip evn, and install JetSeT from source, together with the dependencies
When run inside an active conda/mamba environment,
./install.shsyncs JetSeT constraints fromrequirements.txtinto$CONDA_PREFIX/conda-meta/pinned. This pins JetSeT requirements in that environment and helps prevent later conda/mamba installs of other packages from overriding them. For pip virtual env, the problemThis script is recommended when binaries are not available for your Python/platform, or for developers and advanced users.
Run the script from the project root to install dependencies, compile extensions, and install JetSeT:
./install.sh
If you want to skip the installation of dependencies
./install.sh -skip-depIf you want to experiment with different requirements (do it on your own risk):
edit the
requirements.txtaccordingly and:
./install.sh
Verify the installation with, optional (not within the code repo dir):
python -c "import jetset; print(jetset.__version__)" pytest --disable-warnings --pyargs -vvv jetset.tests.test_users::TestUser
Full source-install requirements and troubleshooting are documented in Installation (including SWIG notes in Swig installation).