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

Henry working #34

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Henry working #34

wants to merge 4 commits into from

Conversation

whtowbin
Copy link

Updated make_area function and added an automated_baseline function. I have 2 additional automated baseline algorithms that can be implemented as well.

I am still pretty unfamiliar with git but it says I made many more changes than I did. I only made additions to the spectra.py file and nothing else.

…on by Lucas Hermann Negri

Make Areas function has also been updated to use the scipy.integrate
trapezoidal and simpson integration functions
So some unkown reason scipy.integrate functions only work if imported in
method definition.
@EFerriss
Copy link
Owner

Exciting!! I won't have time to look at this for awhile, alas, but check the file endings of the stuff it says you changed. A lot of them might be .pyc files.

@EFerriss
Copy link
Owner

Hey, I'm about to:

  1. Add some small updates from my version that I think will help Anna out with her new issue.
  2. Issue a new release with only those updates, so that'll be pynams version 0.2.0
  3. Make all my olivine code, which uses pynams v0.2.0, public.
  4. Test and merge this pull request.

@EFerriss
Copy link
Owner

Hey @whtowbin - I looked at it a little bit. The updates to make_area and documentation look reasonable, but why not just include your automated baselines as options in make_baseline? That way you don't have to keep track of two different functions. I leave it to you and Anna to decide what you want the default to be.

Also, I think it will be a huge help if you could also update EXAMPLES.ipynb to include the new options and defaults for both baselines and areas.

As you're doing this - don't worry too much about legacy support for me. My paper will use v0.2.0, and going forward, you and Anna should make this the best thing you can for yourselves and others.

@EFerriss
Copy link
Owner

And don't worry about the conflicts between .pyc files. I think I know how to sort that out when it's all ready to merge.

@whtowbin
Copy link
Author

Thank you for the updates! I agree that is might be easier to just have one baseline function with several options. I left it separate for the time being because I actually have several other types of automated baseline and I was considering if there was a way to role them all into one. The current routine is good for most situations but sometimes conflicts with an automated peak fitting routine I have been working on.

For now it might be best to keep them separate until I figure out how best to sort them out.

I am happy to make examples. I will try to do it in the next few weeks.
Thanks again,
Henry

@EFerriss
Copy link
Owner

An automated peak fitting routine! Whoa! That's like the holy grail of pynams. You should check out the open source Matlab program (Google peakfit.m, I think) if you haven't already. There are a couple of commercial programs out there as well - I think one I've read about, maybe in one of Jannick Ingrin's olivine papers, is called PeakFit. I'm all about open-source, but if the existing pynams setup isn't good enough, it might not be worth a lot of your time if you can just buy something satisfactory for maybe not that much money.

I will wait to merge everything into master until you've sorted out what exactly you want to do and added examples (but Anna or whoever can still get the version from your branch if they want it), so just let me know when you want me to look at it again.

@whtowbin
Copy link
Author

Thanks for the tips. I started working on it for my quantitative data analysis class. So far its slow but works well for fitting highly overlapping peaks after you roughly identify the peaks you want to fit in one spectra. It uses Montecarlo methods to sample peak heights and widths and then makes error estimates based on a likelihood function.

At the moment the choice of baseline has a huge effect in my profiles where the baseline varies a lot from spectra to spectra in a profile. This might not be a problem for more straight-forward baselines. After I am done with my master's paper I should try it out on San Carlos.

My ultimate goal is to sample baselines in the Monte Carlo method so thats why I have come up with multiple automated baseline methods.

@EFerriss
Copy link
Owner

Super interesting. I look forward to seeing what you come up with.

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