@@ -336,7 +336,7 @@ def resolveWavesHayashi(varfft: xr.DataArray, nDayWin: int, spd: int) -> xr.Data
336336 varspacetime = np .full (nshape , np .nan , dtype = type (varfft ))
337337 # first two are the negative wavenumbers (westward), second two are the positive wavenumbers (eastward)
338338 logging .debug (
339- f"[Hayashi] Assign values into array. Notable numbers: mlon//2={ mlon // 2 } , N//2={ N // 2 } "
339+ f"[Hayashi] Assign values into array. Notable numbers: mlon//2={ mlon // 2 } , N//2={ N // 2 } "
340340 )
341341 varspacetime [..., 0 : mlon // 2 , 0 : N // 2 ] = varfft [
342342 ..., mlon // 2 : 0 : - 1 , N // 2 :
@@ -354,8 +354,8 @@ def resolveWavesHayashi(varfft: xr.DataArray, nDayWin: int, spd: int) -> xr.Data
354354 # Create the real power spectrum pee = sqrt(real^2+imag^2)^2
355355 logging .debug ("calculate power" )
356356 pee = (
357- np .abs (varspacetime )
358- ) ** 2 # JJB: abs(a+bi) = sqrt(a**2 + b**2), which is what is done in NCL's resolveWavesHayashi
357+ ( np .abs (varspacetime )) ** 2
358+ ) # JJB: abs(a+bi) = sqrt(a**2 + b**2), which is what is done in NCL's resolveWavesHayashi
359359 logging .debug ("put into DataArray" )
360360 # add meta data for use upon return
361361 wave = np .arange (- mlon // 2 , (mlon // 2 ) + 1 , 1 , dtype = int )
@@ -374,9 +374,9 @@ def resolveWavesHayashi(varfft: xr.DataArray, nDayWin: int, spd: int) -> xr.Data
374374 if (c != "wavenumber" ) and (c != "frequency" ):
375375 ocoords [c ] = varfft [c ]
376376 elif c == "wavenumber" :
377- ocoords ["wavenumber" ] = wave # type: ignore
377+ ocoords ["wavenumber" ] = wave
378378 elif c == "frequency" :
379- ocoords ["frequency" ] = freq # type: ignore
379+ ocoords ["frequency" ] = freq
380380 pee = xr .DataArray (pee , dims = odims , coords = ocoords )
381381 return pee
382382
@@ -616,9 +616,7 @@ def spacetime_power(
616616 return z_final
617617
618618
619- def genDispersionCurves (
620- nWaveType = 6 , nPlanetaryWave = 50 , rlat = 0 , Ahe = [50 , 25 , 12 ]
621- ): # noqa: C901
619+ def genDispersionCurves (nWaveType = 6 , nPlanetaryWave = 50 , rlat = 0 , Ahe = [50 , 25 , 12 ]): # noqa: C901
622620 """
623621 Function to derive the shallow water dispersion curves. Closely follows NCL version.
624622
0 commit comments