[ncl-talk] Issue to fill delimited area (using a shapefile) with a constant value

Thierno Doumbia elthiedo at gmail.com
Sat Jun 20 13:16:39 MDT 2020


Thank you Rick, the initialization of the two variables was missing.

Thierno

Le ven. 19 juin 2020 à 23:07, Rick Brownrigg <brownrig at ucar.edu> a écrit :

> I don't know for certain. If the regions are not overlapping, what about
> initializing "data" and "data_mask" to zero and then simply adding the loop
> results back into those variable each time? Something like
>
> data = data +  (/shapefile_mask_data(dgrid_fs,shp_path,opt)/)
> ...
> data_mask(j,i) = data_mask(j,i) + vtrend(0,ir)/100.
>
> Rick
>
>
> On Fri, Jun 19, 2020 at 1:24 PM Thierno Doumbia <elthiedo at gmail.com>
> wrote:
>
>> Hi,
>> If that is exactly what I done, it was not what I wanted. In this case
>> how do I get a single variable containing data for all regions ?
>>
>> Thank you
>> Thierry
>>
>> Le ven. 19 juin 2020 à 20:53, Rick Brownrigg <brownrig at ucar.edu> a
>> écrit :
>>
>>> Hi,
>>>
>>> If I read the script correctly, it looks like you are looping over
>>> region names and over writing the variables "data" and "data_mask" each
>>> time through. Then  the plot is generated after the loop has terminated --
>>> the values of data and data_mask would contain the last region.
>>>
>>> ??
>>> Rick
>>>
>>>
>>> On Fri, Jun 19, 2020 at 12:23 PM Thierno Doumbia via ncl-talk <
>>> ncl-talk at mailman.ucar.edu> wrote:
>>>
>>>> Dear NCL community,
>>>>
>>>> As indicated in the subject line of this mail, I have a problem to
>>>> create a gridded netcdf file containing constant values for different
>>>> regions of the globe, using world administrative boundaries shapefile as a
>>>> mask.
>>>> My code seems to be working for one region. But when I try to loop
>>>> through multiple regions, the result is not what I expected. Please find
>>>> attached my code, the obtained plot and a sample of my data.
>>>>
>>>> I would appreciate it if you would check to see what I have done wrong.
>>>>
>>>> Sincerely,
>>>> --
>>>> Thierry
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at mailman.ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200620/2614d425/attachment.html>


More information about the ncl-talk mailing list