I can't think of any way to do that with the existing reporting machinery
without writing some pretty fancy custom search list extensions. Frankly, I
think a SQL query would be easier. Even that would require some serious
SQL-foo.

Easiest would be to write a simple Python program that runs once a day,
performs the queries, then organizes the data the way you want.

-tk

On Sat, Jan 20, 2018 at 4:49 PM, Geoff Harris <[email protected]>
wrote:

> Hi Tom,
>
> Sorry, I was thinking in unixtime meaning an hourly datetimestamp and
> making such a graph once per day, week or even month would be plenty. You
> are correct that I could make a script outside of weewx to query the
> database and spit this out. Was trying to keep it all within weewx. What I
> am hoping to create is a graph with 5 years worth of weather data with the
> lines superimposed over one another.
>
> To do this, what I would like is something that creates a 43,800 line CSV
> file (365 days * 24hr)
> Each line would have a date/time for each hour of the day and then the
> hourly average temperature in a comma separated array for the last 5 years.
> For example 2018-1-18 20:00 (or unix timestamp equivalent), 56 (temp for
> current date/hour), 73 (temp for 1 year ago on this date/hour),  71 (temp
> for 2 year ago on this date/hour),  73 (temp for 3 year ago on this date),
> 73 (temp for 4 year ago on this date)
>
> One could also imagine wanting to iterate through only years worth of day
> in this way, but for say 1 year ago or 5 years ago, but just for that one
> year. Since this data wouldn't change, it would only need to be generate
> once like the NOAA archive data. Then one could make archive graphs for
> past years rather than have just the NOAA tables..
>
> Hopefully this is clearer. Really appreciate the help.
>
> Cheers,
>
> Geoff
>
>
>
> On Saturday, January 20, 2018 at 11:09:09 AM UTC-8, Tom Keffer wrote:
>>
>> 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.duckdn
>>>>> s.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.
>

-- 
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