Hi,
I just started using Python for the last few weeks, and previously been
using GrADS for around 4 years.
I have trouble looking for a simplest way to calculate area average, let
say I need to calculate a SST over a region of 20S-10N and 130E-170E.
I know how to get one point values of SST vs
Hi Fadzil,
All you actually need to do is use numpy.average(), which is numpy's
implementation of the weighted average. It can be shown geometrically that
using the cosine of the latitude as the weights in the weighted average
would give you approximately the area average, though if your SST data
Hi,
I was wanting to use dual scales on my plot and was just running the example
code from
http://matplotlib.org/examples/api/fahrenheit_celsius_scales.html
I subsequently changed the function Tc to read
def Tc(Tf):
return Tf
Fully expecting the two scales to track each other
Thanks Alex for the reply.
So, that script calculates the global SST. What if when we want to
calculate for only in specific box? For example, SST over this area only:
--- 10 N
| |
|
Hi Fadzil,
Ah sorry, I glossed over that part of your question. There are actually two
solutions to this, one would be to actually find the indices where the
latitudes and longitudes are within your desired bounds using
numpy.where(). However I generally prefer to use numpy's built-in fancy
You're not adding your subplot to an existing figure, so a new one is
created.
put fig = plt.figure(...) at the top of your script and replace axii =
plt.subplot(numalp, numobs, axisNum) with axii = fig.add_subplot(numalp,
numobs, axisNum)
On Sat, Feb 22, 2014 at 5:28 PM, Gabriele Brambilla