Skip to content

Releases: renecotyfanboy/jaxspec

v0.0.5

19 Apr 13:09
8ad4bf7
Compare
Choose a tag to compare

The 0.0.5 release of jaxspec is out ! Many code refactoring and internal cleaning is happening, but there are also new features, including a direct fit method for your spectral models.

New features

  • jaxspec.fit module now includes BayesianFitter and MinimizationFitter classes to perform either MCMC or direct minimization to find the best set of parameters. Note that MinimizationFitter is faster but more likely to fall in local minima.
  • Both BayesianFitter and MinimizationFitter can fit the same model using multiple ObsConfiguration at once to obtain stronger constraints. Either pass a list[ObsConfiguration] or a dict[str, ObsConfiguration] to achieve this.
  • Fit results are now plotable with any unit you want! FitResult.plot_ppc haw two new kwargs : x_unit and y_type. x_unit argument can be any unit of length, frequency, or energy and the plot will adapt. y_type can be any of "counts", "countrate", "photon_flux", "photon_flux_density" and will plot the equivalent curve.
  • fakeit and fakeit_for_multiple_parameters can specify sparsify_matrix = True for large RMF.
  • jaxspec.util.abundances now contains two tables. abundance_table contains the most used abundance tables in astrophysics, and element_table contains various data about elements, imported from the mendeleevpackage.
  • jaxspec is now tested against the HEACIT dataset to ensure that it is performant at reading the many types of instrument and observation files produced by the OGIP standard.

Breaking changes

  • ChainResult is renamed to FitResult
  • ChainResult.chain is renamed to FitResult.to_chain
  • ChainResult.sample has been split to FitResult.samples_haiku for a two level dictionary of posterior samples, e.g. samples['powerlaw_1']['alpha'], and to FitResult.samples_flat for a one level dictionary of posterior samples, e.g. samples['powerlaw_1_alpha'].
  • BayesianModel is renamed to BayesianFitter.
  • Instrument.from_ogip_file now takes arf_path as a kwarg since some instruments use a single .rmf file to carry both the redistribution matrix and effective area. Instrument.from_ogip_file("data/PN.rmf","data/PN.arf") should be changed to Instrument.from_ogip_file("data/PN.rmf", arf_path="data/PN.arf"). Even if the first syntax should work, be carefull to check that you did not intervert .arf and .rmf.

v0.0.4

04 Apr 11:10
d9ed6fc
Compare
Choose a tag to compare

This small update speeds up the data reading process

s p a r s e

19 Mar 14:38
0bcf86f
Compare
Choose a tag to compare

The v0.0.3 of jaxspec includes a large rework of the internal data handling, enabling sparse representation until runtime. It also includes a larger test suite based of the HEACIT's data, with more reliable keyword and columns reading.

What's Changed

Full Changelog: v0.0.2...v0.0.3

pypi update

21 Feb 13:54
Compare
Choose a tag to compare

jaxspec is now deployed on pypi! Anyone can download it simply with pip install jaxspec. This update comes with some new features and a better backend overall :

  • Instrumental data is now backed with xarray.Dataset, allowing semantic dimension naming which (in my opinion) greatly improves the clarity of coding.
  • Same with instrument, which is now a wrapping around the amazing arviz.InferenceData, easing the use of arvizfor various Bayesian checks on the fits
  • We reverted the ability to fit several observations at once, as it was implemented in an unmaintainable way. It will come back soon.
  • Models are automatically transformed when including transformed prior distributions (e.g. LogUniform). It eases the use of NUTS to sample the posterior distributions

🎉 First release 🎉

08 Jan 14:43
fd7556e
Compare
Choose a tag to compare

This is the first release of jaxspec. It is highly unstable and a lot of API changes are to be expected until the first stable release.

At this time, you can basically use jaxspec to :

  • Load OGIP data
  • Define a spectral model
  • Fit this spectral model using MCMC
  • Include a background model
  • Plot the results