I'm not completely understanding your question. You say you want one hour
averages, but your example has only one value per date. I would expect 24.

Also, is this something you want to produce every archive cycle? Or, only
as a one off?

If the former, it will be a big file (many megabytes) and will take a long
time to produce. If the latter, running a SQL query would be easier and
faster.

If you could frame your question a little better, we can try again.

-tk

On Sat, Jan 20, 2018 at 11:42 AM, Geoff Harris <[email protected]>
wrote:

> Hi Tom,
>
> Is there a creative way that one could make a text file with the data? I'm
> trying to figure out how to make a csv file with the last 5 years worth of
> data.
>
> Output CSV something like aggregate 1hr averages for outTemp
> Date, outTemp.0, outTemp.1, outTemp.2, outTemp.3, outTemp.4
> Date1, outTempcurrentyear, outTempyearN-1, outTempyearN-2, outTempyearN-3,
> outTempyearN-4
> Date2, outTempcurrentyear, outTempyearN-1, outTempyearN-2, outTempyearN-3,
> outTempyearN-4
> ...
> Date365, outTempcurrentyear, outTempyearN-1, outTempyearN-2,
> outTempyearN-3, outTempyearN-4
>
> This can then easily be plugged into javascript to then graph on the same
> axis.
>
> I can get 5 years worth of data our using either:
>
> #for $_span in $span($year_delta=5).spans(interval=3600)
> $_span.outTemp.avg.formatted,
> #end for
>
> <br>
> {test aggregation 1 year ago}
> #for $_span in $year($years_ago=5).spans(interval=3600)
> $_span.outTemp.avg.formatted,
> #end for
>
> Having a hard time coming up with a loop structure that would allow the
> desired output and would love any ideas on how to aggregate and loop
> through the data to accomplish this.
>
> -Geoff
>
>
> On Thursday, February 9, 2017 at 6:39:53 PM UTC-8, Tom Keffer wrote:
>>
>> Unfortunately, neither of those are possible with the present image
>> generation engine.
>>
>> You could run wee_reports, using a timestamp of a year ago, saving the
>> images to a separate spot. Then you would be able to display this month's
>> graph, and the same month a year ago. But, they would be in separate graphs.
>>
>> -tk
>>
>> On Thu, Feb 9, 2017 at 3:54 PM, Thomas Carlin <[email protected]>
>> wrote:
>>
>>> I have a couple questions about image generation that doesn't seem to be
>>> covered in the docs anywhere.
>>>
>>> I would like to be able to create images with the same data value, but
>>> from multiple time ranges. For the yearly say, have the last 365 days as
>>> one line, but then have another line that has the same date range, but from
>>> 1 year ago.  Is something like this possible with the current image
>>> generator?
>>>
>>> I would also like to be able to generate historic graphs.  Is there a
>>> way to do this historically, and moving forward, so next year I can look at
>>> this February's graph?
>>>
>>> Thank you!
>>>
>>> My station can be seen here:  http://carlincomputing.duckdns.org/weewx/
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "weewx-user" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to