LSIR / gsn

Global Sensor Networks
GNU General Public License v3.0
58 stars 43 forks source link

Chart VS history-size does not count null values #11

Closed sarni closed 9 years ago

sarni commented 10 years ago

I had noticed something a bit strange about the way that ChartVS portrays data that includes null values.

In the screenshot, you will see that the plot for V178 which is pretty much complete starts at a bit after midnight while the other two plots which have many null values (node batteries nearly flat) go back to the previous midnight.

The configuration of the VS is attached (cis_temp_chart.xml).

The source of the data is another VS that saves the temperature values from each of the six nodes in the network. (The gsn.cis_room_temp data is exported in the xls).

I set 216 so that the chart showed 36 hours of data (10 minute intervals). The node batteries are getting low and I am now seeing a lot of null values for some nodes. (I had set in cis_room_temp as well thinking that I needed to retain the data for the chart VS but now realise that probably isn’t necessary.

I haven’t looked at how the charting routine works but it seem it does not count the null values in the data it retains so that the data for nodes V145 and V144 is retained back until it has 216 non null values. Note that the time scale is more compressed before the start of the V178 data.

Would it be possible to make the chart processing class set a time range for history-size instead of a number of records? --- Imported from https://sourceforge.net/apps/trac/gsn/ticket/86 File: https://sourceforge.net/apps/trac/gsn/attachment/ticket/86/CIS%20Room%20Temperatures.xlsx

sarni commented 10 years ago

cis_temp_chart.xml

            <?xml version="1.0" encoding="UTF-8"?>
    <virtual-sensor name="cis_temp_chart" protected="false" priority="11" publish-to-microsoft-research-sensor-map="false">
            <processing-class>
                    <class-name>gsn.vsensor.ChartVirtualSensor</class-name>
                    <init-params>
                            <param name="input-Stream">DATA</param>
                            <param name="title">CIS Room Temperatures</param>
                            <param name="type">ANY</param>
                            <param name="height">300</param>
                            <param name="width">500</param>
                            <param name="vertical-axis">Degree C</param>
                            <param name="history-size">216</param>
                    </init-params>
                    <output-structure>
                            <field name="DATA" type="binary:image/jpeg" />
                    </output-structure>

            </processing-class>
        <description>CIS Temperature Chart</description>
        <life-cycle pool-size="5"/>
        <addressing>
            <predicate key="geographical">Computing and Information Systems - Newnham </predicate>
            <predicate key="LATITUDE">-41.40040221</predicate>
            <predicate key="LONGITUDE">147.1221644</predicate>
        </addressing>
        <storage history-size="3"/>
        <streams>
            <stream name="DATA">
                <source alias="s1" storage-size="1" slide="1" sampling-rate="1.0">
                    <address wrapper="local">
                                            <predicate key="query">select * from cis_room_temp</predicate>
                                            <predicate key="start-time">2010-10-05T12:00:00.000+10:00</predicate>
                    </address>
                    <query>select * from wrapper
                                    </query>
                </source>
                <query>select * from s1 </query>
            </stream>
        </streams>
    </virtual-sensor>
ebiiii commented 9 years ago

b041d94d071a8e286b30975b5f64732bdaaae924 added possibility to set time of the sliding window used for the graph. The syntax is the same as the time window of data sources. It should solve the above issue.