[ncl-talk] Extracting dates when multiple conditions are met

Lyndz olagueralyndonmark429 at gmail.com
Sun May 26 23:12:04 MDT 2019


Dear NCL-experts,

*Details:*
I am extracting the dates from a netcdf file, when multiple conditions are
met. I am using NCL 6.6.2.

The file that I am working with can be accessed from this link:
https://www.dropbox.com/s/cycpbdgxdzsdnbh/test_file_olr_wind_deform.nc?dl=0

This file contains 3 variables: OLR (short); uwnd(float);
stretch_sph(float), with 123 timesteps.

Attached is the script that I am using (date_filter.ncl).
Also attached is the time series of OLR for verification.

*Conditions:*
1. OLR < 240
2. uwnd < 0
3. stretch_sph > 0

*Problem/What I have so far:*
I am filtering these variables using these lines:





*latS = 13.0      latN = 22.0      lonL = 120.0      lonR = 122.5*

*      olr_region=olr(:,{latS:latN},{lonL:lonR})  *

*      u_region=u(:,{latS:latN},{lonL:lonR})
stretch_region=stretch(:,{latS:latN},{lonL:lonR})*










*      olr_threshold = 240      olr_thres  = dim_min_n(olr_region,(/1,2/))
  ;min at each time step      uwnd_threshold = 0      uwnd_thres  =
dim_min_n(u_region,(/1,2/))   ;min at each time step      stretch_threshold
= 0      stretch_thres  = dim_max_n(stretch_region,(/1,2/))   ;max at each
time step       n_thres  = ind((olr_thres .le. olr_threshold) .and.
(uwnd_thres .le. uwnd_threshold) .and. *
*      (stretch_thres .ge. stretch_threshold))*

When I print the dates, I am getting a value at *19810419*, but the time
series shows that the OLR value at this period is above 240; hence, not
satisfying condition 1. I would like to ask for help on how to implement
this correctly in NCL.

*Expected output:*
Netcdf or csv file containing the dates that satisfied the 3 conditions.


I'll appreciate any suggestions.
--
Lyndz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190527/090c28ff/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: date_filter.ncl
Type: application/octet-stream
Size: 2597 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190527/090c28ff/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tseries_olr_1981_v2.png
Type: image/png
Size: 90658 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190527/090c28ff/attachment.png>


More information about the ncl-talk mailing list