[ncl-talk] Problem with contour plot

Rick Brownrigg brownrig at ucar.edu
Thu Apr 20 10:48:51 MDT 2017


Hi Guilherme,

In function get_areas_of_interest(), line 28:

return(features(ind(.not.ismissing(features))))

for whatever reason, "features" contains all missing values, and
.not.ismissing(features) returns all False. The docs for ind() state that
if there are no values that evaluate to true, it returns a missing value,
which for integer types is -2147483647, and that's where the index out of
range comes from :-/

So, I don't know why features is coming up all missing, but perhaps that
gives and idea where to look.

Hope that helps...
Rick

On Thu, Apr 20, 2017 at 6:27 AM, Guilherme Martins <jgmsantos at gmail.com>
wrote:

> Dear Mary,
>
> Thank you for all informations.
>
> I'm finishing my script using your informations (shapefiles_21.ncl) but I
> found a problem.
>
> When I run my script, I got that message:
>
> fatal:Subscript out of range, error in subscript #0
> fatal:An error occurred reading features
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 28 in
> file teste.ncl
>
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 132 in
> file teste.ncl
>
> I am using the "sigla" variable that has 5 informations (S, SE, N, NE,
> CO), and I can only pass 4 parameters in the "get_areas_of_interest"
> function. If I try to pass 5 parameters (S, SE, N, NE, CO), the script
> returns the above error. The goal is to use the 5 parameters in the
> function.
>
> The script and data can download at:
>
> http://ftp-supercomputacao.inpe.br/public/jose.martins/teste.tar.gz
>
> The shapefile informations (*.png) are in attachment.
>
> Guilherme Martins.
>
>
>
> Em seg, 17 de abr de 2017 às 18:02, Mary Haley <haley at ucar.edu> escreveu:
>
>> Guilherme,
>>
>> Please see examples shapefiles_21.ncl at:
>>
>> http://www.ncl.ucar.edu/Applications/shapefiles.shtml#ex21
>>
>> It explains why you see these "blocky" contours in NCL.
>>
>> Simply put, if you have four points that represent a box at the edge of a
>> domain, and three of them have data one them and one is missing, then NCL
>> will only draw contours in half of the box, because it won't extrapolate to
>> that missing point.
>>
>> The real question is: do you simply want the graphics not to have gaps,
>> or do you actually want there to be data in locations that fall just
>> outside the geographical boundary?  You can do things to force values just
>> outside the geographical boundary, but this depends on how you are masking
>> in the first place.
>>
>> If you are masking based on a shapefile, then see example
>> shapefiles_18.ncl on the same page:
>>
>> http://www.ncl.ucar.edu/Applications/shapefiles.shtml#ex18
>>
>> Note, however, that this mask is now returning values outside the range
>> of interest.
>>
>> If you are simply trying to mask your data *graphically* by some
>> geographical area, then instead of trying to use a mask function, you can
>> draw the full data, and then draw polygons filled in with white in the
>> areas you don't want to see graphically.  That's what example 21 is showing.
>>
>> --Mary
>>
>>
>> On Mon, Apr 17, 2017 at 1:00 PM, Guilherme Martins <jgmsantos at gmail.com>
>> wrote:
>>
>>> Dear users,
>>>
>>> After searching extensively on the NCL website I was not able to find a
>>> solution to my problem. I only want values within the contour of the
>>> continent, but some edges appear in the figure that are stemming from the
>>> mask that I applied and I do not know how to remove this. The figure is
>>> attached for a better view of my problem.
>>>
>>> Best regards,
>>>
>>> Guilherme.
>>> --
>>> ------------------------------------------------------------
>>> ------------------------------------
>>> Instituto Nacional de Pesquisas Espaciais (INPE)
>>> Centro de Previsão de Tempo e Estudos Climáticos (CPTEC)
>>> Divisão de Satélites e Sistemas Ambientais (DSA)
>>> Programa de Monitoramento de Queimadas
>>> Telefone (INPE/CP): +55 12 3186-9205 <+55%2012%203186-9205> || Celular
>>> (TIM): +55 12 98111-4292 <+55%2012%2098111-4292>
>>> E-mail: guilherme.martins at inpe.br || jgmsantos at gmail.com
>>> Skype: guilherme.martins.
>>> Homepage: https://sites.google.com/site/jgmsantos
>>> Currículo Lattes: http://lattes.cnpq.br/5997657584785803
>>> ------------------------------------------------------------
>>> ------------------------------------
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>> --
> ------------------------------------------------------------
> ------------------------------------
> Instituto Nacional de Pesquisas Espaciais (INPE)
> Centro de Previsão de Tempo e Estudos Climáticos (CPTEC)
> Divisão de Satélites e Sistemas Ambientais (DSA)
> Programa de Monitoramento de Queimadas
> Telefone (INPE/CP): +55 12 3186-9205 <+55%2012%203186-9205> || Celular
> (TIM): +55 12 98111-4292 <+55%2012%2098111-4292>
> E-mail: guilherme.martins at inpe.br || jgmsantos at gmail.com
> Skype: guilherme.martins.
> Homepage: https://sites.google.com/site/jgmsantos
> Currículo Lattes: http://lattes.cnpq.br/5997657584785803
> ------------------------------------------------------------
> ------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20170420/0dc6e504/attachment.html 


More information about the ncl-talk mailing list