[ncl-talk] geolocation_circle and gc_inout

Dennis Shea shea at ucar.edu
Mon Apr 8 22:13:08 MDT 2019


[1]  The variable looks like:

         double pre(time, longitude, latitude) ;
         pre:long_name = "precipitation" ;
         pre:units = "mm" ;
         pre:*_FillValue = NaN *;     *<=== NaN not recognized by NC*L


[2]  The precipitation *does* have values of 0.0. In fact: **MANY** of them

       *%>* *ncl_filedump* all_mar.nc -v pre | less

     This is **your** responsibility to look-at (explore) the variable.

[3] **You** set values 0.0 to _FillValue

      nonzerototmar = *where*(totmar.eq.0.0, prc2_reorder at _FillValue,
totmar)

      By default:  _FillValue are set to background (no color)

[4] The polyg geolocation scripts [29-31] examples had the plotting in the
following loop.

 do i =0,nLoc-1
    do j = 0,nRad-1

[SNIP]

--
You had no plotting whatsoever.

Attached is a subset of what I *think* you intended.
I'm done!




On Fri, Apr 5, 2019 at 6:49 PM Md. Jalal Uddin <dmjalal90 at gmail.com> wrote:

> Sir,
>
> As I don't have 0.0 value within 500 km. What should I do to get
> the precipitation value within circles?
>
> It would be a great help to me.
>
> Best Regards,
> Jalal
>
>
> On Tue, Apr 2, 2019 at 6:59 AM Md. Jalal Uddin <dmjalal90 at gmail.com>
> wrote:
>
>> Sorry, sir. I don't have the 0.0 value within 500 km. Please look at the
>> attached figures.
>>
>> On Mon, Apr 1, 2019 at 10:14 PM Dennis Shea <shea at ucar.edu> wrote:
>>
>>> [1]   Save time:   change *N=180* to (say) *N=90*
>>>
>>>         *gc_inout* <http://www.ncl.ucar.edu/Document/Functions/Built-in/gc_inout.shtml>  while written in "C" , it is not particularly  'fast'. It is best to reduce the number of points to check.
>>>
>>> [2] * *YOU*** should put timing checks into your code. This will tell you where the time is being spent. EG:
>>>
>>> beg_script = *get_cpu_time*()
>>>        :
>>>        :
>>>        beg_geo_circle = *get_cpu_time*()
>>>        circle = *geolocation_circle*(slat, slon, srad, sradu, N, optgeo) ; circle is type list
>>> *       print*("geolocation_circle: " + (*get_cpu_time*() - beg_geo_circle)+" seconds")
>>>        :
>>>        :
>>>        beg_gc_inout = *get_cpu_time*()
>>>        latlon_circle := *gc_inout*(lat2d,lon2d, poly_lat,poly_lon)
>>>        print("gc_inout: " + (*get_cpu_time*() - beg_gc_inout)+" seconds")
>>>        :
>>>        :
>>>
>>>        :   at end of script
>>>
>>> print("Script: Total time: " + (*get_cpu_time*() - beg_script)+" seconds")
>>>
>>> [3]
>>> It seems you have 0.0 in your data as both a valid value and as a missing value [_FillValue]?
>>> In your case, you [possibly] have 0.0 values *within* and* outside* 500km. Is that correct?
>>> Currently, values outside the circle are set to False by gc_inout.
>>> You have also, reset value 0.0 to _FillValue.
>>>
>>> If True, you will have to add code to draw a circle.
>>>
>>>
>>>
>>>
>>>
>>> On Fri, Mar 29, 2019 at 5:21 AM Md. Jalal Uddin <dmjalal90 at gmail.com>
>>> wrote:
>>>
>>>> In addition, the do loop is too slow. How can I make it faster?
>>>>
>>>> On Fri, Mar 29, 2019 at 5:04 PM Md. Jalal Uddin <dmjalal90 at gmail.com>
>>>> wrote:
>>>>
>>>>> Thank you, sir, for your kind help. I was able to mask data for
>>>>> multiple cyclone's centres, but the figure did not show the whole circle
>>>>> data (circle_mar.png). I attached the output figure and code in the
>>>>> attachment. Could I have your kind suggestion?
>>>>>
>>>>>
>>>>> On Fri, Mar 29, 2019 at 11:35 AM Dennis Shea <shea at ucar.edu> wrote:
>>>>>
>>>>>> Please see examples 29 and 30 at:
>>>>>>
>>>>>> *https://www.ncl.ucar.edu/Applications/polyg.shtml*
>>>>>> <https://www.ncl.ucar.edu/Applications/polyg.shtml>
>>>>>>
>>>>>> On Thu, Mar 28, 2019 at 2:54 AM Md. Jalal Uddin <dmjalal90 at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> Could anyone give me the idea to mask rainfall data for multiple
>>>>>>> circles? geolocation_circle produce ''circle_lat and lon'' that is 3
>>>>>>> dimensions, but the data lat and lon 1 dimension.
>>>>>>>
>>>>>>> How can be used gc_inout to mask the data inside multiple circles?
>>>>>>> Please look at the multiple circle's figures in the attached file.
>>>>>>>
>>>>>>> Any help would be appreciated.
>>>>>>>
>>>>>>> Variable: circle_lat
>>>>>>> Type: float
>>>>>>> Total Size: 10800 bytes
>>>>>>>             2700 values
>>>>>>> Number of Dimensions: 3
>>>>>>> Dimensions and sizes:   [location | 15] x [radii | 1] x [circle |
>>>>>>> 180]
>>>>>>> Coordinates:
>>>>>>> Number Of Attributes: 7
>>>>>>>   _FillValue :  9.96921e+36
>>>>>>>   radii_input_units :   km
>>>>>>>   radii_input_values :  500
>>>>>>>   radii_converted_units :       great_circle_degrees
>>>>>>>   radii_converted_values :      4.522022
>>>>>>>   long_name :   circle latitudes
>>>>>>>   units :       degrees_north
>>>>>>>
>>>>>>> Variable: circle_lon
>>>>>>> Type: float
>>>>>>> Total Size: 10800 bytes
>>>>>>>             2700 values
>>>>>>> Number of Dimensions: 3
>>>>>>> Dimensions and sizes:   [location | 15] x [radii | 1] x [circle |
>>>>>>> 180]
>>>>>>> Coordinates:
>>>>>>> Number Of Attributes: 7
>>>>>>>   _FillValue :  9.96921e+36
>>>>>>>   radii_converted_values :      4.522022
>>>>>>>   radii_converted_units :       great_circle_degrees
>>>>>>>   radii_input_values :  500
>>>>>>>   radii_input_units :   km
>>>>>>>   long_name :   circle longitudes
>>>>>>>   units :       degrees_east
>>>>>>>
>>>>>>> --
>>>>>>> *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
>>>>
>>>
>>
>> --
>> *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/20190408/a0781cf3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tc500_modi_mar.ncl_test1
Type: application/octet-stream
Size: 9219 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190408/a0781cf3/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tc500_modi_mar.000015.png
Type: image/png
Size: 81170 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190408/a0781cf3/attachment.png>


More information about the ncl-talk mailing list