04-19-2014 06:43 PM
Hi,
I need to plot a graph for two values (Power and Temperature). The two values come from two different spreadsheet files and both have a time stamp of when they were recorded. One of the files records data every 1 minute and the other records every 30 minutes. I require a graph to correlate the power against temperature but also taking into account the time of both recordings. Any ideas?
The data is basically like this;
Power 64, 64, 65, 69
Time 00.30.00 01.00.00 01.30.00 02.00.00
Temperature 10, 13, 11, 10
Time 00.01 00.02 00.03 00.04
Thanks
04-20-2014 12:11 PM
It is not clear what is giving you problems and what the question is::
Reading the files?
Correlating the data?
Graphing the data?
Please show us your current code so we can better see where we need to fill in the blanks. Thanks.
04-20-2014 12:22 PM - edited 04-20-2014 12:44 PM
It's correlating and graphing the data in the way I explained. Two files which contain recorded data and both were recorded at different time interval gaps (1minute and 30minutes). I would like to correlate the two data types with each other taking into account the time at which each reading of both files were recorded.
I do not have any code for this yet, becuase I am still unsure on how to proceed. I will obviously have the two spreadsheet files read in, and then index arrays to take the columns I need. The problem is how to correlate these. Is it possible to plot the two data types against each other, but also including the time that each recording was taken?
The temperature file has more data values than the power, because it is recorded every minute.
04-20-2014 12:45 PM
You can plot data points of Temperature vs Power, and use the color of the data points to show the evolution of these values over time. The following code will Parse your two data files, find the correlated time points, and then assign the data point a color ranging from black (earliest time point) to dark green to light green (latest time point). To get more color gradiation, you can use a rainbow or hot/cold color scheme instead of just 'greenness'. You might need to change the code slightly so that it reads the time format of your input file properly, depending on how you are recording it.
.
04-20-2014 12:53 PM
04-20-2014 01:23 PM
Patel:
The image is a VI snippet, a special type of *.PNG file, that you can drag it into LABview as code. I've attached the VI, regardless.
04-20-2014 01:57 PM
@Patel33 wrote:
It's correlating and graphing the data in the way I explained. Two files which contain recorded data and both were recorded at different time interval gaps (1minute and 30minutes). I would like to correlate the two data types with each other taking into account the time at which each reading of both files were recorded.
I do not have any code for this yet, becuase I am still unsure on how to proceed. I will obviously have the two spreadsheet files read in, and then index arrays to take the columns I need. The problem is how to correlate these. Is it possible to plot the two data types against each other, but also including the time that each recording was taken?
The temperature file has more data values than the power, because it is recorded every minute.
You still have not explained what you mean by "correlate" Are you talking about some mathematical or statistical analysis or do you simply want to plot both graphs, either keeping only the points where both contain data (or interpolate the missing data for the sparser data)? I would do a linear interpolation. Can you attach at least two typical datafiles? This should be trivial to solve.
(Personally, I would not do it as suggested by others here. Searching an array for DBLs is way too dangerous!)
I would create a time ramp mathcing the more freqeunt data then iterploate the sparse data using the same ramp and plot them against each other.
04-20-2014 04:46 PM
Yes, plotting them against each other to see the effect temperature causes to the power level at a certain time
04-20-2014 04:52 PM - edited 04-20-2014 05:14 PM
The radio data has three columns, the first two being some date/time format. What are the units of the second column?. The other file has two columns, the first is relative time in xx:yy format. What is the conversion between two two time formats?
Also, the weather data seem to start over several times. Does this need to be unwrapped?
04-20-2014 05:04 PM
The second column of the radio data is the time in the format hr.min.sec, so the first time in the table is 00.05.29.