Author |
Topic |
|
CNARC
2 Posts |
Posted - 08/22/2016 : 11:38:40 PM
|
Origin Ver. 9.0.0G SR1 Operating System: 64-bit Windows 7
Hello,
I am dealing a large file (>2GB) with CSV imported data. It contains over 600cols where the timeinterval for 2 rows is 1 second.
I am trying to do some calcs now, as Energy consumption for example: 1. Intgrate the Col 2. Get the max value of the Col 3. Multiply the result by 24 to change the result from "kw*day" to "kW*hour"
This previously works fine with: 1. Use "Integrated" for evry single Col 2. Use "DescStatOnCol" to get the maximum value 3. Create a new Col to to the calculation (Fill Col Value with)
But this creates a big bunch of data (the Integrated Book double the file size).
So the idea was to make it more simple.
I go to a new workbook and create a script in "Fill Col Value with" as follows:
script before formula: range r0 = [A2012111]1!Col(1); range r1 = [A2012111]1!Col(219); range r2 = [A2012111]1!Col(220); range r3 = [A2012111]1!Col(221); range r4 = [A2012111]1!Col(222); (continued for more than 300 cols!)
calculation:
Max(IntegrateXY(r0,r1))*24 (where for every single cell the "r1" increases.
Recalculaton Method is set to AUTO.
This also works fine if I apply it first time.
But when I add or remove some rows from the book "[A2012111]1!" it goes to hell. Only rows are added, the Col assignment isn't changed.
Then it reports a lot of "undefined variables" like: Variable nicht definiert: _¡ Variable nicht definiert: _¢ Variable nicht definiert: _£ Variable nicht definiert: _¤ Variable nicht definiert: _¥
Any idea?
|
|
Shirley_GZ
China
Posts |
Posted - 08/23/2016 : 03:14:44 AM
|
Hi,
I have done some testings here by following your latter method, but failed to reproduce the problem.
Here, I will suggest you to try our Batch Processing tool to deal with such large file: 1. Follow the steps of former method to do calculations on one XY dataset firstly, and save the workbook as an Analysis Template. 2. And then use this Analysis Template to do batch processing for all existing XY datasets.
For details, please follow the tutorial below: http://www.originlab.com/doc/Tutorials/Batch-Processing-Multiple-Datasets-using-Analysis-Template
If you have any problem, please let me know.
Thanks, Shirley
Originlab Technical Service Team |
Edited by - Shirley_GZ on 08/23/2016 03:15:39 AM |
|
|
CNARC
2 Posts |
Posted - 08/23/2016 : 05:40:24 AM
|
Hi Shirley,
thanks a lot for your reply!
I try with the BATCH TOOL, but then the result is just like the old way, because I get "Integrated Col" for every selected Input Col. This is too big data for me.
I just want that the result is calculated but without creating the seperate "Integrated Col". Thatswhy I try to include it into the "Fill Col Value with" and there directly let calculate only the MAX value of the "Integrated Col", which is in fact nothing else but the AREA below the graph.
When I for example just do the integration into report, but without selecting "output", I just receive the protocol. There I can find the result what I want called "area".
Here is an example:
quote:
[23.08.2016 17:18:42 "" (2457623.721319)] integ1 Input iy = ["data"]data!(TIME"Date, Time",A3EH1actualpowe"43EH1_P_B") baseline = 0 type = 0 (math:Mathematical Area) plot = 0 (none:None) rescale = 0 Output x1 = 2457616.5 x2 = 2457618.7499878 i1 = 1 i2 = 194400 area = 160.12512920901 y0 = 77.9809 x0 = 2457616.7515033 dx = 25.498428356368
The "area" is now the same like the result of the formula "Max(IntegrateXY(r0,r1))". But how to do it without the use of range variable?
I mean how I can do a script for a cell, that execute the function "integ1" and put the "area" into a new workbook cell? |
|
|
Shirley_GZ
China
Posts |
Posted - 08/23/2016 : 06:39:23 AM
|
Hi,
Actually, when you use Batch Processing, once you checked the checkbook "Delete Intermediate Workbook", all the intermediate results(including "Integrated Col") will not be output. Maybe there are some misunderstandings on how to create an simpler Analysis Template. Could you send us your template file(ogw file) and some sample files to let us check further?
Additionally, about how to get the "area" value directly after integration, please try the sample code below after the source data has been imported:
//make sure Book1 has been created before running this script.
range rr = [Book1]1!1;
int nn = 1;
//loop all datasets in current project.
doc -e DY
{
integ1 -sl iy:=%c oy:=<optional>; //integrate the current dataset
rr[$(nn)] = integ1.area*24; //get the area value and multiply by 24
nn++;
}
Thanks, Shirley
Originlab Technical Service Team |
Edited by - Shirley_GZ on 08/23/2016 06:40:22 AM |
|
|
|
Topic |
|
|
|