Recent Releases of mulensmodel

mulensmodel - version 3.4.0

  • correction of bug in eccentric xallarap orbit calculations (effectively the code assumed omega=0)
  • adding Event.get_scaled_fluxes()

- Python
Published by rpoleski 10 months ago

mulensmodel - version 3.3.1

Better way of dealing with data/ during installation. Thanks to @AmberLee2427 .

- Python
Published by rpoleski 11 months ago

mulensmodel - version 3.3.0

Circular Keplerian orbital motion added. In ModelParameters several properties were added: s_z, ds_z_dt, gamma_z, lens_semimajor_axis, lens_period, lens_inclination, lens_Omega_node, lens_argument_of_latitude_reference, and is_keplerian.

- Python
Published by rpoleski 12 months ago

mulensmodel - version 3.2.0

Minor addition: SatelliteSkyCoord.get_horizons()

- Python
Published by rpoleski about 1 year ago

mulensmodel - version 3.1.0

Allowing multi-source models with different LD coefficients for each source. In Model class changed APIs are for methods: set_limb_coeff_gamma(), get_limb_coeff_gamma(), set_limb_coeff_u(), and get_limb_coeff_u(). Thanks to @rapoliveira

Since last release there were other changes worth mentioning:

  • reference positions in xallarap models with both sources luminous (minimum chi2 was correct; 7608ecf),
  • wrong output in FitData.magnification_curves() for more than 2 sources (568d8a0),
  • bugs in FitData.get_residuals() for more than 2 sources (2b0ff69).

- Python
Published by rpoleski over 1 year ago

mulensmodel - version 3.0.3

Correcting bug in point-lens finite-source methods: finite_source_uniform_WittMao94 and finite_source_LD_WittMao94.

- Python
Published by rpoleski over 1 year ago

mulensmodel - version 3.0.0

There were two major goals for MulensModel V3: - Allow for N sources (However, xallarap can only be used with binary source models) - Allow the user a direct access to partial derivatives of the magnification relative to the point lens model parameters (in addition to chi2 derivatives)

Implementing these changes involved some major updates to the internal architecture, but these should mostly be invisible to the user (although they add new functionality).

We have also cleaned up some problems/bugs/features that will impact the user experience: - Shifted the convention of alpha by 180 deg to make MM compatible with convention of Skowron et al. 2011. - Removing astropy units from microlensing parameters. - Generally improving consistency in naming conventions. - Deprecated functions and properties removed.

A detailed list of changes follows.

Changes to Major Classes

Event Class

  • REMOVED deprecated functions and attributes:
    • get_ref_fluxes(): REMOVED keywords data_ref and fit_blending.
    • REMOVED keyword fit_blending of methods get_ref_fluxes(), get_chi2(), get_chi2_for_dataset(), get_chi2_per_point(), and get_chi2_gradient(). Use fix_blend_flux instead.
    • reset_best_chi2()
    • best_chi2
    • best_chi2_parameters

Model Class

  • ADDED get_magnification_curve() and get_magnification_curves() (for multi-source models).
  • get_lc(): updated documentation to reflect that this returns MAGNITUDES (not magnifications)
  • get_magnification():
    • REMOVED keyword flux_ratio_constraint
    • default value of separate changed to None (which defaults to True if source_flux_ratio is provided and to False otherwise).
  • REMOVED deprecated functions and attributes:
    • plot_magnification(): REMOVED keyword flux_ratio_constraint.
    • plot_lc(): REMOVED keywords data_ref, flux_ratio_constraint, fit_blending, f_source, and f_blend.
    • plot_trajectory(): REMOVED keyword show_data.
    • set_default_magnification_method(). Use Model.default_magnification_method = XXX, instead.
    • magnification() replaced by get_magnification().
    • reset_plot_properties()

ModelParameters Class

Even if the user was initializing Model with a dict, that dict is immediately converted into a ModelParameters object, so many of these changes could affect the user experience, even if they had not been interacting directly with the ModelParameters class.

  • Astropy units REMOVED (i.e., now everything is a float) from properties: t_star, t_eff, t_E, alpha, ds_dt, dalpha_dt, t_star_1, t_star_2, gamma_parallel, gamma_perp, and gamma. Also REMOVED from function get_alpha().

  • Property pi_E REMOVED. Properties pi_E_E and pi_E_N are still there.

  • Properties that are not defined now raise AttributeError (previously rho was returning None, and some other ones raised KeyError).

  • Warnings for unexpected values of angles (e.g., 1000 deg) are not raised anymore.

  • Changes in default values for t_0_par and t_0_kep:

    • If t_0_par is not defined, then it defaults to t_0_kep, t_0, t_0_1 in that order.
    • If t_0_kep is not defined, then it defaults to t_0_par, t_0, t_0_1 in that order.

Also, REMOVED which_parameters() from modelparameters.py because it not very useful and it was very complicated.

MulensData Class

  • REMOVED deprecated functions and attributes:
    • coordinates (i.e., coords, ra, dec) are no longer associated with MulensData objects.
    • REMOVED model and plot_residuals keywords from plot().

Trajectory Class

ADDED new keyword arguments to __init__: x and y. They can be provided instead of the times argument.

Changes to Other Classes

FitData Class

  • Now supports fit_fluxes for multiple sources.
  • ADDED:
    • get_d_A_d_rho()
    • magnification_curve and magnification_curves
  • DEPRECATED subclass FSPL_Derivatives. Most its methods are replaced by PointLens class(es)

  • DEPRECATED:

    • get_d_A_d_u_for_PSPL_model()
    • get_d_A_d_u_for_FSPL_model()
    • get_d_A_d_u_for_point_lens_model()

All get_d_A_d_u* and get_d_u_d_params* functions got moved to the PoinLens*Magnification classes in pointlens.py (see below). If desired, they could be accessed instead through FitData.magnification_curve.XXX().

  • REMOVED deprecated functions and attributes:
    • In get_residuals, REMOVED type keyword. Use phot_fmt instead.

Point Lens

The PointLens and BinaryLens classes were subdivided into separate classes for each magnification method.

  • Function get_pspl_magnification() from pointlens.py was removed. Use classes listed in next point instead.
  • Point Lens classes ADDED:
    • PointSourcePointLensMagnification
    • FiniteSourceUniformGould94Magnification
    • FiniteSourceLDYoo04Magnification
    • FiniteSourceUniformWittMao94Magnification
    • FiniteSourceLDWittMao94Magnification
    • FiniteSourceUniformLee09Magnification
    • FiniteSourceLDLee09Magnification
  • PointLensWithShear REPLACED by PointSourcePointLensWithShearMagnification.

Binary Lenses

  • BinaryLens class REMOVED.
  • Binary classes ADDED:
    • BinaryLensPointSourceWM95Magnification
    • BinaryLensPointSourceVBBLMagnification
    • BinaryLensPointSourceMagnification
    • BinaryLensQuadrupoleMagnification
    • BinaryLensHexadecapoleMagnification
    • BinaryLensVBBLMagnification
    • BinaryLensAdaptiveContouringMagnification
    • BinaryLensPointSourceWithShearWM95Magnification
    • BinaryLensPointSourceWithShearVBBLMagnification
  • Caustics REPLACED by CausticsBinary.
  • CausticsWithShear REPLACED by CausticsBinaryWithShear.

Other

  • PointLensFiniteSource REPLACED by B0B1Utils.
  • ADDED EllipUtils.
  • MagnificationCurve:
    • ADDED methods get_d_A_d_params() and get_d_A_d_rho().
    • ADDED property methods_indices.

- Python
Published by rpoleski over 1 year ago

mulensmodel - version 2.24.0

Mass ratio q allowed to be greater than 1.

- Python
Published by rpoleski about 2 years ago

mulensmodel - version 2.23.0

Binary source combined with xallarap - new parameter added: q_source.

- Python
Published by rpoleski about 2 years ago

mulensmodel - version 2.22.0

Adding phot_fmt keyword to Model.plot_lc().

- Python
Published by rpoleski about 2 years ago

mulensmodel - version 2.21.0

Corrected VBBL imports. We had suboptimal performance since v2.14.0. No changes in public API.

- Python
Published by rpoleski about 2 years ago

mulensmodel - version 2.20.0

Minor changes in AdaptiveContouring submodule to simplify Windows installation.

- Python
Published by rpoleski over 2 years ago

mulensmodel - version 2.19.2

Model.get_trajectory() - keyword satellite_skycoord added. Also the documentation of that function was clarified. Corrected plotting for datasets with negative uncertainties.

- Python
Published by rpoleski over 2 years ago

mulensmodel - version 2.18.0

chi^2 gradient for the finite-source point-lens models. The most changes were in two classes:

  • FitData - added: getdAduforPSPLmodel(), getdAdrho(), datamagnification, and class FSPL_Derivatives,
  • Model - added: getmagnificationmethods(), methods, defaultmagnificationmethod (and its .setter), and getmagnificationmethods_parameters().

- Python
Published by rpoleski almost 3 years ago

mulensmodel - v2.17.0

Xallarap effect added.

- Python
Published by rpoleski almost 3 years ago

mulensmodel - v2.16.0

VBBL updated to 3.5.0 and changes in the way in which shear calculations are performed.

- Python
Published by rpoleski about 3 years ago

mulensmodel - v2.15.0

Added or improved printing of: Coordinates, Event, LimbDarkeningCoeffs, Model, ModelParameters, and MulensData.

- Python
Published by rpoleski over 3 years ago

mulensmodel - version 2.14.0

We added Chang-Refsdal lens, i.e., single lens with shear and convergence. This was mostly done by @alpv95.

- Python
Published by rpoleski over 3 years ago

mulensmodel - version 2.13.2

For testing CI

- Python
Published by rpoleski over 3 years ago

mulensmodel - v2.13.0

  • v2.12 - added in MulensData: scaleerrorbars(), errorbarsscalefactors, and errorbarsscaling_equation
  • v2.13 - bug in MagnificationCurve corrected (very rare and only for single lens case)

- Python
Published by rpoleski over 3 years ago

mulensmodel - version 2.11.0

v2.11.0: In MulensData we add copy() method which returns a deep copy of given instance. We also clarify docsting for plot_properties attribute of that class.

- Python
Published by rpoleski over 3 years ago

mulensmodel - version 2.10.1

Adding long_description in setup.py so that PyPI upload works.

- Python
Published by rpoleski almost 4 years ago

mulensmodel - version 2.10.0

v2.9: FitData.get_dataset_trajectory() added

v2.10: Event.get_chi2_per_point() - option bad added

- Python
Published by rpoleski almost 4 years ago

mulensmodel - version 2.8.1

Binary lens with extranl mass sheet added by @alpv95: - BinaryLensWithShear - CausticsWithShear - tests for the two above - convergence_K, shear_G, and is_external_mass_sheet in ModelParameters - binarylensimports.py as a new file - VBBL - license, BinaryMag0_shear(), NewImages_shear(), and VBBL_SG12_9_wrapper

- Python
Published by rpoleski about 4 years ago

mulensmodel - version 2.7.2

Test of recent changes in .github/workflows/publish.yml

- Python
Published by rpoleski about 4 years ago

mulensmodel - version 2.7.0

Adding Trajectory.parallaxdeltaN_E

- Python
Published by rpoleski over 4 years ago

mulensmodel - version 2.6.2

correcting bug in wrapping new VBBL function

- Python
Published by rpoleski over 4 years ago

mulensmodel - version 2.6.0

v2.5.0 - FitData.get_d_A_d_u_for_point_lens_model() added

v2.6.0 - binary-lens point-source calculations are done by VBBL

- Python
Published by rpoleski over 4 years ago

mulensmodel - version 2.4.5

v2.4 - added MulensModel/source/tests/check_architecture.py

- Python
Published by rpoleski over 4 years ago

mulensmodel - version 2.3.3

minor update for PyPI

- Python
Published by rpoleski over 4 years ago

mulensmodel - version 2.3.2

Typo in setup.py corrected.

- Python
Published by rpoleski over 4 years ago

mulensmodel - version 2.3.1

Event.plot() added. Corrected setup.py.

- Python
Published by rpoleski over 4 years ago

mulensmodel - version 2.2.0

Automated upload to PYPI on release. Thanks to help by @ketozhang.

- Python
Published by rpoleski over 4 years ago

mulensmodel - version 2.1.0

Model.get_lc() added.

- Python
Published by rpoleski over 4 years ago

mulensmodel - version 2.0.0

Summary

The major goal of this version update was to allow control of fits for individual datasets with the same model. For example, the ability to fix the blend flux = 0 for a single dataset but allow it to be a free parameter for other datasets. Achieving this goal required a significant change in the overall architecture. In particular, we moved fitting of datasets from inside the Model() class to the Event() class. In retrospect, the new architecture makes more sense because it removes circular dependencies from the Model() class and makes it completely independent from the data. The basic user who primarily accessed fit results through the Event() class should not notice these changes.

A secondary goal of this version update was to clean up other aspects of the code. For example, clarifying keyword and function names. We also explicitly created a utils.PlotUtils() so that convenience functions for plotting that were used by multiple classes were collected in one place. Finally, the Event() class no longer stores the bestchi2() or bestchi2_parameters() from previous updates. These properties are intrisic to model minimization and not to an Event() object, so should not be properties of an Event().

Main Differences

mm.Fit() vs. mm.FitData()

mm.Fit()

The old mm.Fit() class acted on all datasets at once and took magnification rather than a model as its input. Hence, setting conditions (such as zero blending) for individual datasets was not possible with the existing class. In addition, because Fit() took magnification as an input, it became a property of mm.Model() and thus, required that mm.Model() also took datasets and a property. This did not make logical sense and resulted in circular code.

This class has been DEPRECATED in favor of mm.FitData(). However, if you only combined datasets with a mm.Model() using the mm.Event() class, you should not notice much, if any, difference (except increased functionality).

mm.FitData()

The mm.FitData() class combines a model with a single dataset. This resolves the circular logic and allows different fitting conditions (such as zero blending) to be applied to one (or several), but not all datasets. Fits for multiple datasets are combined in the mm.Event() class, i.e., mm.Event() contains a new property mm.Event.fits, which is a list of FitData() objects, one for each dataset.

The blend flux, source flux, and/or the source flux ratio (for two source fits), can be fixed for an individual FitData() object. For a fit with multiple datasets, this information is supplied as a dictionary to the Event() object and passed to the relevant FitData() object as necessary.

mm.Event()

Fitting API and Fluxes

  • Fit() --> FitData()
  • ADD: fits
  • ADD: fixblendflux, fixsourceflux
  • ADD: fixsourceflux_ratio
  • ADD: fit_fluxes()
  • ADD: fluxes, sourcefluxes, blendfluxes
  • ADD: getfluxfor_dataset(dataset)

Transfer Actions that Created Circular Dependencies from mm.Model() to mm.Event()

(and cleanup other plotting functions)

  • ADD: utils.PlotUtils()
  • ADD: data_ref (optional, defaults to first dataset)
  • MOVED contents of many plotting functions from mm.Model() --> mm.Event():
    • plot_model()
    • plot_data()
    • plot_residuals()
    • plotsourcefor_datasets()
  • MOVED: mm.Model.setdefault_colors() --> mm.Event()

Remove Minimization Properties from mm.Event()

  • REMOVE: resetbestchi2()
  • REMOVE: bestchi2, bestchi2_parameters

Other Changes

  • chi2gradient() --> calculatechi2_gradient()
  • fitblending (keyword used by getchi2(), getchi2fordataset(), getchi2perpoint(), getchi2gradient() ): this should be controlled by fixblendflux instead.
  • mm.Event().getreffluxes(): dataref keyword will be deprecated, because there is now a getfluxfordataset() function.

mm.MagnificationCurve()

Remove propery .magnification, which duplicates .get_magnification()

  • REMOVE: magnification property

mm.Model()

Remove Circular Dependencies from mm.Model()

Combining datasets with a model and all fitting are now handled by mm.Event()

  • REMOVE: data_ref keyword.
  • REMOVE: fit, sourcefluxratio_constraint, datasets
  • plot_trajectory():
    • DEPRECATED: show_data keyword.
  • REMOVE: plotsourcefor_datasets()
  • REMOVE: getreffluxes()
  • REMOVE: datamagnification, getdatamagnification(), getresiduals()
  • REMOVE: resetplotproperties(), plotdata(), plotresiduals()
  • REMOVE: datasets, set_datasets()

Clarify Keyword/Function Names

  • plot_magnification():
    • fluxratioconstraint --> sourcefluxratio
    • DEPRECATED: fit_blending keyword
  • plot_lc():
    • fsource --> sourceflux
    • fblend --> blendflux
    • fluxratioconstraint --> sourcefluxratio
  • magnification() --> get_magnification() and:
    • fluxratioconstraint --> sourcefluxratio
    • ADD: bandpass

Other Changes

  • REMOVE: setsourcefluxratio(), setsourcefluxratioforband()

mm.MulensData():

  • plot():
    • model keyword is DEPRECATED.

mm.utils.PlotUtils():

New class of utility functions useful for plotting (collected from elsewhere in the code): - getyvalueyerr() - findsubtract() - findsubtractxlabel() - getcolor_differences()

Examples That Reflect These Changes

  • example01models.py
    • fsource, fblend --> sourceflux, blendflux
  • example02fitting.py
    • data_ref replaced by explict FitData instance.
  • example06fitparallaxEMCEE.py
    • model.set_datasets instances --> Event() instances
    • model.plotlc() --> Event.plotmodel()
  • example09gradient_fitting.py
    • event.chi2gradient() --> event.getchi2_gradient()
    • model.plotlc(dataref=data) --> model.plotlc(sourceflux=value, blendflux=value) where the values are extracted using Event().getfluxfor_dataset(data).
  • example10fittingandfluxes.py
    • event.fit.fluxofsources(dataset), event.fit.blendingflux(dataset) --> event.getfluxfordataset(dataset)
  • example11binary_source.py
    • event.model.setsourcefluxratio(theta) --> event.fixsourcefluxratio ={mydataset: theta_}
    • model.magnification() --> model.get_magnification()
  • example12fitsatelliteparallax_EMCEE.py
    • added myevent.fitfluxes()
    • myevent.model.getreffluxes() --> myevent.getfluxfordataset(dataground)
    • fsource, fblend --> sourceflux, blendflux
  • example171L2S_plotting.py
    • model.magnification() --> model.get_magnification()
  • example18simulate.py
    • model.magnification() --> model.get_magnification()

Also, because bestchi2 and bestchi2_parameters are no longer properties of Event(), we changed how we store and access that information in Examples 06, 10, 11, 12, 13, 15.

Other Changes

New Examples:

  • example171L2S_plotting.py
  • example_16: added additional yaml files.

- Python
Published by rpoleski almost 5 years ago

mulensmodel - version 1.17.2

Changes between 1.16 and 1.17:

  • methods finite_source_uniform_WittMao94 and finite_source_LD_WittMao94 added in MagnificationCurve plus corresponding functions in PointLens

- Python
Published by rpoleski over 5 years ago

mulensmodel - version 1.16.0

Changes since last release:

v1.15.0: * Model.plot_lc() got new kwargs: gamma and bandpass

v1.16.0: * new import of C and C++ code using extensions - should work in basically any python

Also example 16 was added - it's a high-level code for fitting microlensing models.

- Python
Published by rpoleski almost 6 years ago

mulensmodel - version 1.14.0

Changes since last release:

v1.11.0: * Coordinates.vEarthprojected() added * Event.getreffluxes() - fitblending option added * Model.getreffluxes() - fitblending option added * Utils.velocityofEarth() added

v1.12.0: * fitblending option added in Model.plotlc()

v1.13.0: * DATAPATH added - replaces MODULEPATH in many places * whole data/ directory included in setup.py

v1.14.0: * UniformCausticSampling class added (implements Cassan 2008 method), hence, new model parameters were added: xcausticin, xcausticout, tcausticin, and tcausticout

- Python
Published by rpoleski over 6 years ago

mulensmodel - version 1.10.0

  • new install,
  • Model.plottrajectory() arrowkwargs added,
  • ModelParameters.isfinitesource() added,
  • source plotting functions added: Event.plotsourcefordatasets(), Model.plotsource(), and Model.plotsourcefor_datasets();
  • satelliteskycoord keyword in Model.plotmagnification() and Model.plot_trajectory() added,

- Python
Published by rpoleski about 7 years ago

mulensmodel - version 1.9.4

- Python
Published by rpoleski over 7 years ago

mulensmodel - version 1.9.3

Model.setmagnificationmethods() - source parameter added. Hack session examples.

- Python
Published by rpoleski over 7 years ago

mulensmodel - version 1.8.3 - FSPL with large rho and more binary source capabilities

Major changes as compared to previous release are implementation of Lee et al. 2009 for finite-source point-lens with large rho and extended binary source capabilities.

In detail: * 1.5 -> 1.6 MulesData.plot() added; Model.getresiduals(..., data); Model.plotresiduals(... showbad); Model.fit added * 1.6 -> 1.7 Model.plotmagnification() and plotlc() - additional keywords * 1.7 -> 1.8 Fit.update(); Model.magnification(..., separate); Model.magnification() fluxratioconstraint parameter can be string; Model.setsourcefluxratio(None); Model.setsourcefluxratioforband(); PointLens.getpointlensuniformintegratedmagnification();PointLens.getpointlensLDintegratedmagnification(); 2 new magnification methods: 'finitesourceuniformLee09' and 'finitesourceLD_Lee09'

- Python
Published by rpoleski over 7 years ago

mulensmodel - version 1.5.3 - binary sources

Binary sources - basic functions work properly. Also pi_E added in mulenssystem.py.

- Python
Published by rpoleski almost 8 years ago

mulensmodel - version 1.4.0

Event.sum_function added

- Python
Published by rpoleski almost 8 years ago

mulensmodel - version 1.3.0

chi2 calculated in flux space as default, tabulated coefficients for FSPL models, Skowron and Gould 2012 as default method for binary lens polynomial root solving

- Python
Published by rpoleski almost 8 years ago

mulensmodel - version 1.2.0

gradient of chi^2 for PSPL events

- Python
Published by rpoleski about 8 years ago

mulensmodel - version 1.1.0

orbital motion, additional input file format in Horizons, improved BLPS calculations

- Python
Published by rpoleski about 8 years ago

mulensmodel - version 1.0.0

First official release - Mar 1st 2018.

- Python
Published by rpoleski over 8 years ago

mulensmodel - version 0.4.0

version 0.4.0

- Python
Published by rpoleski over 8 years ago

mulensmodel - version 0.3.1

version 0.3.1 - includes Adaptive Contouring and VBBL packages

- Python
Published by rpoleski over 8 years ago

mulensmodel - version 0.2.1

- Python
Published by rpoleski over 8 years ago

mulensmodel - version 0.2.0

- Python
Published by rpoleski almost 9 years ago

mulensmodel - first release

- Python
Published by rpoleski almost 9 years ago