# Calculate the latitudes of a Gaussian Grid

I would like to calculate the latitude values of a Gaussian Grid of a size of my choosing. Unfortunately, I didn't find a method or a formula to do so. Where can I find this information? Alternatively, is there a function publicly available that can do the job?

• What do you mean by calculate? How are you setting the grid up? Latitude is one coordinate of the Gaussian Grid. It is set up like a grid in spherical coordinates. – BarocliniCplusplus Mar 16 '17 at 15:21
• The Gaussian grid of a specified size only has points at certain latitudes (as e.g. shown in the image of the linked Wikipedia article). I would like to calculate these latitude values. – Ethunxxx Mar 16 '17 at 15:25
• HINT: NCL can do it if you can get the google search right. I mean there is a function in NCL to do this. :-) Heck if I am going to share it ;-) – gansub Mar 16 '17 at 16:22
• @gansub, I looked it up. You are right! If you like you can post this as an answer and I will then accept it. – Ethunxxx Mar 17 '17 at 8:02
• @Ethunxxx - if you are not happy with NCL then just download the source code and look at the method gaus and translate that into your favorite programming language. – gansub Mar 17 '17 at 15:57

I believe the NCL function NCL gaus should be able to give you the solution you are looking for. From the API documentation you are requested to provide - the number of latitude points per hemisphere and you should get Gaussian latitudes and Gaussian weights.

Here is a code sample from their website

nlat = 64  ; for globe
gau_info = gaus(nlat/2)   ; divide by 2 to get "per hemisphere"
glat     = gau_info(:,0)  ; gaussian latitudes ( 1st dimension of gau_info)
gwgt     = gau_info(:,1)  ; gaussian weights   ( 2nd dimension of gau_info)


if you want pure python

conda install cdms2 -c conda-forge

then in python:

lats = cdms2.createGaussianAxis(128)

you can also create a full lat/lon grid:

grid = cdms2.createGaussianGrid(128)