Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuration option for coastline data in cf-view setup #21

Open
bnlawrence opened this issue Apr 30, 2024 · 1 comment
Open

configuration option for coastline data in cf-view setup #21

bnlawrence opened this issue Apr 30, 2024 · 1 comment

Comments

@bnlawrence
Copy link
Collaborator

When cartopy first draws a coastline, it looks for coast line data and downloads it. For low resolution data, that's ok, but it can be time consuming for high resolution data.

It might be that there is a central copy of such data in some sites, and it might be that one is using cartopy from within a container, as we do with the cf-view datatools container. In such cases it would be helpful to have a configuration option for cf-view to declare where the data is (or is wanted to be) so as to avoid repeated and/or unnecessary downloads.

At the moment, things seem to end up in the users ./local/share/cartopy directory, but if that's a docker container, then it's clearly not persistent. There is some detail here as to how to do things differently.

@sadielbartholomew
Copy link
Member

sadielbartholomew commented Apr 30, 2024

Thanks @bnlawrence. I have noticed this issue too (being spammed by the message telling me a feature is being downloaded in cf-plot, at least).

I think this is more of a cf-plot issue, or at least a joint consideration, since the downloading happens directly (e.g. using interactive Python) with cf-plot, too, and isn't related to the UI aspects, so if you don't object I will move the Issue over to the cf-plot repo.

There is some code I have seen in the cf-plot script which I think is intended to try to cache any downloads, but I have my doubts as to whether it works given my recent experience with running scripts downloading Cartopy 'features' e.g. country borders and coastlines etc.:

https://github.com/NCAS-CMS/cf-plot/blob/e64a745f8a6cdf532280430a96cc66f229854087/cfplot/cfplot.py#L65-L72

where the pre_existing_data_dir is designed to store that data (see the documented key here), and where data_dir is the fallback according to those docs.

It might be that there is a central copy of such data in some sites, and it might be that one is using cartopy from within a container, as we do with the cf-view datatools container. In such cases it would be helpful to have a configuration option for cf-view to declare where the data is (or is wanted to be) so as to avoid repeated and/or unnecessary downloads.

I will investigate whether that code is doing anything and then we can think about how best to manage keeping downloaded data in a store generally, with support that will work for containers and as a site/group-wide approach and not just on an individual user basis, with cf-view in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants