[Thread Prev][Thread Next][Index]

[ferret_users] select month



Hi ferreters,

I have found very convenient to use the function TAX_DATESTRING to get the date
as a string and then test with STRINDEX the presence of a specific month
to select specific month in a time serie.

I am sure you can perform this selection by playing with indices but I didn't want
any assumption on the starting month (l=1 in not always january).

In addition, this is very short to write without any additionnal variable declaration.
So just to keep a trace. Let me know if this can be achieve with another simpler way.

Happy ferreting.
Regards
Patrick

!=====================================

use monthly_navy_winds
 
let var=UWND[i=@ave,j=@ave]

let var_MAR = if STRINDEX(TAX_DATESTRING(t[gt=var], var[i=1,j=1], "month"), "MAR") then var
let var_SEP = if STRINDEX(TAX_DATESTRING(t[gt=var], var[i=1,j=1], "month"), "SEP") then var

! I have specified var[i=1,j=1] to limit memory usage

 
ppl color 6, 70,70,70
 
plot/grat=(dash,color=6) var
plot/over/symbol=22/color=blue/title="March" var_MAR
plot/over/symbol=22/color=red/title="September"  var_SEP



-- 
Data Analysis and Visualization Engineer
LSCE/IPSL, CEA-CNRS-UVSQ laboratory
LSCE - Climate and Environment Sciences Laboratory
IPSL - Institut Pierre Simon Laplace
--

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement