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

Calling all ACF fitting algorithms from the make_fit binary #504

Merged
merged 18 commits into from
Jul 27, 2022

Conversation

ecbland
Copy link

@ecbland ecbland commented May 21, 2022

This PR allows make_fit to call any of the following fitting algorithms: fitacf3, fitacf2, lmfit1, fitex2 and fitex1. This change was discussed briefly at our last WG meeting, and I thought it was worth having a look at the code before we discuss it again at the SuperDARN workshop. It was an easy modification and removes a lot of duplicated code.

Examples:

make_fit -fitacf2 20180323.0801.00.lyr.rawacf > 20180323.0801.00.lyr.fitacf2

make_fit -lmfit1 20180323.0801.00.lyr.rawacf > 20180323.0801.00.lyr.lmfit

make_fit 20180323.0801.00.lyr.rawacf > /dev/null
Please specify a fitting algorithm

As you can see in the last example, there will be an error if the user does not specify which algorithm to use, so there is no "default" fitting algorithm on this branch.

@ecbland ecbland marked this pull request as draft May 21, 2022 17:19
Co-authored-by: Evan Thomas <evan.g.thomas@dartmouth.edu>
@ecbland ecbland added this to the RST 5.0 milestone May 23, 2022
@ecbland
Copy link
Author

ecbland commented Jun 3, 2022

Thanks for the productive discussion about this change during yesterday's DAWG meeting!

Here's my to-do list for this PR:

  • Make separate command line options for each fitting algorithm Shorter name for the -fitting-algorithm command line option
  • Update readthedocs tutorials to reflect the new behaviour of make_fit
  • Add a very brief description (2 sentences + reference) for each fitting algorithm to readthedocs
  • Add warning message to the documentation that fitex1 has not been tested thoroughly
  • Add warning to documentation that fitex1 and lmfit1 do not include elevation angles
  • Link the command line help to the readthedocs tutorial ("more information available here: ...")

@aburrell
Copy link
Contributor

aburrell commented Jun 3, 2022

Potential shorter names:

  • -fitalg
  • -falg
  • -alg
  • -fit-alg (my favourite)

@egthomas
Copy link
Member

egthomas commented Jun 3, 2022

Potential shorter names:

  • -fitalg
  • -falg
  • -alg
  • -fit-alg (my favourite)

Great suggestions @aburrell: -alg would be my vote from that list.

An alternative could be for each fitting algorithm to be associated with its own option (e.g., -fitex2, -fitacf3, etc) similar to how map_addmodel handles things, although would require a slightly different implementation.

@ecbland
Copy link
Author

ecbland commented Jun 3, 2022

An alternative could be for each fitting algorithm to be associated with its own option (e.g., -fitex2, -fitacf3, etc) similar to how map_addmodel handles things, although would require a slightly different implementation.

@egthomas That's a good suggestion that requires a lot less typing from the user (and nice that it matches map_addmodel).

@mtwalach
Copy link
Contributor

mtwalach commented Jun 6, 2022

An alternative could be for each fitting algorithm to be associated with its own option (e.g., -fitex2, -fitacf3, etc) similar to how map_addmodel handles things, although would require a slightly different implementation.

@egthomas That's a good suggestion that requires a lot less typing from the user (and nice that it matches map_addmodel).

I think I would favour this as it's in line with map_addmodel.

@ecbland ecbland marked this pull request as ready for review June 6, 2022 20:14
@ecbland
Copy link
Author

ecbland commented Jun 6, 2022

Thanks everyone for your input! This PR is now ready for review. I have modified the command line options based on @egthomas's suggestion, and edited the examples above to reflect that change.

I also updated the make_fit tutorial on readthedocs. You can preview the changes here.

@pasha-ponomarenko
Copy link
Contributor

pasha-ponomarenko commented Jun 6, 2022 via email

docs/user_guide/make_fit.md Outdated Show resolved Hide resolved
Emma Bland and others added 2 commits July 7, 2022 15:41
@ecbland ecbland marked this pull request as draft July 8, 2022 12:56
@ecbland
Copy link
Author

ecbland commented Jul 8, 2022

I've marked this PR as a draft since it will be easier to resolve the conflicts after merging #512.

If anyone is planning other changes that might create conflicts with this PR, please get in touch!

@ecbland ecbland mentioned this pull request Jul 8, 2022
@egthomas
Copy link
Member

egthomas commented Jul 8, 2022

@ecbland the tdiff changes are likely on a slower timeline (and require more discussion) than these changes, so I wouldn't be opposed to merging this pull request first and then cleaning up any conflicts on the tdiff pull request.

@ecbland ecbland marked this pull request as ready for review July 9, 2022 06:57
@egthomas
Copy link
Member

So I took a crack at adding lmfit2 to the new make_fit on this branch, and there are a lot of conflicts with similarly named (but slightly different) functions and structures in the fitacf3 library.

@ecbland, do you see an easy way forward? Maybe lmfit2 could be added later?

@ecbland
Copy link
Author

ecbland commented Jul 20, 2022

So I took a crack at adding lmfit2 to the new make_fit on this branch, and there are a lot of conflicts with similarly named (but slightly different) functions and structures in the fitacf3 library.

@ecbland, do you see an easy way forward? Maybe lmfit2 could be added later?

@egthomas Yep, I bumped into this problem as well :(
There must be a solution here, but I don't have one yet. I'm all in favour of adding lmfit2 later in a separate PR.

@pasha-ponomarenko
Copy link
Contributor

I'm all in favour of adding lmfit2 later in a separate PR.

@ecbland , I second this.

@egthomas
Copy link
Member

Thanks @ecbland and @pasha-ponomarenko. This looks good to me, although since this is a fairly significant restructuring maybe someone else should test again too.

@egthomas
Copy link
Member

@ecbland well it's been a week, is it alright if I go ahead and merge this?

@ecbland
Copy link
Author

ecbland commented Jul 27, 2022

@ecbland well it's been a week, is it alright if I go ahead and merge this?

@egthomas Yes, I think it's time to merge 👍

@egthomas egthomas merged commit 7c9d1d5 into develop Jul 27, 2022
@egthomas egthomas deleted the feature/make_fit branch July 27, 2022 18:00
@ecbland ecbland mentioned this pull request Oct 28, 2022
17 tasks
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.

5 participants