CONTIN and Igor Pro

Hallo everybody,

Has anyone implemented the CONTIN (or comparable alternate) algorithm
of S. Provencer for regularized solutions to ill-posed inversions of integral equations
using Igor?

Thanks
Sven
Sven,

I don't know that anyone has ported CONTIN to Igor. Have you looked at Provencher's web site ( http://s-provencher.com/pages/contin.shtml)? Provencher does provide his FORTRAN source code as well as compiled versions for Windows and Linux. I have successfully used his Windows version (or maybe I compiled it from his source with and old MS FORTRAN compiler, I don't quite remember). It runs in a DOS window and so is easily called from Igor. You can use Igor to prepare your data and assemble the input parameter set and then feed it to CONTIN. You'll then have to figure out what to do with the output from CONTIN, because it is still in the "Classic CONTIN" output style: a mix of numeric values and ASCII graphics. This is saved in a text file by CONTIN.

I can send you what I put together long ago to assemble the input file, but as I recall it is far too unnecessarily complex.

Jeff
I suppose it could depend on what you want to do with it. I'm very sceptical about the application of contin for dynamic light scattering applications. I reckon fitting a generalized exponential distribution (gex) is a much better idea. There is code for that on igorexchange.
If you need it for something else then 1) the fortran code could be translated to Igor b) one could use f2c to make an xop.
Thanks for your reply.
I want to use the CONTIN not only for dynamic light scattering data, I will use it for general.
I am not a programmer, so please can you post a compiled version on web, which I can use under Mac?

And furthermore, I could not find generalized exponential distribution (gex) on the Igor website.
So , please can you also post it there?

Thanks!
Take a look at the Linux version posted on Provencher's site. May it is compatible with the Mac?
jtigor,

of course this linux code is not compatible with mac.
Maybe there is somebody who can port this fortran code to c, which can then be implemented to igor file?
Sven wrote:

Maybe there is somebody who can port this fortran code to c, which can then be implemented to igor file?

A programmer who knows what they're doing, and has a FORTRAN compiler can include FORTRAN in an XOP. You have to be aware of function naming conventions, and parameter-passing conventions.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
You may have right, but I am not a programmer. So therefore I post this feature request here, is anybody is so kind and willing to transform the
Fortran code into Igor code.
I think if you can implement this feature in the next release you will be ahead in the game, because a lot of scientific problems a dealing with
that inverse Laplace transformation (dynamic light scattering, NMR, etc.)
Well, I contacted the author (Stephen Provencher) and he tells me that CONTIN is free to use, as long as we include proper citation for him and CONTIN. So that excuse is gone, now finding time...

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Dear John,

thanks for contacting the author Steven Provencher.
It would be a great thing to implement this CONTiN-feature in the next Igor update with the nice output features as already in the FFT routine.
I completely undertstand that this programming costs time, but I think a lot of scientists would be thankful, because I know that this
inverse laplace transform feature is a suitable tool in many scientific problems, as I already pointed out above.
And, otherwise, no other good plotting program has this feature implemented, only the commercial software that belongs to the apparatus, as e.g. in dynamic light scattering.

It would be nice, if you could help...
SVen


Sven wrote:
Dear John,

thanks for contacting the author Steven Provencher.
It would be a great thing to implement this CONTiN-feature in the next Igor update with the nice output features as already in the FFT routine.
I completely undertstand that this programming costs time, but I think a lot of scientists would be thankful, because I know that this
inverse laplace transform feature is a suitable tool in many scientific problems, as I already pointed out above.
And, otherwise, no other good plotting program has this feature implemented, only the commercial software that belongs to the apparatus, as e.g. in dynamic light scattering.

It would be nice, if you could help...
SVen

I have added it to the Wish List. I make no promises... :)
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Dear John,

that would be great, if you can implement this feature. If you wish, that I check this routine, I can do this.

Sven
naderinst wrote:
Dear jtigor
I am doing a project by contin.
Is it possible to help me.


I can try. What sort of assistance do you need?
jtigor wrote:
Sven,

I don't know that anyone has ported CONTIN to Igor. Have you looked at Provencher's web site ( http://s-provencher.com/pages/contin.shtml)? Provencher does provide his FORTRAN source code as well as compiled versions for Windows and Linux. I have successfully used his Windows version (or maybe I compiled it from his source with and old MS FORTRAN compiler, I don't quite remember). It runs in a DOS window and so is easily called from Igor. You can use Igor to prepare your data and assemble the input parameter set and then feed it to CONTIN. You'll then have to figure out what to do with the output from CONTIN, because it is still in the "Classic CONTIN" output style: a mix of numeric values and ASCII graphics. This is saved in a text file by CONTIN.

I can send you what I put together long ago to assemble the input file, but as I recall it is far too unnecessarily complex.

Jeff


Jeff
I planned to rewrite CONTIN to C++, Can you give me some examples and show me how to use the original contin-window.exe? This will do great help to results check. Thx!
tonyzhang316 wrote:
Jeff
I planned to rewrite CONTIN to C++, Can you give me some examples and show me how to use the original contin-window.exe? This will do great help to results check. Thx!


Tony,

If you have the Windows version of Provencher's CONTIN program you have probably visited this link: http://s-provencher.com/pages/contin.shtml

Item 7 on his download list (found at the link given previously) provides two test data sets; the output from these data sets are given at the end of the manual (contin-manual2.pdf ) in item 3 of the download list.

Item 1 on the download list gives a brief recipe for running CONTIN form Linux or Windows, but it does assume some familiarity with executing a program from the command line.

I hope this provides a starting point for you. If you have more specific questions, I'll do my best to answer them.

I added an Igor notebook where I tried to summarize information on parameters used to create an input file for CONTIN. My application was dynamic light scattering, so the information provided in this file is skewed in that direction.
Contin help file.ifn
jtigor wrote:


Tony,

If you have the Windows version of Provencher's CONTIN program you have probably visited this link: http://s-provencher.com/pages/contin.shtml

Item 7 on his download list (found at the link given previously) provides two test data sets; the output from these data sets are given at the end of the manual (contin-manual2.pdf ) in item 3 of the download list.

Item 1 on the download list gives a brief recipe for running CONTIN form Linux or Windows, but it does assume some familiarity with executing a program from the command line.

I hope this provides a starting point for you. If you have more specific questions, I'll do my best to answer them.

I added an Igor notebook where I tried to summarize information on parameters used to create an input file for CONTIN. My application was dynamic light scattering, so the information provided in this file is skewed in that direction.


Jeff,
I've downloaded item1-7 on s-provencher.com, including contin-windows.exe&contin.in(the data set). But I'm not familiar with command line,that's the problem.
I studied some basic DOS command these days and glanced at cpc2. Still, I've no idea about how to involve the contin.in into contin-windows.exe.
BTW, How can I open the *.ifn files.When open with notepad, many ???-liked characters appears.

Pls give me the command lines in DOS which process contin.in with Contin-windows.exe. Many THX!
jtigor wrote:
tonyzhang316 wrote:
Jeff
I planned to rewrite CONTIN to C++, Can you give me some examples and show me how to use the original contin-window.exe? This will do great help to results check. Thx!


Tony,

If you have the Windows version of Provencher's CONTIN program you have probably visited this link: http://s-provencher.com/pages/contin.shtml

Item 7 on his download list (found at the link given previously) provides two test data sets; the output from these data sets are given at the end of the manual (contin-manual2.pdf ) in item 3 of the download list.

Item 1 on the download list gives a brief recipe for running CONTIN form Linux or Windows, but it does assume some familiarity with executing a program from the command line.

I hope this provides a starting point for you. If you have more specific questions, I'll do my best to answer them.

I added an Igor notebook where I tried to summarize information on parameters used to create an input file for CONTIN. My application was dynamic light scattering, so the information provided in this file is skewed in that direction.



My Question:
Problem.txt
Tony,

I apologize for the slow response.

The y values of the input data set are modified in CONTIN's USERIN function, according to the nature of the problem, to get the input data into a form expected by CONTIN. See section 4.2 (Data Preprocessing in USERIN) in Computer Phy Comm 27 229-242 for more information. This is cpc2.pdf on Provencher's web site.

The first test data set is for photon correlation spectroscopy where the input data is a normalized second order correlation function minus one. CONTIN operates on the normalized first order correlation function. The input parameter RUSER10 controls the operation of USERIN. When RUSER10 < 0 (as is the case for the first test data set), the y are replaced by squareroot(y).

Have you determined how to run CONTIN from the command line? If not, let me know and I'll send details on how to do that.

Hope this helps.

Jeff
jtigor wrote:
Tony,

I apologize for the slow response.

The y values of the input data set are modified in CONTIN's USERIN function, according to the nature of the problem, to get the input data into a form expected by CONTIN. See section 4.2 (Data Preprocessing in USERIN) in Computer Phy Comm 27 229-242 for more information. This is cpc2.pdf on Provencher's web site.

The first test data set is for photon correlation spectroscopy where the input data is a normalized second order correlation function minus one. CONTIN operates on the normalized first order correlation function. The input parameter RUSER10 controls the operation of USERIN. When RUSER10 < 0 (as is the case for the first test data set), the y are replaced by squareroot(y).

Have you determined how to run CONTIN from the command line? If not, let me know and I'll send details on how to do that.

Hope this helps.

Jeff


THX very much!The cpc2.pdf is very usefull.
I've get the output.But in the output file, there are lots of spectrum, which one is the best?
Is the last one the best? Tell me how to chose the solution,Pls...
Yes, the solution that best satisfies the test criteria is printed again at the end and is labeled as the Chosen Solution. The test output also shows an overlay of the input data and the calculated results along with a plot of the residuals for the chosen solution. The chosen solution is the solution with a value called "Prob1 To Reject" closest to 0.5.

The input parameter "IPRINT" controls which solutions are output. For example if you set
IPRINT 0,0
the standard solutions will not be output; however the chosen solution will be output.

Parameters used to control output:
PRY
PRWT
IPRINT
ONLY1
IPLRES
IPLFIT
IUSROU -- This could be useful as it controls calling a function ("USEROU") that you can write for special purpose outputs in the same way as IPRINT.
DOMOM
MOMNMX
MPKMOM
DOCHOS