comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » cosine weighting
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
cosine weighting [message #74799] Tue, 01 February 2011 16:52 Go to next message
Jennifer Genderson is currently offline  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 Go to previous message
Jeremy Bailin is currently offline  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)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Writing an efficient array operation in IDL
Next Topic: Lists in strsplit

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:54:28 PDT 2025

Total time taken to generate the page: 0.00555 seconds