Navigatrix is a community project that relies on user donations of time, money, expertise, and enthusiasm.
Your donation frees up additional resources and moves us forward.
Please consider how you will make your contribution for the development of Navigatrix.
Click here to help with a donation.




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Simple Spot-Forecast Viewer
PostPosted: 05 Sep 2013, 20:46 
Site Admin

Joined: 20 Mar 2012, 13:32
Posts: 115
When I have to get weather data via SSB/Pactor I don't like getting the typical GRIBs with "wind arrows" because the gridded wind data greatly inflates the file size. Instead I get two separate files:

(1) A GRIB file over a relatively large area with only surface pressure (plus rain if tropical convergence zones are a concern). With 24hr intervals and a 2° x 2° grid size a 10-day forecast over the entire SW-Pazific will still be under Sailmail's 10KB file size limit.

(2) A Spot Forecast that lists a set of forecast parameters for a specific lat/lon position in a tabular text format (under way I request a "moving forecast" for my average course and speed). A file with a few days worth of forecast data will be small (<2KB) even at 6 or 3 hour intervals.

(1) helps to see the big picture and in most cases the wind can be estimated accurately enough from the isobar contours anyway (of course with all the usual health warnings that this is raw computer model output). (2) I find helpful at a micro-level to pick out changes in e.g. wind direction along a timeline.

To make the spot forecast data easier to read, I use the spreadsheet attached at the bottom of this post which turns the terse tabular data into some simple time line charts:
Attachment:
Spot_Forecast.gnumeric - Gnumeric.png
Spot_Forecast.gnumeric - Gnumeric.png [ 178.07 KiB | Viewed 4567 times ]


Using the spreadsheet with spot forecasts is simple:

(1) Send an email with your data request email to query@saildocs.com with the follwing line in the message body:

Code:
send Spot:18.3S,168.5E|7,6|PRMSL,WIND,WAVES,RAIN,LFTX


Read: "send me surface pressure, wind speed and direction, wave height and direction, precipitation and Lifted Index for position 18°18'S 168°30'E over the coming 7 days in 6-hr intervals".

For a moving forecats you add boat speed in knots and COG in °T to the request:

Code:
send Spot:18.3S,168.5E|7,6|PRMSL,WIND,WAVES,RAIN,LFTX|5.5,215


What you get back in the reply email from saildocs looks like this:

Code:
Data extracted from file gfs130902-12z.grb dated 2013/09/02 17:03:36
Data extracted from file ww3-20130902-12z.grb dated 2013/09/02 16:48:48
request code: Spot:18.3S,168.5E|7,6|PRMSL,WIND,WAVES,RAIN,LFTX

Forecast for 18°18S 168°30E (see notes below)
Date   Time  PRESS  WIND DIR WAVES DIR  PER RAIN LFTX
        utc    hPa   kts deg  mtrs deg  sec mm/h   °C
----------- ------ ----- --- ----- --- ---- ---- ----
09-03 00:00 1014.0   8.0 167   1.1 139  7.5  0.0  4.9
09-03 06:00 1012.5  14.2 183   1.1 143  7.5  0.0  3.5
09-03 12:00 1014.4  12.4 160   1.3 145  7.8  0.0  3.4
09-03 18:00 1012.3  11.7 169   1.4 145  8.6  0.1  4.7

09-04 00:00 1014.4   9.6 176   1.4 144  9.3  0.0  5.5
09-04 06:00 1012.2  11.7 176   1.5 143  9.5  0.0  6.2
...

The above is for a stationary forecast. For a moving forecast you would see two additional columns with lat/lon for each data point.

(2) Copy all the lines with data from the response email (starting with "09-03 00:00 ..." and paste them into the "Import" tab of the attached spreadsheet. Pasting the lines will bring up Gnumeric's data import dialog:
Attachment:
Text Import Configuration_007.png
Text Import Configuration_007.png [ 54.54 KiB | Viewed 4567 times ]

Attachment:
Text Import Configuration_008.png
Text Import Configuration_008.png [ 53.28 KiB | Viewed 4567 times ]


(3) With all the newly pasted data selected press the "Sort ascending" button on the Gnumeric toolbar to get rid of the empty lines:
Attachment:
Import_sort.png
Import_sort.png [ 62.62 KiB | Viewed 4567 times ]


(4) Copy the sorted data from the tab "Import" into the tab "Stationary" or "Moving" (starting in cell G4), depending on whether your request included course and speed. In cell E2 you can enter the offset of local time vis-à-vis UT in hours (a positive number means you're ahead of UT):
Attachment:
Timezone.png
Timezone.png [ 13.48 KiB | Viewed 4567 times ]


That's it. The little charts should pick up the new data, providing a good "at a glance" view of what NOAA's GFS model thinks will happen where you are.

The manual copy and paste is not very elegant but it hasn't been enough of a pain for me to come up with a better solution.

Oh - and here's the file:
Attachment:
Spot_Forecast.gnumeric.txt [15.32 KiB]
Downloaded 295 times

Rename it after downloading to get rid of the ".txt" extension (the discussion board doesn't allow attachments that end in "gnumeric")


Top
 Profile  
Reply with quote  
 Post subject: Re: Simple Spot-Forecast Viewer
PostPosted: 27 Oct 2013, 05:23 
Site Admin

Joined: 20 Mar 2012, 13:32
Posts: 115
OK - I did get fed up with all that manual copying, pasting and sorting at last. Below is a simple shell script that will do the work for you. It will search in your Airmail inbox for the most recent email with spot forecast data, extract the data, remove empty lines and put what's left into a spreadsheet that it will open in Gnumeric. It will also open the Spot_Forecast.gnumeric spreadsheet from the previous post. So all that's left to do is one spreadsheet to spreadsheet copy and paste and you're done.

To use it:
  • Detach the file at the end of this post and save it as ~/bin/spfc (that is without the extension ".txt"). Create the subdirectory bin in your home-directory if required.
  • In the text file, update the path to your Airmail inbox (if required - line 11 in the file) and the location of the Spot_Forecast.gnumeric spreadsheet (line 14 in the file).
  • Make the file executable: Press [ctrl]+[alt]+[T] to open a terminal and type chmod +x bin/spfc

That's it. Now, when you have a new spot forecast in your inbox, just press [ctrl]+[alt]+[T] and type spfc [enter]. The script will extract and re-shuffle the data and open it in a spreadsheet for you. All that's left for you to do is to copy it over to the "Stationary" or "Moving" tab in Spot_Forecast.gnumeric (which the script will also have opened).

Here's the file:
Attachment:
spfc.txt [2.56 KiB]
Downloaded 319 times


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Credits © 2010 - 2018