Xp65 conda missing cartopy pre_existing_data_dir

The xp65 conda environments are missing a definition for the cartopy data directory. If this is not set then plots using external data (e.g. coastlines, backgrounds) can’t be created from batch scripts on the compute queue, which doesn’t have network access to download the files from their remote source.

E.g.: this should be set to a directory /g/data/xp65/public/apps/cartopy-data

/g/data/xp65/public/apps/med_conda_scripts/analysis3-25.06.d/bin/python <<EOF
import cartopy
print(cartopy.config["pre_existing_data_dir"])
EOF

.

The hh5 environments had this data in an external directory

/g/data/xp65/public/apps/med_conda_scripts/analysis3-24.07.d/bin/python <<EOF
import cartopy
print(cartopy.config["pre_existing_data_dir"])
EOF

/g/data/hh5/public/apps/cartopy-data

Griff’s found the data is already present in xp65 under /g/data/xp65/public/apps/cartopy-data

for v in 24.07 24.11 24.12 25.01 25.02 25.03 25.04 25.05 25.06 25.07 ; do
echo ${v}
module load conda/analysis3-${v}
python << EOF
import cartopy
print(cartopy.config["pre_existing_data_dir"])
EOF
module unload conda/analysis3-${v}
done

Workaround courtesy of Esteban:

import cartopy
cartopy.config["pre_existing_data_dir"] = "/g/data/xp65/public/apps/cartopy-data"

Plus ça change. Pretty sure we had this issue in the hh5 envs eh?

1 Like

Hi Scott,

I’m looking at this PR on cartopy and it seems we can set the CARTOPY_DATA_DIR, so I’m just setting that now. I’ll post again when the environment has rebuilt.

1 Like

Hi Scott,

The environment variable has been set. I’ve checked and cartopy is picking it up from within a Python repl.

Let us know if there’s any further configuration cartopy might need!

Cheers, Charles

I have completed a comprehensive (at least I think it is comprehensive) review of my plots using xp65 versus my old hh5 process and I believe that the output is identical. I confirm that the solution is “Good”.

3 Likes