Code Monkey home page Code Monkey logo

thin-film-mlines-fit's People

Contributors

belaloui avatar

Watchers

 avatar

thin-film-mlines-fit's Issues

Single fitting function with choice of parameters

Get rid of the multiple hardcoded fitting functions and write a single one with dynamic parameters where the fixed parameters are specified with their respective values, and the free parameters are specified with their boundaries.

It may be useful to load these parameters from a file.

Refactor 'reflection_fit.py'

  • Put the fitting functions in a separate file.
  • Add a selection for the fitting methods: between Scipy and PyGad.
  • Add a selection for Rp and Rs.
  • Add a selection for background removal. (will need a transfer curve)
  • Add a verbose mode. (With callback functions in the fitting part)
  • Print the results at the end of the script.
  • Save the data in a file.
  • Fix the plots accordingly.

Load model from file

The model's file should include the fixed parameters and the bounds for the free parameters.

Write a README file

Explain in some detail what the problem we're solving is, and what we have implemented in the code, as well as a small tutorial on how to use it.

Add options and arguments to the script

This should include the curve data, polarization, fitting method, curve correction with background data, and so on.

An explicit list of tasks needs to be written down here.

Add data to the repository

The newest data needs to be added to the repository both for availability and to make testing the code as it is refactored easier.

Add R² value to the results

Code from SO:

popt, pcov = curve_fit(f, xdata, ydata)
residuals = ydata- f(xdata, *popt)
ss_res = numpy.sum(residuals**2)
ss_tot = numpy.sum((ydata-numpy.mean(ydata))**2)  
r_squared = 1 - (ss_res / ss_tot)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.