dynamics-of-stellar-systems / dynamite

dynamics, age and metallicity indicators tracing evolution
MIT License
10 stars 1 forks source link

Beta plot for python nnls #344

Closed maindlt closed 7 months ago

maindlt commented 8 months ago

Plotter.beta_plot(...) now uses the existing LegacyOrbitLibrary.get_model_intrinsic_moment_constructor() method and does not rely on the LegacyWeightSolver output any more.

get_model_intrinsic_moment_constructor() calls the rather time-consuming orbit library method read_orbit_intrinsic_moments(...) every time it is called. This decreases performance, especially when several models in the beta plot share the same orbit library. Therefore, read_orbit_intrinsic_moments(...) can now cache the calculated intrinsic moments in files (switched on by default via the cache=True method parameter). In the test script (see below) this reduces the time required for creating the beta plot from 10 seconds to about 1 second.

To test: please run the temporary test script dev_test/test_beta_plot.py which works off the existing user_test_config_ml.yaml configuration file:

Before merging:

Closes #339.

prashjet commented 7 months ago

I ran the proposed tests and got the expected outcome - great, many thanks Thomas! Will leave the final TODO-s and merging to yo.