[ncl-talk] geolocation_circle and gc_inout

Dennis Shea shea at ucar.edu
Mon Apr 1 08:13:49 MDT 2019


[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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190401/ae8e8766/attachment.html>


More information about the ncl-talk mailing list