Plotting coastlines on a compute node

Hi! I’m trying to plot a few figures by running code on a compute node (not ARE) and using the analysis3 environment. When trying to plot coastlines, I get Network is unreachable. I imagine this is because compute nodes don’t have access to the internet and coastlines() needs to download something.

Does anyone have a workaround for this? Something that does not require using ARE?

What package is providing coastlines()?

Small detail :sweat_smile:

It’s from cartopy.

Hi @paocorrales,
You should be able to use the environment variable:
export CARTOPY_DATA_DIR=/g/data/xp65/public/apps/cartopy-data

That is set automatically in the environment:

$ module show conda/analysis3 | grep cartopy
setenv		CARTOPY_DATA_DIR /g/data/xp65/public/apps/cartopy-data

So I wonder why it didn’t work out of the box for you @paocorrales

Hi @paocorrales, if you are looking for a quick fix, the land sea mask is written out as part of most model runs. You can read that field in and do a contour (with level =0.5) to get a coastline from the actual data you use.

This is actually more accurate when you are comparing different resolutions as well because you can see the degradation of the features in the coastline as you go to coarser data.

Yes, completely agree with Chermelle for this! Where cartopy puts its coastlines is not necessarily where the model has coastlines, especially at coarse resolution, so for scientific analysis it is often better to derive a coastline out of the landmask.

I’m not sure what would be best in this particular scenario, as on the one hand we want nice shiny graphics for the AM3 n512 poster, but on the other hand we are trying to compare resolutions! I would probably lean to cartopy for this, but for our analysis plots take the coastline out of the model.

Absolutely agree with this; it’s usually my go-to for model runs. In this case, I’m helping someone else trying to plot ERA5 data, only as a first test.

Funny enough, it’s working out of the box today. I’ll check with the other person and hopefully mark this as solved.

Thanks everyone for all the suggestions!

Imagine trying to use Gadi to actually compute against the increasingly available performant earth / climate science big data sets on cloud. GLORYS for example via the copernicusmarine package. Or https://www.earthmover.io offerings.

Unless the community wishes to duplicate all the data locally at NCI ( = $$$ ) flexible whitelisting seems a no-brainer.

EDIT: ( and at full, not throttled, bandwidth )