I am trying to calculate on- and off-shelf temperature and salinity in the Antarctic margins in the ACCESS-OM2-01 model. At the moment, I am latitudinally-averaging temperature profiles to get a mean T and S profile at each longitude.
However, it would be better to average along- and across-isobaths, as this will more correctly represent shelf properties in non-latitudinally-aligned isobaths (primarily an issue in the Eastern Weddell and West Antarctic Peninsula).
Does anyone have example code of how I could do this? I basically want to get a bunch of T and S slices x km wide that are orthogonal to the coastline, just like a research vessel would sample a section in the margins.
The way we did it was taking small rectangles of data perpendicular to the shelf break, rotating them so that they all align and then taking the mean over the full section.
The following work-in-progress code on github might help you:
Cell 7 of the notebook is a function that calculates the angle of each shelf section to a purely zonal direction.
In cell 8, I have a function that rotates the data within the small rectangle and interpolates it onto a along-shelf vs. across-shelf coordinate in units of m (see attached Fig.)
In cell 9, I call the two functions and loop through the many rectangles in my shelf region of interest.
You can ignore all the rest.
This script is not yet cleaned up and I will do so (and give an update here) after my thesis submission …bit more than two weeks. My goal is to create a clean version of the script and add it as a COSIMA recipe.
@olerieke , this thread might also be of interest to you. I will keep you updated.
Thanks @rmholmes and @mauricehuguenin! This looks promising! Look forward to seeing the tutorial when you have time. Good luck on the final stages of the thesis!