Author Topic: Way to export just the data on Today window  (Read 7810 times)

Dryside

  • Gentle Breeze
  • **
  • Posts: 29
    • EW3867
    • KCOHESPE4
  • Station Details: Davis Vantage Pro 2
Way to export just the data on Today window
« on: November 20, 2013, 02:26:33 AM »
Is there a way to export just the data shown in the Today Window.  I would like to get just the Daily Highs, Daily Lows and Daily Average from this window.   I can't seem to find a way to get just this information anywhere.  This same information for a series of days in a cvs file would be even better.

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6686
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Create a web template (Re: Way to export just the data on Today window)
« Reply #1 on: November 20, 2013, 09:29:30 PM »
Dear Dryside and WeatherCat fans,

Is there a way to export just the data shown in the Today Window.  I would like to get just the Daily Highs, Daily Lows and Daily Average from this window.   I can't seem to find a way to get just this information anywhere.  This same information for a series of days in a cvs file would be even better.

The easiest way to do this is to create the daily highs, lows, and averages is to create a WeatherCat web template that generates this information.  You can read more about WeatherCat templates in the manual starting on page 87.  While normally this facility used for making HTML files, it can just as easily create text files.  I'm using this feature right now to create data to upload to Twitter.

If you want to collect this data for each consecutive day, you could run a cron job using the nifty CronniX interace to grab the file with the daily data just before midnight and move it to a place where you can then accumulate the data.  If you want something completely automatic, you'll need to do some sort of scripting.  You could either use AppleScript of perhaps UNIX shell commands.  It sounds difficult, but you can get examples off of the web and basically tell you everything you need to know.

That's a sketch of how you might do it.  Feel free to ask questions if you need help fleshing out the details.

Cheers, Edouard  [cheers1]

Dryside

  • Gentle Breeze
  • **
  • Posts: 29
    • EW3867
    • KCOHESPE4
  • Station Details: Davis Vantage Pro 2
Re: Way to export just the data on Today window
« Reply #2 on: November 20, 2013, 10:45:59 PM »
I will give this a try.  Sure would be nice though if in WR they couldn't just have an export directly from the Today Window.

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2987
    • CW9739
    • IIBSTO2
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, extra temp stations, no U.V. WeatherLinkLive.
Re: Way to export just the data on Today window
« Reply #3 on: November 21, 2013, 04:59:33 PM »
You can get daily exports of raw and hourly data via the Export tool, in addition at midnight every day, the Daily report is saved to disk at ~/Documents/WeatherCatReports as a PDF file (and at midnight on the last day of the month, the monthly report is saved also). More info in the manual under Statistics/Reports.

Dryside

  • Gentle Breeze
  • **
  • Posts: 29
    • EW3867
    • KCOHESPE4
  • Station Details: Davis Vantage Pro 2
Re: Way to export just the data on Today window
« Reply #4 on: November 21, 2013, 11:29:14 PM »
I missed the info on the pdf but if I want to actually export this into my own Numbers spreadsheet it is very difficult from the pdf.  I tried coping the data but can only do it one reading at a time.  This is not efficient.

Basically what I want to do is export the daily Highs, Lows, etc that show on the Today window.  I don't want he hourly reading.  Is the possible to do anywhere in WA?  I can't find a way to do this with the Export Tool.

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6686
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Sample template (Re: Export data on Today window)
« Reply #5 on: November 22, 2013, 08:36:23 PM »
Dear Dryside and WeatherCat fans,

Basically what I want to do is export the daily Highs, Lows, etc that show on the Today window.  I don't want he hourly reading.  Is the possible to do anywhere in WA?  I can't find a way to do this with the Export Tool.

Here is what I'm doing for my Twitter posting experiment.  I've created a template that looks like this:

Code: [Select]
Canebas weather summary for today - High: STAT$TEMPERATURE:MAX:TODAY$ degs. F, Low: STAT$TEMPERATURE:MIN:TODAY$ degs. F, Total rainfall: STAT$RAIN:TOTAL:TODAY$ ins, Peak Wind gust: STAT$WINDSPEED:MAX:TODAY$ WINDSPEEDUNITS$
When WeatherCat processes this template, it becomes this sort of text:

Code: [Select]
Canebas weather summary for today - High: 65.4 degs. F, Low: 50.1 degs. F, Total rainfall: 0.00 ins, Peak Wind gust: 21 MPH
You'll need to read up on WeatherCat custom web tags, but I don't think you'll have too much trouble figuring it out.  The only trick is grabbing the data just before midnight so that you can collect the high, low, etc. data.

You might find reading up my SeaMonkey templates helpful:

http://athena.trixology.com/index.php?topic=956.0

It explains how you set up directories to get WeatherCat to process custom web templates.  Once you have that under your belt, I think you can at least get the data you want created in text files.  That would be an important first step.

Cheers, Edouard  [cheers1]

Dryside

  • Gentle Breeze
  • **
  • Posts: 29
    • EW3867
    • KCOHESPE4
  • Station Details: Davis Vantage Pro 2
Re: Way to export just the data on Today window
« Reply #6 on: November 22, 2013, 10:18:08 PM »
Thanks on the ideas for the web template.  Just haven't had time to try this yet.

Ken

Dryside

  • Gentle Breeze
  • **
  • Posts: 29
    • EW3867
    • KCOHESPE4
  • Station Details: Davis Vantage Pro 2
Re: Way to export just the data on Today window
« Reply #7 on: December 02, 2013, 02:07:11 AM »
Edouard,

I finally got a chance to try working with the web pages but I have some questions.

I have run a test and see the data I want but don't know how to get it to a text file so I can import into Numbers.  How do I do this?

I also can't seem to find out when templates are run by WC.  Can't figure out how to run just before midnight.

Answers to these questions might get me to where I want to be.

Thanks,
Ken


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6686
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Pointers (Re: export just the data on Today window)
« Reply #8 on: December 02, 2013, 09:34:05 PM »
Hi Ken and WeatherCat schemin' scripters,

I finally got a chance to try working with the web pages but I have some questions.

I have run a test and see the data I want but don't know how to get it to a text file so I can import into Numbers.  How do I do this?

I also can't seem to find out when templates are run by WC.  Can't figure out how to run just before midnight.

Answers to these questions might get me to where I want to be.

Okay, this is a midge more complicated than it might look from the outside.  First WeatherCat takes templates that are put in one folder, processes them to substitute data for web tags and places the result file in another folder with exactly the same name.  So you need to put your templates in one folder and specify which folder WeatherCat is supposed to put the results into.

You configure all this in the custom web preference pane.  That is also where you can set how often WeatherCat generates all these files.

I think it would help you to read the documentation that comes with my SeaMonkey web templates that you can download here:

http://www.canebas.org/WeatherCat/Web%20templates/WeatherCat%20SeaMonkey%20web%20template%20(0.5.2).zip

As to grabbing the data so that you can input it into numbers, that requires another strategy.

The easiest way to do this is to use a simple UNIX command:

cat today-data-file.txt >> cumulative-data-file.txt

The trouble is that you need the complete UNIX paths to both files for this to work.  Once you have that, you need to make it into a little shell command.

In this case all you would need is this tiny UNIX shell command file:

Quote
#!/bin/bash
cat today-data-file.txt >> cumulative-data-file.txt

You would need to save this file someplace and make it executable.  Instructions on how to do this can be found here:

http://ss64.com/osx/syntax-shellscript.html

The final trick is to have this tiny UNIX shell script run just before midnight.  The easiest way to do that is to create a UNIX cron job.  Thankfully, this can be done with a nice OS-X front end called CronniX.

http://code.google.com/p/cronnix/

You could then schedule the little UNIX shell script to run just before midnight and everything would be in place.

Unfortunately, this solution is a very UNIX intensive and therefore not the most user-friendly way to do it.  Another way to do try might be to use AppleScript, but I think it wouldn't be any simpler.  I don't know of anything that has a nice OS-X feel to it that will also you manipulate files like this.  However, perhaps another forum member does.

At least this is a start.  You can explore and see where it takes you!

Cheers, Edouard  [cheers1]

P.S. You might look at the latest version of my WeatherCat AppleScripts for ideas:

http://athena.trixology.com/index.php?topic=1039.0

Dryside

  • Gentle Breeze
  • **
  • Posts: 29
    • EW3867
    • KCOHESPE4
  • Station Details: Davis Vantage Pro 2
Re: Way to export just the data on Today window
« Reply #9 on: December 02, 2013, 11:24:39 PM »
Thanks for the information.  I will look at it and see if it is worth the effort. 

WA should be able to make this a much simpler process if they would just do 2 thinks.  Make it so one can select which columns of data you want then export as night when the PDF report is made and then save as a tab delimited file.  ideally they would make the hourly data in one file and the totals in another for easy import into Numbers or a database depending on what a person wants.  Really shouldn't be that hard to do.  The data is all there in many of the reports but not real usable because there is not much flexibility in the selection of the data or the way it is saved.  Unless I am missing something that is how I see it.

Thanks,
Ken

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6686
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
PDF tools might do it. (Re: Export just the data on Today window)
« Reply #10 on: December 03, 2013, 09:32:02 PM »
Dear Ken and WeatherCat tinkerers,

WA should be able to make this a much simpler process if they would just do 2 thinks.  Make it so one can select which columns of data you want then export as night when the PDF report is made and then save as a tab delimited file. 

If you like, you could post a feature request for WeatherCat on this forum topic:

http://athena.trixology.com/index.php?board=4.0

If you could get close to the data you want by converting the PDF reports into text, you might take a look at some of the shareware tools for manipulating PDF files.  I keep looking at them, but I just don't a actual need to buy such a thing.  However, they are inexpensive, so that might be the ticket for you.

Cheers, Edouard  [cheers1]