Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions + improvements #13

Closed
12 of 13 tasks
pavolgaj opened this issue May 5, 2022 · 16 comments
Closed
12 of 13 tasks

Suggestions + improvements #13

pavolgaj opened this issue May 5, 2022 · 16 comments

Comments

@pavolgaj
Copy link
Owner

pavolgaj commented May 5, 2022

I start to make a big code change. I mainly want to use the emcee package for Monte Carlo fitting (instead of quite old pymc v2). If someone has some suggestions on what to change in the OCFit package and/or GUI, please, write here. I also have some;)
Hopefully, the completely new version will be published this year...

Planned changes

@kolarjakubmuni
Copy link

Hi. I would suggest the possibility of fitting more than one phenomenon in the O-C diagram, e.g. parabolic change with apsidal motion, etc. For my field of study (quadruple eclipsing systems) we have usually two O-C diagrams, for pair A and B. We could fit them separately for knowing what is happening with the pair. However, these two pairs are gravitationally bound and influence each other. So their O-C diagrams can show us their mutual motion. Maybe it should be very useful to fit both O-C diagrams together. Of course both pairs have different ephemeris values and it would be quite large change in the software.

image
From the paper Zasche et al. 2019, there is an example of the O-C diagrams for both pairs.

@pavolgaj
Copy link
Owner Author

A combination of parabolic trend and apsidal motion is easy to implement.

The quadrupole systems are fascinating but fitting the O-Cs from both pairs together would be really complicated and I don't know if it would have some benefits. It would be necessary to load and store O-Cs separately which requires changing a big part of the code (initialization, fitting, plotting etc.). And only parameter that should be the same for O-Cs of both pairs is their mutual orbital period (label as P3 in OCFit). I don't plan to implement this possibility, now - maybe if I'll study such systems, my opinion changes;)

@pavolgaj
Copy link
Owner Author

I just changed the FitMCMC function to use the emcee package (commit b5e4f7c in a dev branch). I'm open to any of your comments or possible issues with it.
The original function (used pymc) was renamed to FitMCMC_old and the old InfoMC class moved to file info_mc_old.py - emcee and pymc generate a bit different output files.

I compared pymc and emcee fitting and they give very similar results. Maybe, the emcee gives more realistic posterior distributions. And from my point of view, fitting using an emcee is faster.

@kolarjakubmuni
Copy link

Maybe the fitting primary and secondary minima, which are vertically shifted simultaneously. Something like this.
image
(From my preliminary results of one system.)

@pavolgaj
Copy link
Owner Author

@kolarjakubmuni Interesting... The difference in O-Cs for primary and secondary for nearly 6 hours is something strange. Could you write some specifications for this system? Isn't it eccentric?

@pavolgaj
Copy link
Owner Author

Change default file format from pickle to JSON (aa4e97a). The format can be changed manually with parameter format in the Save function - it has 2 possible values 'json' or 'pickle'. Detection of the file format before loading it is done automatically. So, loading files saved in the older version of OCFit (pickle format) is possible.

@pavolgaj
Copy link
Owner Author

Added new function FitDE for fitting using Differential Evolution from scipy (6478182). It's an alternative method to Genetic Algorithms in the FitGA function. DE should be a bit faster compared to GA because of internal converge control - not all iterations need to be run.

@pavolgaj
Copy link
Owner Author

@kolarjakubmuni:

Hi. I would suggest the possibility of fitting more than one phenomenon in the O-C diagram, e.g. parabolic change with apsidal motion, etc.

I just implement a new model called ApsidalQuad. I don't have any good data to test it but I don't expect any problems.

@kolarjakubmuni
Copy link

@kolarjakubmuni Interesting... The difference in O-Cs for primary and secondary for nearly 6 hours is something strange. Could you write some specifications for this system? Isn't it eccentric?

Yes, the difference is quite large. We don't know much about the system, it should be quadruple doubly eclipsing. So there is probably a combination with more effects and the system is probably eccentric. However, the secondary minima are very shallow and we need to confirm these differences (this is from the TESS data).

@pavolgaj
Copy link
Owner Author

pavolgaj commented Jun 1, 2022

Commit 2b6d743 solves the problem with eccentric orbits (#1). New function DeltaEpoch calculate phase (difference in epoch) for secondary minima from eccentricity and argument of pericenter. All classes have a new input parameter dE which is used to calculate epochs and types of minima.

@pavolgaj
Copy link
Owner Author

pavolgaj commented Jun 9, 2022

@kjkoeller I start to modify GUI. I just added some new buttons - so I had to make the main window a bit larger. Could you check if it looks good also on bigger screens (with set fixed=False - line 2908). If not, please, change screenheight on line 2916.

@pavolgaj
Copy link
Owner Author

Added function to calculate or estimate phase (difference in epoch) of secondary minima in GUI (81823d1). Estimation is done from the difference between O-Cs of primary and secondary minima.

@pavolgaj
Copy link
Owner Author

Added new window InfoMCMC in GUI. It can load saved sampling of MCMC or GA/DE fitting from a file and generate some figures useful for analysing sampling. Files generated by pymc are not supported! Only files from emcee could be used.

@pavolgaj
Copy link
Owner Author

pavolgaj commented Sep 20, 2022

Implemented new fitting methods (Robust Regression and MCMC) for FitLinear and FitQuad in GUI (537bb2e). Added new window FitParams for setting necessary parameters.

@pavolgaj
Copy link
Owner Author

Merged to master branch. Uploaded to PyPI. Created a new release.

@pavolgaj
Copy link
Owner Author

Added models LiTE3Apsidal and LiTE3ApsidalQuad (5f51946).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants