Version 1.4.0#

New features#

MCMC functionalities#

  • mcmc can now return and plot the mcmc best-fit model according to the maximum of the log-like:

    # 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=True)
    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()
    
  • McmcSampler.set_bounds() method can preserve or not fit boundaries

    # NOTE: preserve_fit_range=True preserves the model fit range for each parameter used in the MCMC
    mcmc.set_bounds(bound=5.0,bound_rel=True,preserve_fit_range=True)
    
  • A complete example is available in the MCMC section of Model fitting 1: Only SSC and extended radio jet

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: RadioSpectrum

  • RadioSpectrum can be combined with a jet model in FitModel:

    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

Leptonic equilibrium#

data handling#

  • UL are handled when rebinning SED data

  • added nu min/max to rebin

EC emission#

  • added pair production absorption for Dusty Torus and Broad Line Region

  • 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_extrapolation in internal absorption setup to speed up evaluations:

    jetset_model.enable_internal_absorption('DT', use_R_H_profile_extrapolation=True)
    
  • To enable internal absorption for model fitting see the How to enable Internal absorption section of Model fitting 3: External Compton

bug fixing#

  • minor bug fixes

  • fixed some typo in variable names

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.sh syncs JetSeT constraints from requirements.txt into $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 problem

  • This 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-dep
    
  • If you want to experiment with different requirements (do it on your own risk):

    • edit the requirements.txt accordingly 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).