dynamics-of-stellar-systems / dynamite

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

Installation and Tutorials #284

Open juliala254 opened 1 year ago

juliala254 commented 1 year ago

I recently started my bachelorproject (with Sabine) which will mainly be to learn how to use and understand dynamite and therewith estimating the black hole mass (and perhaps dark matter fraction) of PCG 1021091. Here I’ll write everything down what I noticed during the installation process and while completing the tutorials: 1),2),3) Thomas Maindl already took care about – thank you :)

1) Installation gfortran: gcc@9 is out dated, i needed the command brew install gcc and got the 12th version. Thomas already updated this issue (with version >=10.4) 2) While checking if gfortran is installed (man -k fortran) I received (next to the gfortran versions which appear correctly) some output (makewhatis: /Library/TeX/texbin/man: Not a directory). It appears regardless of the current directory. Apparently these are error messages (due to search for man-pages that don’t exist) that can be ignored. 3) Compiling the fortran programs: after the command make all, there are all files there apart of “partgen”, which apparently is not used any more but the source code still exists in the legacy_fortran/orbgen_partgen directory. Thomas removed partgen already from the installation guide. Tutorial 2 Quickstart: 4) For Tutorial 2 (Quickstart) you need to run Tutorial 1 (Data Preparation) first to have complete input data for NGC6278 in the tutorial_notebooks directory. Otherwise there is input data missing and you have a different directory structure as indicated in the beginning of the Tut2 Guide. (since I was not intended to complete tut1 it lead to some confusion, normally I assume one would complete all of the tutorials in order of appearance) 5) Partly, the same Tutorial has different names, for example the third one: running_a_grid_of_models.ipynb vs. 3. Output Overview vs. 3_model_iterations_and_plots.ipynb 6) In the end I played a bit with different values for parameters, changing the values in the configuration file or changing the configuration file worked fine but by uncommenting # parset['f'] = 6, I received a Key error in my notebook. Tutorial 3 Output Overview: 7) 3 of 9 Plots only are automatically generated. In the Tutorial Guide you can see the other 6 plots already in the directory but they are only called afterwards 8) The images of the 3 automatically created plots are not correctly displayed, I couldn’t load them in my browser 9) The Mass Plot: Still says “Selecting 10 Models” instead of 3 Models 10) Mass Plot: In my plot I don’t have an uncertainty for mass-follows-light .. but I guess this is my mistake due to my configurations, probably all models (I ran until now) lie outside 1sigma. Hopefully it will change with more models 11) Iteration Process: There is a plot for each process where you can see they chi2 values coming closer together. The colorbar of the plots is not consistent thus disentangling the best fit can get a bit confusing Tutorial 6 Exploring model outputs: 12) Fitting higher order GH expansions to the LOSVD doesn’t eliminate the negative wings here. (Lower order does) Perhaps it’s because I have too little orbit library, … not sure

I didn’t notice any remarks on Tutorial 5. Tutorial 1 and 4 I didn’t complete yet (since they’re not directly relevant for my project). But if there is some time left I’m happy to complete them as well to give some feedback

maindlt commented 1 year ago

Hi there, the tutorial 2 items should be solved with PR #288...

sthater commented 1 year ago

Tutorial 2: Data is only in dev_tests (although it states in tutorials that it is in docs/tutorial notebooks), and the yaml is only in docs. Should be done more homogenized.

sthater commented 1 year ago

From Jesse: also, small bug in the example jupyter notebook 3, in line 23 it says:

plotter = dyn.plotter.Plotter(config=c) figure = plotter.plot_kinematic_maps(model,cbar_lims='data')

but model is not yet defined, so I was wondering how you load the best-fit model here?

figured out the figure part, it should be:

plotter = dyn.plotter.Plotter(config=c) figure = plotter.plot_kinematic_maps(model=None,cbar_lims='data')

juliala2504 commented 8 months ago

Tutorial 2: Where there are basic infos provided to generate own input data, at the last bullet point is is a link to an example script to do the aperture and bin files for califa data but the link leads to a 404 error GitHub page

maindlt commented 8 months ago

From Jesse: also, small bug in the example jupyter notebook 3, in line 23 it says:

plotter = dyn.plotter.Plotter(config=c) figure = plotter.plot_kinematic_maps(model,cbar_lims='data')

but model is not yet defined, so I was wondering how you load the best-fit model here?

figured out the figure part, it should be:

plotter = dyn.plotter.Plotter(config=c) figure = plotter.plot_kinematic_maps(model=None,cbar_lims='data')

While passing Model=None works (returns the kinematic maps of the best model so far), we meanwhile changed Tutorial 3 such that we use the model iterator's get_plots() method which returns a tuple of plots of the best model so far, including the kinematic maps.

maindlt commented 8 months ago

Tutorial 2: Where there are basic infos provided to generate own input data, at the last bullet point is is a link to an example script to do the aperture and bin files for califa data but the link leads to a 404 error GitHub page

Many thanks for catching this, @juliala2504! The 404 error only occurs when not logged into GitHub (and most of us always are...).

Some comments we should probably discuss in one of the next hack sessions:

FIXED in PR #363

juliala2504 commented 2 months ago

Tutorial 4: Bayes LOSVD. 1. Prepare the config file: Note that one might want to change the parameter_space_settings from "which_chi2: kinmapchi2" that is usually used when working with ppxf kinematics to "which_chi2: kinchi2" since kinmapchi2 doesnt exist for bayes kinematics.

maindlt commented 2 months ago

Tutorial 4: Bayes LOSVD. 1. Prepare the config file

Hi Julia, I am afraid I don't understand: when looking at the files in the master branch, Tutorial 4 Bayes LOSVD uses the config file NGC4550_config.yaml which already has which_chi2: kinchi2 in its parameter_space_settings, so it should be ok?

juliala2504 commented 2 months ago

yes you're right! I was thinking about mentioning that is important to set this to kinchi2 when preparing your own config file. Like the NNLS is explicitly mentioned. I was using the tutorial 4 as a instruction to build my config file for another galaxy and encountered some errors until i realized i have to change it to kinchi2. Could have also looked into the config file of NGC4550 for sure though!

maindlt commented 2 months ago

I was thinking about mentioning that is important to set this to kinchi2 when preparing your own config file.

Fully agree :-) I wasn't aware that it is neither mentioned in the docs nor in the tutorial. I added this in a new linked PR request (mention kinmapchi2 and its constraints in the docs on configuration, in Tutorial 4 next to the required NNLS choice, and in the code (throws a ValueError if kinmapchi2 is chosen with BayesLOSVD kinematics).

@juliala2504: I couldn't add you to the PR, here's the link: #399

Cheers, Thomas