data to graph

Code junkies hangout here

Moderators: ChriThor, LXF moderators

data to graph

Postby ilias » Mon Sep 25, 2006 11:26 am

There is a site which has usefull info that I want to display on a graph
This is the site:

and because it won't us see it, because it requires a series of steps to calculate the final result, here is a sample of the output.

1987, 12, 16, 08:00, 0
1987, 12, 16, 09:00, 1104
1987, 12, 16, 10:00, 1853
1987, 12, 16, 11:00, 1997
1987, 12, 16, 12:00, 1863
1987, 12, 16, 13:00, 1322
1987, 12, 16, 14:00, 571
1987, 12, 16, 15:00, 452
1987, 12, 16, 16:00, 72
1987, 12, 16, 17:00, 0

The format is as follows
"Year", "Month", "Day", "Hour", "AC Power (W)"

I know basic C and C++ programming.
of course I'm using GNU/Linux

Here's the case; I need a program that will automatically read the data displayed on the site and it will be able to print the data on a graph.
Any help?
Posts: 69
Joined: Mon Jun 06, 2005 10:38 am

RE: data to graph

Postby Steogede » Mon Sep 25, 2006 3:30 pm

If you know some C and C++, you should probably be able to pickup enough PHP to do it in PHP. Using say curl to download the page and explode on each line to convert each comma separated into an array (there are problably more steps involved). It really depends how automated you want it to be. The simple option is to save them all into a text file, load it into into Calc as a CSV (comma separated values) file and then create your graph.

BTW what is your project, it seems quite interesting.
LXF regular
Posts: 146
Joined: Thu May 04, 2006 5:39 pm

RE: data to graph

Postby ilias » Mon Sep 25, 2006 4:28 pm

Depending on the number of Solar Modules installed and based on several other factors (inverter effeciency, sun positioning, solar tracking system, effeciency of the solar modules, etc) the daily power production is displayed. I will perform such an installation and I'm investigating the steps required to get a preffered amount of power.
Probably the steps involved in the process is as you point them out to be. I'm interested in the final result and also due to the vast ammount of data (daily production of power from solar modules for about a 20-years period) I simply can't enter the data to whatever program will generate the graph by hand.
So I would greatly appreciate it if you could be more detailed.
By the way what "cgi" stands for?
It's the web page pointed on the first message. I usually see html pages. Is there anything special about cgi?
Posts: 69
Joined: Mon Jun 06, 2005 10:38 am

RE: data to graph

Postby ollie » Tue Sep 26, 2006 12:31 am

CGI - Common Gateway Interface. This is server side scripting, usually in Perl, that is processed by the server before sending the HTML output to the client (web browser). The idea was to develop a common interface regardless of the type of web server - but someone decided they didn't like the idea and developed ASP.

PHP (PHP Hypertext Preprocessor) and even JavaScript can also be used for CGI scripting. PHP was designed for the Internet and is probably the most common server side scripting language used over the Internet - although Python is becoming very popular.
Posts: 2749
Joined: Mon Jul 25, 2005 11:26 am
Location: Bathurst NSW Australia

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests