[ncl-talk] stat_dispersion
Mary Haley
haley at ucar.edu
Thu Oct 9 16:38:08 MDT 2014
Jonathan,
Did anybody ever respond to this one?
If not, the code is quite complex, and it would be useful if you could
provide a full script and data.
--Mary
On Fri, Sep 26, 2014 at 3:30 PM, jbuzan <jbuzan at purdue.edu> wrote:
> I am having some issues with stat_dispersion.
> Perhaps my code ‘fixes’ cause the issue. I am not sure.
>
> I have 2 datasets:
> time: 1460 lat: 192, lon 288
> time: 2920 lat: 192, lon 288
> I have added a second year to the original year (both 1460 time steps).
> The stat_dispersion, in theory, should have the same minimum and maximum
> values.
>
> The data is partitioned by Temperature and by a difference field.
> Here is a snippet of the code that does the partitioning:
> do k = 0, dimsizes(numvar)-1
> ;do k = 16, 16
> thresholdstart = k*5.d + 200.d
> print(thresholdstart)
> thresholdend = k*5.d + 205.d
> print(thresholdend)
> ; location = ind(temperature1d.lt.thresholdend)
> location =
> ind(temperature1d.lt.thresholdend.and.temperature1d.ge.thresholdstart)
> ; printVarSummary(location)
> ; print(location)
> if(.not.all(ismissing(location)))
> tbin = wetbulb1d(location)
> else
> tbin = value
> tbin at _FillValue = value
> end if
> ; print(tbin)
>
> if(.not.all(ismissing(tbin)))
> tbin at _FillValue = -999.d
> delete(tbin at _FillValue)
> numarray(:,k) = stat_dispersion(tbin,opt)
> else
> numarray(:,k) = value
> end if
> delete(tbin)
> delete(location)
> ; print(numarray)
> end do
> numarray = where(numarray.eq.-999.d,value,numarray)
>
> replace_ieeenan (numarray, value, 0)
> numarray at _FillValue = value
> numarray at missing_value = numarray at _FillValue
> numarray!0 = "stat"
> numarray!1 = "bin"
> numarray&bin = numvar
> printVarSummary(numarray)
>
> Here is a snippet of the code that grabs the values:
> box_var = numvar
> box_var at long_name = longnamea
> box_var at units = unitsa
> ;box_var(:,0) = field1c(22,:)
> box_var(:,0) = field1c(2,:)
> box_var(:,1) = field1c(24,:)
> box_var(:,2) = field1c(8,:)
> box_var(:,3) = field1c(25,:)
> box_var(:,4) = field1c(14,:)
> ;box_var(:,4) = field1c(26,:)
>
> field1c of 14 and 2 are the maximum and minimums from Stat_Dispersion.
> I think the issue is that stat_dispersion field becomes too large, and
> drops something. It might be how I characterize the missing values.
>
> Any help would be appreciated.
>
> -Jonathan
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141009/674895a1/attachment.html
More information about the ncl-talk
mailing list