CodeBreak 13/04/2022

Access files on OOD from remote computer

Files saved under the home directory on OOD are not accessible except from the OOD, but the requirement was to copy them to a remote (home) computer. The solution is to save the files to a /g/data location, which is accessible from the OOD, but also accessible remotely (using rsync or scp for example).

To make this even easier, create a symbolic link in your OOD home directory to the location on /g/data, so that it is easy to navigate to that location using the file explorer tools and other methods for accessing the file system in OOD. e.g.  

ln -s /g/data/$PROJECT/$USER gdata  

Using hh5 conda environment in OOD jupyterlab

There was an issue with loading the CLEX conda environment in OOD JupyterLab. This is covered in our wikibut the proximate problem was a specific, out-of-date, environment was being specified.

Convert model longitude to value between 0 and 360 degrees

The ACCESS-OM2 model longitude has a minimum of -270 and a maximum of 90 degrees. Using functions from the GSW toolbox for the equation of state of seawater requires longitude values between 0 and 360 degrees. The question revolved around the best way to do this.

The answer given for this case was to create a small function (e.g. lon_360) which will take a value between -270 and 90 and return a value between 0 and 360. The function can then be used in the call to the gsw function directly, e.g.  

gsw.some_function(... , lon_360(lon_value), ...)

Interpolate density profiles to new vertical grid

  Use xarray interpolation.

General Matplotlib Questions

The student had questions about the various different ways in which plots are created with matplotlib, especially when searching online and different people suggest different methods.

We discussed the difference between object oriented plotting and function plotting, and how we usually use the object oriented way as it's easier to take full control of the plot features.

We compared the figure object to the canvas on which the items are to be drawn, and the axes object the coordinate system inside the figure.

How to run a tested analysis on a bigger dataset in Python

The student had an analysis written in a Jupyter Notebook in Python. The problem was that when moving to a bigger dataset, the kernel would die. 

As the student had no previous knowledge of any parallel programming with Python, we advised them to follow our latest parallel trainingand then contact us again for follow-up questions.

We also gave information about the climtaspackage. This package makes it simpler to open a distributed cluster for Dask. Additionally, the student was doing some resampling of data without missing data and always using blocks of the same length. In that specific case, climtas contains a resampling function that will speed up the process compared to the general function from xarray.