[ncl-talk] dim_variance_n_Wrap
Dennis Shea
shea at ucar.edu
Sun Jan 20 08:39:08 MST 2019
The *printVarSummary*(...) is for *you *to examine.
Variable: prcRain
Type: double
...
Dimensions and sizes: [time | 2847] x [latitude | 120] x [longitude | 180]
Coordinates:
time: [ 120..6939]
latitude: [0.125..29.875]
longitude: [65.125..109.875]
Number Of Attributes: 4
*missing_value : -nan*
long_name : precipitation
units : mm
*_FillValue : -nan===*
NCL does not recognize "nan" , "NaN", "-nan", ......
The 'nan' *must* be converted to a number.
I believe we have asked you to read documentation. Specifically, the
User Guide at
* https://www.ncl.ucar.edu/Document/Manuals
<https://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide/>
https://www.ncl.ucar.edu/ <goog_204742505>Document/Manuals/NCL_User_
<goog_204742505>Guide/NCL_User_Guide_v1.1_ <goog_204742505>Legal.pdf
<http://Legal.pdf>*
*Section 13.2:* Convert NaNs (not a number) to _FillValue ....
page 203
============
f = addfile("all_BoB.nc", "r")
prc =f->pre(:,{65:110},{0:30}) ; type double
if *(any <http://www.ncl.ucar.edu/Document/Functions/Built-in/any.shtml>(isnan_ieee
<http://www.ncl.ucar.edu/Document/Functions/Built-in/isnan_ieee.shtml>(*prc*)))
*then
value = -999.0d ; prc is 'double'
* replace_ieeenan
<http://www.ncl.ucar.edu/Document/Functions/Built-in/replace_ieeenan.shtml>
(*prc, value, 0)
prc at _FillValue = value
prc at missing_value = value
end if
prcTrace = 1.0d ; mm
prcRain = *where*
<https://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml>(prc_reorder.ge.prcTrace,
prc_reorder, prc_reorder at _FillValue)
* : :*
On Sat, Jan 19, 2019 at 5:39 PM Md. Jalal Uddin <dmjalal90 at gmail.com> wrote:
>
> The minimum and maximum value showed nan:
> (0) precipitation (mm) : min=-nan max=-nan
> (0) Rain Total on Rain Days: prcTrace=1 (mm) : min=-nan max=-nan
> (0) Rain Varianceon Rain Days: prcTrace=1 (mm) : min=-nan max=-nan
>
> Please find the printVarSummary, errors, and script in the attachment.
>
>
> On Sat, Jan 19, 2019 at 11:49 PM Dennis Shea <shea at ucar.edu> wrote:
>
>>
>> f = addfile("all_BoB.nc", "r")
>> prc =f->pre(:,{65:110},{0:30})
>>
>> prc_reorder = prc(time|:,latitude|:,longitude|:)
>> ;printVarSummary(prc_reorder)
>> ;printMinMax(prc_reorder,0)
>>
>> prcTrace = 1.0 ; mm
>> prcRain = *where*
>> <https://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml>(prc_reorder.ge.prcTrace,
>> prc_reorder, prc_reorder at _FillValue)
>> *copy_VarMeta*
>> <https://www.ncl.ucar.edu/Document/Functions/Contributed/copy_VarMeta.shtml>(prc_reorder,
>> prcRain)
>> ;printVarSummary(prcRain)
>> ;printMinMax(prcRain,0)
>>
>> prcDayRainAvg = *dim_avg_n_Wrap*
>> <https://www.ncl.ucar.edu/Document/Functions/Contributed/dim_avg_n_Wrap.shtml>(prcRain,
>> 0)
>> prcDayRainAvg at long_name = "Rain Total on Rain Days: prcTrace="+prcTrace
>> prcDayRainVar = *dim_variance_n_Wrap*
>> <https://www.ncl.ucar.edu/Document/Functions/Contributed/dim_variance_n_Wrap.shtml>
>> (prcRain,0)
>> rcDayRainVar at long_name = "Rain Varianceon Rain Days: prcTrace="+prcTrace
>>
>> ;printVarSummary(prcDayRainAvg)
>> ;printMinMax(prcDayRainAvg,0)
>>
>> ;printVarSummary(prcDayRainVar)
>> ;printMinMax(prcDayRainVar,0)
>>
>> You will still get large variance numbers. Rain amounts span prcTrace to
>> (say) 500.
>>
>>
>>
>> On Fri, Jan 18, 2019 at 11:38 PM Md. Jalal Uddin <dmjalal90 at gmail.com>
>> wrote:
>>
>>> Thanks for your kind explanation. Could I calculate and plot of per day
>>> variance, also for greater than 0 rainfall?
>>>
>>> On Thu, Jan 17, 2019 at 1:58 PM Dennis Shea <shea at ucar.edu> wrote:
>>>
>>>> More:
>>>> *dim_variance_n_Wrap*(prc_reorder,*0*) ; variance over *all days*: *DRY
>>>> and WET* seasons
>>>>
>>>> Consider Pune, India.
>>>> (say; made up numbers) day 170: mean over DRY and WET seasons
>>>> 10mm; range 0-500mm
>>>>
>>>>
>>>> On Thu, Jan 17, 2019 at 2:12 PM Dennis Shea <shea at ucar.edu> wrote:
>>>>
>>>>> Well, you live with the monsoon.
>>>>>
>>>>> Some days have zero precipitation and some monsoon days have VERY
>>>>> LARGE daily amounts.
>>>>> Hence large variance.
>>>>>
>>>>> On Wed, Jan 16, 2019 at 10:53 PM Md. Jalal Uddin <dmjalal90 at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I am getting a too large variation of rainfall. I used
>>>>>> dim_variance_n_Wrap function to calculate variance. The first figure is for
>>>>>> the mean rainfall and the second one is for variance at the same time.
>>>>>>
>>>>>> Could anyone help me to understand where I am wrong?
>>>>>>
>>>>>> Variable: prc_reorder
>>>>>> Type: double
>>>>>> Total Size: 491961600 bytes
>>>>>> 61495200 values
>>>>>> Number of Dimensions: 3
>>>>>> Dimensions and sizes: [time | 2847] x [latitude | 120] x [longitude
>>>>>> | 180]
>>>>>> Coordinates:
>>>>>> time: [ 120..6939]
>>>>>> latitude: [0.125..29.875]
>>>>>> longitude: [65.125..109.875]
>>>>>> Number Of Attributes: 4
>>>>>> missing_value : -nan
>>>>>> _FillValue : -nan
>>>>>> units : mm
>>>>>> long_name : precipitation
>>>>>>
>>>>>> Best regards,
>>>>>> Jalal
>>>>>> --
>>>>>> *Md. Jalal Uddin*
>>>>>> MSc in Applied Meteorology (English Language)
>>>>>> Nanjing University of Information, Science and Technology, China
>>>>>> B.Sc. in Disaster Management (Hons.)
>>>>>> Patuakhali Science and Technology University, Bangladesh.
>>>>>> Cell: +8613260859092, +8801792052662
>>>>>> Web: www.dmjalal90.weebly.com
>>>>>> Facebook: jalal.hossen.39
>>>>>> LinkedIn: https://bd.linkedin.com/in/md-jalal-uddin-80a026b0
>>>>>> Twitter: dmjalal90
>>>>>> Skype: dmjalal90
>>>>>> _______________________________________________
>>>>>> ncl-talk mailing list
>>>>>> ncl-talk at ucar.edu
>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>>
>>>>>
>>>
>>> --
>>> *Md. Jalal Uddin*
>>> MSc in Applied Meteorology (English Language)
>>> Nanjing University of Information, Science and Technology, China
>>> B.Sc. in Disaster Management (Hons.)
>>> Patuakhali Science and Technology University, Bangladesh.
>>> Cell: +8613260859092, +8801792052662
>>> Web: www.dmjalal90.weebly.com
>>> Facebook: jalal.hossen.39
>>> LinkedIn: https://bd.linkedin.com/in/md-jalal-uddin-80a026b0
>>> Twitter: dmjalal90
>>> Skype: dmjalal90
>>>
>>
>
> --
> *Md. Jalal Uddin*
> MSc in Applied Meteorology (English Language)
> Nanjing University of Information, Science and Technology, China
> B.Sc. in Disaster Management (Hons.)
> Patuakhali Science and Technology University, Bangladesh.
> Cell: +8613260859092, +8801792052662
> Web: www.dmjalal90.weebly.com
> Facebook: jalal.hossen.39
> LinkedIn: https://bd.linkedin.com/in/md-jalal-uddin-80a026b0
> Twitter: dmjalal90
> Skype: dmjalal90
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190120/e505d267/attachment.html>
More information about the ncl-talk
mailing list