cosine weighting [message #74799] |
Tue, 01 February 2011 16:52  |
Jennifer Genderson
Messages: 1 Registered: February 2011
|
Junior Member |
|
|
I have global gridded surface temperature data. The data are monthly-
means gridded on a 5x5 degree mesh. The matrix is size 612(rows) x
2592(columns). The first row is January 1958; the last row is December
2008.
For each row: The first 72 numbers correspond to data centered 87.5
degrees South: the first element centered at 2.5 E, the second 7.5
E ... the 72nd element at 357.5 E. Successive sets of 72 numbers
correspond to data at 82.5 South, 77.5 South, and so on until 87.5
North.
I need to use cosine weighting, since grid boxes get smaller towards
the poles. So each set of 72 numbers in each row needs to be
multiplied by 87.5, then 82.5… etc. (converted to radians). Could I
get some guidance on how to go about this? How to do this in a loop,
or create a matrix with all the cosine weights in it?
|
|
|
Re: cosine weighting [message #74836 is a reply to message #74799] |
Wed, 02 February 2011 19:37  |
Jeremy Bailin
Messages: 618 Registered: April 2008
|
Senior Member |
|
|
I'd do something like:
latitudes = -87.5 + 5. * findgen(36)
latitudes_matrix = rebin(transpose(latitudes), 612, 2592, /sample)
matrix *= cos(latitudes_matrix * !dtor)
|
|
|