Using 1D FFT to decompose the provided hurricane data in terms of wavenumbers. [message #90487] |
Wed, 04 March 2015 15:10  |
twiel002
Messages: 1 Registered: March 2015
|
Junior Member |
|
|
I have 240x240 array of hurricane wind speed.
1) I need to covert to polar coordinates and plot the speed on a contour map with a radius of [-108,108], however what I have doesn't appear to be correct.
My Code:
Pro Projet2COORD
;;;---Reading in the data---;;;
rows = 240
cols = 240
spd = FltArr(240,240)
OpenR, lun, 'speed.csv', /Get_Lun
ReadF, lun, spd
Free_Lun, lun
print, spd
rows = 240
cols = 240
X = FltArr(240,240)
OpenR, lun, 'Xdir.csv', /Get_Lun
ReadF, lun, X
Free_Lun, lun
print, X
rows = 240
cols = 240
Y = FltArr(240,240)
OpenR, lun, 'Ydir.csv', /Get_Lun
ReadF, lun, Y
Free_Lun, lun
print, Y
;;;---Interpolate the coordinates---;;;
R=sqrt(X^2+Y^2)
Theta=atan(Y/X)*2*!PI
spd1=Polar_Surface(spd, R, Theta)
unsmooth = CONTOUR(spd1, TITLE='Hurricane Wind Speed', $
LAYOUT=[2,1,1], RGB_TABLE=13, /FILL, N_LEVELS=12)
; Draw the outline of the 12 levels
outline1 = CONTOUR(spd1, N_LEVELS=12, /OVERPLOT)
2) I need to then decompose the speed into wavenumbers using a 1D FFT, however I have no idea how to plot these wavenumbers on a similar plot to the polar plot from above.
I need wavenumbers 0-3, the sum of those wavenumbers, and wavenumbers 0-9.
Any assistance is appreciated.
|
|
|
Re: Using 1D FFT to decompose the provided hurricane data in terms of wavenumbers. [message #90494 is a reply to message #90487] |
Thu, 05 March 2015 07:32   |
Burch
Messages: 28 Registered: December 2013
|
Junior Member |
|
|
On Wednesday, March 4, 2015 at 5:11:01 PM UTC-6, twie...@fiu.edu wrote:
> I have 240x240 array of hurricane wind speed.
>
> 1) I need to covert to polar coordinates and plot the speed on a contour map with a radius of [-108,108], however what I have doesn't appear to be correct.
> Theta=atan(Y/X)*2*!PI
Calculating theta in this way will give you incorrect results. For instance, notice that
IDL> y = 1.0/2.0
IDL> x = -1.0/2.0
IDL> print, atan(y/x)
-0.785398
and
IDL> y = -1.0/2.0
IDL> x = 1.0/2.0
IDL> print, atan(y/x)
-0.785398
give the same result even though the locations are in different quadrants! You should use the two argument form of atan()
Theta = atan(y, x)
This will give you results ranging from -pi to pi. To change to 0 to 2 pi do
Theta = (theta + 2.0*!pi) mod (2.0*!pi)
-Jeff
|
|
|
|