Skip to content

Commit 020f742

Browse files
committed
Remove reference to nf33
1 parent d061e9d commit 020f742

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,8 @@ git tag v1.2.0
3333
git push origin v1.2.0
3434
```
3535

36+
### Config and DATA caching
37+
38+
By default, `ACCESS-Vis` caches its data in different locations depending on the platform. On NCI Gadi, data are stored in `/scratch/$PROJECT/$USER/.accessvis`, while on other platforms, the data are cached in `$HOME/.accessvis`. However, users can customize this path by setting the `ACCESSVIS_DATA_DIR` environment variable to a directory of their choice.
39+
3640

src/accessvis/earth.py

+16-7
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
import py360convert
55
from PIL import Image
66
import os
7-
import sys
87
Image.MAX_IMAGE_PIXELS = None
98
from pathlib import Path
10-
import math
119
import datetime
1210
import lavavu
1311
import gzip
@@ -18,7 +16,7 @@
1816
import matplotlib
1917
import quaternion as quat
2018

21-
from utils import is_ipython, is_notebook, download, pushd
19+
from utils import is_notebook, download, pushd
2220

2321
MtoLL = 1.0/111133 #Rough conversion from metres to lat/lon units
2422

@@ -34,13 +32,24 @@ class Settings():
3432

3533
#Where data is stored, defaults to module dir unless on gadi
3634
INSTALL_PATH = Path(__file__).parents[0]
37-
if 'gadi.nci.org.au' in os.getenv('HOSTNAME', ''):
38-
DATA_PATH = Path('/g/data/nf33/public/data/accessvis')
35+
36+
# Default to non-headless mode
37+
HEADLESS = False
38+
# Check if the data directory is specified in environment variables
39+
DATA_PATH = os.getenv("ACCESSVIS_DATA_DIR")
40+
41+
# Check if running on 'gadi.nci.org.au'
42+
hostname = os.getenv('HOSTNAME', '')
43+
if 'gadi.nci.org.au' in hostname:
44+
project = os.getenv("PROJECT")
45+
user = os.getenv("USER")
46+
DATA_PATH = Path(f'/scratch/{project}/{user}/.accessvis')
3947
HEADLESS = True
4048
else:
41-
DATA_PATH = INSTALL_PATH / 'data'
42-
HEADLESS = False
49+
DATA_PATH = Path.home() / ".accessvis"
4350

51+
os.makedirs(DATA_PATH, exist_ok=True)
52+
4453
GEBCO_PATH = DATA_PATH / 'gebco' / 'GEBCO_2020.nc'
4554

4655
def __repr__(self):

0 commit comments

Comments
 (0)