| T O P I C R E V I E W |
| Herbert |
Posted - 12/14/2000 : 05:46:42 AM Hello,
I’m trying to transfer my LabTalk scripts from Origin 5 to Origin 6.1. At present my problem is the curve object.
In Origin 5, I used this object with the following script to pick the peaks from a dataset and write the position of the peak maximum and the baseline markers in two columns:
worksheet -t 1 4; worksheet -c Peak; worksheet -c PkRange; curve.data$=%H_Data; curve.i1=1; curve.pickPeaks.simple=0; curve.minHeight=0.1; curve.minpeakrange=0.01; curve.maxpeakrange=0.08; curve.peakIndex$=%H_Peak; curve.markerindex$=%H_PkRange; curve.x$=%H_A; curve.pickPeaks();
The dataset of 500 data points was stored in column A (x values) and column Data (y values). In Origin 5, this script produces two new columns (Peak and PkRange) in the active window, which hold the indexes of the peak maxima and the indexes of the baseline markers.
In Origin 6.1, the script only produces two empty new columns. Can you tell me, what has changed in the syntax of the curve object that I have to change to get the script working in origin 6.1 ? I enclose the dataset I used to test the script. Thanks for any help.
200.639 9 200.644 -7 200.649 -3 200.655 3 200.66 -13 200.666 0 200.671 -7 200.676 -8 200.681 9 200.687 -9 200.692 27 200.697 5 200.703 -2 200.708 -6 200.714 7 200.719 -14 200.724 -10 200.73 19 200.735 6 200.741 -10 200.746 4 200.751 -5 200.756 -4 200.761 2 200.767 15 200.772 -4 200.778 -10 200.783 -3 200.788 0 200.794 7 200.799 0 200.805 -3 200.809 1 200.815 -4 200.82 -2 200.826 -2 200.831 0 200.836 5 200.842 2 200.847 0 200.853 -2 200.858 5 200.863 0 200.868 -8 200.873 0 200.879 -4 200.884 0 200.89 0 200.895 2 200.901 -13 200.906 3 200.911 1 200.916 67 200.921 1 200.927 8 200.932 -6 200.938 0 200.943 -4 200.948 3 200.953 -8 200.958 0 200.964 0 200.969 1 200.975 0 200.98 -11 200.985 1 200.991 7 200.996 18 201.001 12 201.006 2 201.012 -6 201.017 -7 201.023 0 201.028 -10 201.033 4 201.038 5 201.043 2 201.049 -6 201.054 -6 201.06 2 201.064 0 201.07 -5 201.075 -1 201.08 1 201.086 -7 201.091 0 201.097 -3 201.101 1 201.107 -11 201.112 2 201.118 1 201.123 -1 201.128 -3 201.133 -2 201.138 12 201.144 102 201.149 113 201.155 23 201.159 13 201.165 80 201.17 37 201.176 2 201.181 -1 201.186 -2 201.191 33 201.196 35 201.202 37 201.207 62 201.213 61 201.217 19 201.223 0 201.228 5 201.233 4 201.239 -7 201.243 5 201.249 8 201.254 3 201.26 -5 201.265 -1 201.27 -2 201.275 -9 201.281 -1 201.286 -1 201.291 0 201.296 0 201.301 -6 201.307 5 201.312 2 201.318 0 201.322 -5 201.328 -11 201.333 1 201.338 -6 201.343 -9 201.349 -12 201.354 -8 201.359 -4 201.365 -4 201.369 1 201.375 -4 201.38 0 201.386 0 201.39 0 201.396 -5 201.401 -8 201.406 -2 201.411 25 201.417 87 201.422 26 201.427 10 201.433 -3 201.437 0 201.443 -2 201.448 -5 201.454 14 201.458 0 201.464 -2 201.469 -3 201.474 -1 201.479 3 201.484 -2 201.49 -9 201.495 -2 201.5 6 201.505 -3 201.511 0 201.515 -8 201.521 -6 201.526 1 201.532 3 201.536 -7 201.542 -4 201.547 -6 201.552 -5 201.557 -3 201.563 0 201.568 -5 201.573 0 201.578 -3 201.583 3 201.589 2 201.593 23 201.599 18 201.604 0 201.609 -1 201.614 -7 201.62 0 201.625 -2 201.63 54 201.635 -4 201.641 -10 201.645 -3 201.651 -8 201.656 -3 201.661 1 201.666 -4 201.671 -7 201.677 0 201.681 -4 201.687 0 201.692 -1 201.697 -6 201.702 -5 201.708 0 201.712 -5 201.718 -2 201.723 1 201.728 2 201.733 -7 201.739 -10 201.743 -15 201.749 -5 201.754 -9 201.759 -6 201.764 1 201.77 -4 201.775 0 201.78 0 201.785 0 201.79 -6 201.795 7 201.8 39 201.806 0 201.81 0 201.816 5 201.821 -2 201.826 4 201.831 9 201.836 -4 201.841 0 201.847 3 201.851 -15 201.857 -4 201.862 5 201.867 -1 201.872 5 201.878 -1 201.882 -10 201.888 -5 201.893 -2 201.898 -7 201.903 -1 201.909 -4 201.913 -1 201.919 -5 201.923 -5 201.929 -1 201.934 11 201.939 -4 201.944 4 201.95 -3 201.954 -1 201.96 -3 201.964 0 201.97 0 201.975 1 201.98 -1 201.985 4 201.99 -6 201.995 -11 202.001 -7 202.005 1 202.011 0 202.016 -7 202.021 1 202.026 5 202.031 1 202.036 -5 202.041 -10 202.046 1 202.051 1 202.056 0 202.062 -6 202.067 -4 202.072 7 202.077 106 202.082 51 202.087 6 202.092 -11 202.097 -7 202.102 -6 202.107 0 202.113 -1 202.118 -4 202.124 0 202.13 0 202.135 -5 202.14 -7 202.146 1 202.151 -7 202.157 -3 202.162 1 202.167 -8 202.173 6 202.178 0 202.184 0 202.189 -5 202.194 1 202.2 -6 202.205 -5 202.211 -3 202.216 0 202.221 3 202.227 1 202.232 2 202.238 -3 202.243 -11 202.248 0 202.254 -5 202.259 -3 202.265 12 202.27 4 202.276 -7 202.282 -2 202.287 -6 202.293 0 202.298 -7 202.303 1 202.309 -7 202.314 -7 202.32 6 202.325 3 202.33 -6 202.336 -4 202.341 -4 202.347 -5 202.352 -3 202.357 -1 202.363 -2 202.368 -5 202.374 0 202.379 11 202.384 1 202.39 8 202.395 25 202.401 -1 202.406 0 202.411 -7 202.417 -5 202.422 5 202.428 80 202.433 48 202.438 4 202.443 11 202.449 3 202.454 -2 202.459 -2 202.465 0 202.47 -5 202.476 15 202.481 12 202.486 0 202.492 -5 202.497 -3 202.503 -13 202.508 -6 202.513 -3 202.519 -4 202.524 3 202.53 3 202.535 20 202.54 -7 202.546 -3 202.551 -6 202.557 -6 202.562 -8 202.568 8 202.573 0 202.578 -8 202.583 -7 202.588 -2 202.594 -8 202.599 -2 202.605 -1 202.61 -8 202.615 1 202.621 0 202.626 2 202.632 20 202.637 0 202.642 -3 202.648 -6 202.653 -9 202.659 -7 202.664 -3 202.669 -7 202.674 -4 202.68 -6 202.685 -2 202.69 -1 202.696 -1 202.701 -1 202.707 0 202.712 6 202.717 -4 202.723 0 202.728 -6 202.733 5 202.738 -5 202.744 1 202.749 1 202.754 1 202.76 -5 202.765 0 202.771 3 202.776 2 202.781 -1 202.787 0 202.792 -3 202.797 4 202.802 -1 202.808 -6 202.813 -1 202.819 -2 202.824 3 202.829 -6 202.835 -5 202.839 0 202.845 -1 202.85 -1 202.856 6 202.861 -2 202.866 -5 202.872 10 202.877 -9 202.882 -2 202.887 0 202.893 0 202.898 -8 202.904 -7 202.909 -12 202.914 -5 202.92 -9 202.924 4 202.93 -5 202.935 -11 202.941 10 202.946 -1 202.951 0 202.957 -8 202.961 10 202.967 -1 202.972 -5 202.978 -2 202.983 2 202.989 0 202.994 55 202.999 2 203.004 1 203.009 -2 203.015 0 203.02 0 203.026 3 203.03 0 203.036 5 203.041 3 203.046 3 203.052 -2 203.057 -6 203.062 -10 203.067 -7 203.073 0 203.078 8 203.084 -3 203.089 1 203.094 -3 203.099 -6 203.104 6 203.11 1 203.115 -1 203.12 -1 203.125 -3 203.131 -2 203.136 -1 203.141 -5 203.147 -3 203.151 1 203.157 0 203.162 8 203.168 0 203.173 -2 203.178 -5 203.183 -6 203.189 -2 203.194 -2 203.199 -4 203.204 -5 203.209 -5 203.215 4 203.22 -1 203.226 1 203.23 3 203.236 -1 203.241 0 203.247 -8 203.251 4 203.257 -4 203.262 -8 203.267 -4 203.273 -10 203.277 -7
|
| 1 L A T E S T R E P L I E S (Newest First) |
| Gary Lane |
Posted - 12/14/2000 : 3:36:58 PM Hi,
The internal algorithm used by the curve object to pick peaks was improved in Origin 6.0 but now requires a baseline dataset. The following script based on your script and the Origin 6.0 SR4 (and Origin 6.1) Baseline Tool implemented in the script file BASELINE.OGS computes peaks for your dataset:
worksheet -c baseX; worksheet -c baseY; worksheet -c Peak; worksheet -c PkRange; worksheet -t 1 4; worksheet -t 3 4;
curve.reset(); curve.worksheet$=%H; curve.data$=%H_Data; curve.x$=%H_A; curve.basex$=%H_baseX; curve.basey$=%H_baseY; curve.base$=%H_baseY; curve.peakIndex$=%H_Peak; curve.markerindex$=%H_PkRange; curve.i1=1; curve.i2=501;
curve.baselinePts=10; curve.baseline.fittype=2; curve.baseline();
curve.pickPeaks.simple=0; curve.minHeight=.01; curve.minpeakrange=.01; curve.maxpeakrange=.40; curve.pickPeaks();
The following script is based on the Origin 6.0 SR4 (and Origin 6.1) Pick Peaks Tool implemented in PICKPEAK.OGS and computes peaks for your data as well:
curve.reset(); worksheet -c Pkindex; curve.data$=%H_Data; curve.peakIndex$=%H_PkIndex; curve.pickPeaks.rectHeight=.05; curve.pickPeaks.rectWidth=.05; curve.pickPeaks.minHeight=.05; curve.pickPeaks(1);
I hope this is helpful.
-Gary
Edited by - Gary Lane on 12/14/2000 15:41:11 |
|
|