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

implement a fref #48

Merged
merged 13 commits into from
May 21, 2022
Merged

implement a fref #48

merged 13 commits into from
May 21, 2022

Conversation

md-arif-shaikh
Copy link
Collaborator

#43
Added

@md-arif-shaikh
Copy link
Collaborator Author

Screenshot from 2022-05-18 22-20-52

measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
@vijayvarma392
Copy link
Owner

vijayvarma392 commented May 18, 2022

More thoughts. Two other ways to compute the mean frequency come to mind:

  1. As we already have omega_p and omega_a interpolants, just take the mean of those?
  2. For residual methods, we could just use the zero ecc waveform.

For both of these approaches, no new interpolation is required.

@vijayvarma392
Copy link
Owner

And fref should be implemented as an input argument: Allow the user to pass either fref or tref_in, not both.
Allowing an array of frefs might be complicated because the user has to be careful about merger frequency, etc.
I think it's better to start implementing a scalar fref, which gets converted to a scalar tref in the init, and then everything goes through as before. This conversion can later be vectorized, but most users won't need that.

@md-arif-shaikh
Copy link
Collaborator Author

Using the omega_p and omega_a interpolants and taking the mean sounds nice. What do we call it?

@vijayvarma392
Copy link
Owner

vijayvarma392 commented May 18, 2022

Using the omega_p and omega_a interpolants and taking the mean sounds nice. What do we call it?

I suggest: omega22_average_between_extrema.
But don't remove your current function, it's worth having options, even if they are not turned on.

@md-arif-shaikh
Copy link
Collaborator Author

And fref should be implemented as an input argument: Allow the user to pass either fref or tref_in, not both. Allowing an array of frefs might be complicated because the user has to be careful about merger frequency, etc. I think it's better to start implementing a scalar fref, which gets converted to a scalar tref in the init, and then everything goes through as before. This conversion can later be vectorized, but most users won't need that.

I have implemented something along this line. But currently, it takes t_ref, and f_ref but if both are given t_ref is used. I can change this. Also, instead of get tref_in from given f_ref in the init, I do it at the beginning of the measurec_ecc and then everything follows

Looks like it's working for the test I did
Screenshot from 2022-05-19 10-16-09
Screenshot from 2022-05-19 10-16-32

@md-arif-shaikh
Copy link
Collaborator Author

Also added checks to see if the fref_in is within reasonable range
https://github.com/vijayvarma392/Eccentricity/blob/fref/measureEccentricity/eccDefinition.py#L204

@md-arif-shaikh
Copy link
Collaborator Author

if omega_average is monotonically increasing then we have a one to one map and even if a fref vector is provided we can get the corresponding tref_in and the current implementation should work without many additional changes. Only changes should be
change fref here https://github.com/vijayvarma392/Eccentricity/blob/fref/measureEccentricity/eccDefinition.py#L205 to fref[0] and later fref here to fref[-1] and make fref an array if it's a scalar here https://github.com/vijayvarma392/Eccentricity/blob/fref/measureEccentricity/eccDefinition.py#L202 using np.atleast_1d(fref)

@md-arif-shaikh
Copy link
Collaborator Author

Tried on fref array and it looks like working
Screenshot from 2022-05-19 14-38-26

@md-arif-shaikh
Copy link
Collaborator Author

I have added different averaging methods as option in extra_kwargs
Screenshot from 2022-05-19 15-58-42
Screenshot from 2022-05-19 15-59-01

measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
@md-arif-shaikh
Copy link
Collaborator Author

now the behaviour when one gives frequencies to measure ecc is exactly the same as when time is provided. It accepts scalar/array of frequencies, returns fref_out and measured ecc and mean anomaly

measureEccentricity/eccDefinition.py Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/measureEccentricity.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/eccDefinition.py Outdated Show resolved Hide resolved
measureEccentricity/measureEccentricity.py Outdated Show resolved Hide resolved
@vijayvarma392 vijayvarma392 merged commit a7bb01c into main May 21, 2022
@vijayvarma392 vijayvarma392 deleted the fref branch May 21, 2022 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants