Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > Navigation
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 08-07-2018, 08:16   #16
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: Ice Charts via SailDocs Or Other Low-Res Source?

Also saved as jpg & png , same file names with .jpg , .png added >
https://www.pythonanywhere.com/user/...hart_0.pdf.jpg

Tried in the weatherfax opencpn plugin, the polar mapping messed the image to unreadable but the mercator mapping might be useful, so small an area it's not skewed too much.

File sizes are much smaller >
Quote:
chart_0.pdf
2018-07-08 14:59 275.5 KB
chart_0.pdf.jpg
2018-07-08 14:49 72.0 KB
chart_0.pdf.png
2018-07-08 14:59 126.9 KB
conachair is offline   Reply With Quote
Old 08-07-2018, 09:04   #17
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: Ice Charts via SailDocs Or Other Low-Res Source?

And a few more lines of code, now saving a smaller png and jpg. Not great quality but readable just about if time downloading is too long. PNG file size got bigger!

Quote:
chart_0.pdf
2018-07-08 15:59 275.5 KB
chart_0.pdf.jpg
2018-07-08 15:59 72.0 KB
chart_0.pdf.png
2018-07-08 15:59 126.9 KB
chart_0.pdf.small.jpg
2018-07-08 15:59 35.3 KB
chart_0.pdf.small.png
2018-07-08 15:59 228.7 KB
chart_1.pdf
2018-07-08 15:59 742.8 KB
chart_1.pdf.jpg
2018-07-08 15:59 186.9 KB
chart_1.pdf.png
2018-07-08 15:59 289.7 KB
chart_1.pdf.small.jpg
2018-07-08 15:59 87.1 KB
chart_1.pdf.small.png
2018-07-08 15:59 626.0 KB
chart_2.pdf
2018-07-08 15:59 271.9 KB
chart_2.pdf.jpg
2018-07-08 15:59 69.7 KB
chart_2.pdf.png
2018-07-08 15:59 124.8 KB
chart_2.pdf.small.jpg
2018-07-08 15:59 34.2 KB
chart_2.pdf.small.png
2018-07-08 15:59 222.4 KB
chart_3.pdf
2018-07-08 15:59 753.8 KB
chart_3.pdf.jpg
2018-07-08 15:59 185.6 KB
chart_3.pdf.png
2018-07-08 15:59 290.0 KB
chart_3.pdf.small.jpg
2018-07-08 15:59 86.5 KB
chart_3.pdf.small.png
2018-07-08 15:59 624.4 KB
chart_4.pdf
2018-07-08 15:59 297.3 KB
chart_4.pdf.jpg
2018-07-08 15:59 75.9 KB
chart_4.pdf.png
2018-07-08 15:59 137.6 KB
chart_4.pdf.small.jpg
2018-07-08 15:59 36.7 KB
chart_4.pdf.small.png
2018-07-08 15:59 244.5 KB
chart_5.pdf
2018-07-08 15:59 844.2 KB
chart_5.pdf.jpg
2018-07-08 15:59 203.3 KB
chart_5.pdf.png
2018-07-08 15:59 314.7 KB
chart_5.pdf.small.jpg
2018-07-08 15:59 91.9 KB
chart_5.pdf.small.png
2018-07-08 15:59 691.7 KB
chart_6.pdf
2018-07-08 15:59 297.0 KB
chart_6.pdf.jpg
2018-07-08 15:59 75.0 KB
chart_6.pdf.png
2018-07-08 15:59 137.8 KB
chart_6.pdf.small.jpg
2018-07-08 15:59 36.4 KB
chart_6.pdf.small.png
2018-07-08 15:59 243.5 KB
chart_7.pdf
2018-07-08 15:59 295.3 KB
chart_7.pdf.jpg
2018-07-08 15:59 73.7 KB
chart_7.pdf.png
2018-07-08 15:59 136.4 KB
chart_7.pdf.small.jpg
2018-07-08 15:59 35.4 KB
chart_7.pdf.small.png
2018-07-08 15:59 238.0 KB
chart_8.pdf
2018-07-08 15:59 331.6 KB
chart_8.pdf.jpg
2018-07-08 15:59 81.6 KB
chart_8.pdf.png
2018-07-08 15:59 147.3 KB
chart_8.pdf.small.jpg
2018-07-08 15:59 38.3 KB
chart_8.pdf.small.png
2018-07-08 15:59 266.2 KB
chart_9.pdf
2018-07-08 15:59 355.5 KB
chart_9.pdf.jpg
2018-07-08 15:59 85.0 KB
chart_9.pdf.png
2018-07-08 15:59 156.9 KB
chart_9.pdf.small.jpg
2018-07-08 15:59 39.7 KB
chart_9.pdf.small.png
2018-07-08 15:59 279.9 KB
conachair is offline   Reply With Quote
Old 08-07-2018, 12:06   #18
Moderator
 
Dockhead's Avatar

Cruisers Forum Supporter

Join Date: Mar 2009
Location: Denmark (Winter), Helsinki (Summer); Cruising the Baltic Sea this year!
Boat: Cutter-Rigged Moody 54
Posts: 33,873
Re: Ice Charts via SailDocs Or Other Low-Res Source?

Quote:
Originally Posted by conachair View Post
Also saved as jpg & png , same file names with .jpg , .png added >
https://www.pythonanywhere.com/user/...hart_0.pdf.jpg

Tried in the weatherfax opencpn plugin, the polar mapping messed the image to unreadable but the mercator mapping might be useful, so small an area it's not skewed too much.

File sizes are much smaller >
It's very kind of you to do this! I was not able to get on there, but I'll try again tomorrow when I have decent Internet.
__________________
"You sea! I resign myself to you also . . . . I guess what you mean,
I behold from the beach your crooked inviting fingers,
I believe you refuse to go back without feeling of me;
We must have a turn together . . . . I undress . . . . hurry me out of sight of the land,
Cushion me soft . . . . rock me in billowy drowse,
Dash me with amorous wet . . . . I can repay you."
Walt Whitman
Dockhead is offline   Reply With Quote
Old 08-07-2018, 12:16   #19
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: Ice Charts via SailDocs Or Other Low-Res Source?

Quote:
Originally Posted by Dockhead View Post
It's very kind of you to do this! I was not able to get on there, but I'll try again tomorrow when I have decent Internet.
Oops, doesn't work!

Hopefully will in a minute when I sort out getting round the log on..
conachair is offline   Reply With Quote
Old 08-07-2018, 12:36   #20
֍֎֍֎֍֎֍֎֍֎

Join Date: Apr 2006
Posts: 15,136
Re: Ice Charts via SailDocs Or Other Low-Res Source?

I' seeing the usual conflicting results on the web when I ask "Can html use wildcard characters?" but among them is:
https://stackoverflow.com/questions/...card-character

where the last post indicates that you can at least use a wildcard for the contents of a subdirectory. So if those files are being placed in one subdirectory, and it is a matter of simply one file being replaced with a newly named one every time?

Then it would seem that you can use HTML to simply call for whatever is in the directory.

If not, then there are php and other scripts that can search for the incrementing file names, presuming they are based on the numeric timestamps.

I'd also think a suggestion to the agency, letting them know that some folks need to reach out and robotically grab the file, might result in an even simpler change at their end, i.e. they could simply overwrite one particular file/folder every time the new one is posted, and leave that as a resource for mariners.
hellosailor is offline   Reply With Quote
Old 08-07-2018, 13:12   #21
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: Ice Charts via SailDocs Or Other Low-Res Source?

Quote:
Originally Posted by conachair View Post
Oops, doesn't work!

Hopefully will in a minute when I sort out getting round the log on..
OK, back in action I think...

All are ...../chart_0.* > .../chart_9.*

jpg might be your best option, lower resolution than the PDF but smaller file.

For the PDF version>
to: query@saildocs.com
send http://paddyb.pythonanywhere.com/static/chart_0.pdf

JPG
send http://paddyb.pythonanywhere.com/static/chart_0.pdf.jpg

PNG
send http://paddyb.pythonanywhere.com/static/chart_0.pdf.png

small JPG
send http://paddyb.pythonanywhere.com/sta....pdf.small.jpg


Guessing you'll be most interested in the chart_0 which is the latest one.

Wrap up warm now


The code should anyone be interested....

Code:
#!/usr/bin/python3.6
from __future__ import print_function
from urllib.request import urlretrieve

from wand.image import Image

from bs4 import BeautifulSoup
import urllib.request as urllib2
import re
from datetime import datetime

html_page = urllib2.urlopen("http://www.dmi.dk/en/hav/groenland-og-arktis/iskort/oestgroenland/")
soup = BeautifulSoup(html_page, 'html.parser')

msg = ''
msg = 'Updated at (utc) ' + str(datetime.now()) + '\n'

for i, link in enumerate(soup.findAll('a', attrs={'href': re.compile("^/uploads/tx_dmidatastore/webservice/W/B")})):
    #print(link.get('href'))
    imageLink = 'http://www.dmi.dk' + link.get('href')

    filename = "mysite/templates/green_ice/chart_" + str(i) + ".pdf"
    print(filename, imageLink)
    urlretrieve(imageLink, filename)
    msg += 'http://www.dmi.dk' + link.get('href') + '\n'

    with Image(filename=filename) as img:
        with img.convert('png') as converted:
            filenamepng = filename + ".png"
            converted.save(filename=filenamepng)
            print(filename)
        with img.convert('jpg') as converted:
            filenamejpg = filename + ".jpg"
            converted.save(filename=filenamejpg)
            print(filename)

    with Image(filename=filename) as imgsmall:
        imgsmall.resize(int(imgsmall.width/1.5), int(imgsmall.height/1.5))
        print(imgsmall.width, imgsmall.size)
        with imgsmall.convert('png') as converted:
            filenamepng = filename + ".small.png"
            converted.save(filename=filenamepng)
            print(filenamepng, imgsmall.size)
        with imgsmall.convert('jpg') as converted:
            filenamejpg = filename + ".small.jpg"
            converted.save(filename=filenamejpg)
            print(filenamejpg, imgsmall.size)


with open("mysite/templates/icelinks.txt", "w") as f:
    f.write(msg)
conachair is offline   Reply With Quote
Old 09-07-2018, 01:52   #22
Moderator
 
Dockhead's Avatar

Cruisers Forum Supporter

Join Date: Mar 2009
Location: Denmark (Winter), Helsinki (Summer); Cruising the Baltic Sea this year!
Boat: Cutter-Rigged Moody 54
Posts: 33,873
Re: Ice Charts via SailDocs Or Other Low-Res Source?

It works, and it's brilliant!
__________________
"You sea! I resign myself to you also . . . . I guess what you mean,
I behold from the beach your crooked inviting fingers,
I believe you refuse to go back without feeling of me;
We must have a turn together . . . . I undress . . . . hurry me out of sight of the land,
Cushion me soft . . . . rock me in billowy drowse,
Dash me with amorous wet . . . . I can repay you."
Walt Whitman
Dockhead is offline   Reply With Quote
Old 09-07-2018, 02:15   #23
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: Ice Charts via SailDocs Or Other Low-Res Source?

Quote:
Originally Posted by Dockhead View Post
It works, and it's brilliant!
Excellent . That will remain running until your save return

Seen these ones?
NAEFS Probabilistic Wind Speed Guidance

conachair is offline   Reply With Quote
Old 10-08-2018, 05:51   #24
Moderator
 
Dockhead's Avatar

Cruisers Forum Supporter

Join Date: Mar 2009
Location: Denmark (Winter), Helsinki (Summer); Cruising the Baltic Sea this year!
Boat: Cutter-Rigged Moody 54
Posts: 33,873
Re: Ice Charts via SailDocs Or Other Low-Res Source?

Thanks a million to Conachair for the great ice chart utility.


Our volunteer weather router, TeddyDiver (to whom many many thanks!) was sending us satellite pictures, which were extremely useful, but during the 3 weeks we were in Greenland (or on passage to or from there), we used Conachair's utility to get the Danish ice charts with the egg codes! It was a great help to us; thanks!
__________________
"You sea! I resign myself to you also . . . . I guess what you mean,
I behold from the beach your crooked inviting fingers,
I believe you refuse to go back without feeling of me;
We must have a turn together . . . . I undress . . . . hurry me out of sight of the land,
Cushion me soft . . . . rock me in billowy drowse,
Dash me with amorous wet . . . . I can repay you."
Walt Whitman
Dockhead is offline   Reply With Quote
Old 10-08-2018, 05:58   #25
Moderator
 
Dockhead's Avatar

Cruisers Forum Supporter

Join Date: Mar 2009
Location: Denmark (Winter), Helsinki (Summer); Cruising the Baltic Sea this year!
Boat: Cutter-Rigged Moody 54
Posts: 33,873
Re: Ice Charts via SailDocs Or Other Low-Res Source?

Quote:
Originally Posted by conachair View Post
Excellent . That will remain running until your save return

Seen these ones?
NAEFS Probabilistic Wind Speed Guidance


That's worth a separate thread!


I've made one here: NOAA Probabilistic Wind Charts - Cruisers & Sailing Forums
__________________
"You sea! I resign myself to you also . . . . I guess what you mean,
I behold from the beach your crooked inviting fingers,
I believe you refuse to go back without feeling of me;
We must have a turn together . . . . I undress . . . . hurry me out of sight of the land,
Cushion me soft . . . . rock me in billowy drowse,
Dash me with amorous wet . . . . I can repay you."
Walt Whitman
Dockhead is offline   Reply With Quote
Reply

Tags
charts, sail


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
building oc from source with high res base map for dummies Andreas29 OpenCPN 25 13-11-2017 09:43
High Res Background Map on Mac LloydW OpenCPN 2 01-10-2016 12:10
Google Earth KAP Large Area Hi Res Charts Steelcat Navigation 36 20-08-2016 23:48
saildocs surface analysis bobsadler General Sailing Forum 8 03-01-2013 05:06
saildocs.com fvn Navigation 5 26-11-2010 17:46

Advertise Here


All times are GMT -7. The time now is 10:38.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.