[ncl-talk] trajectories with annotate_4.ncl script

Henri Rossi Pinheiro henrirpinheiro at gmail.com
Wed Sep 23 11:27:19 MDT 2015


Rick

yes your first approach works for me. Thank you so much for helping.

Henri

On 23 September 2015 at 18:01, Rick Brownrigg <brownrig at ucar.edu> wrote:

> One approach might be using a "missing_value". The new() statement takes
> an optional 3rd parameter that specifies a missing_value.  So for example:
>
>    xp = new((/ 5,4 /), float, -999.)
>
>   xp(0,:) = (/ 29.1,   30.3,   31.7,   33.5, -999./)
>
>   xp(1,:) = (/-94.87, -95.08, -95.13, -94.65, -94.50/)
>
> Another approach might be to use a 1D array of type "list".  Its elements
> would then be lists, which can be of variable length. Note that lists also
> can contain elements of varying type too:
>
>    xp = new((/ 5,4 /), list)
>
>   xp(0,:) = [/ 29.1,   30.3,   31.7,   33.5, -999./]
>
>   xp(1,:) = [/-94.87, -95.08, -95.13, -94.65, -94.50/]
>
> It kind of depends on how you want to iterate over or otherwise use the
> inner elements.
>
> Does this make sense?
>
> Rick
>
>
> On Wed, Sep 23, 2015 at 10:11 AM, Henri Rossi Pinheiro <
> henrirpinheiro at gmail.com> wrote:
>
>> hi Rick
>>
>> I'm sorry forgot to say that the original script is setup as the
>> following way as you comment:
>>
>>    xp = new((/5,4/),float)            ; allocate memory
>>    yp = new((/5,4/),float)
>>
>> But how would you do if having two tracks with different lengths for
>> example
>>
>> ;best track
>>    yp(0,:) = (/ 29.1,   30.3,   31.7,   33.5/)
>>    xp(0,:) = (/-94.6,  -95.2,  -95.3,  -94.9/)
>> ;da
>>    yp(1,:) = (/ 29.12,  30.02,  31.29,  33.05,  34.20/)
>>    xp(1,:) = (/-94.87, -95.08, -95.13, -94.65, -94.50/)
>>
>> Regards
>>
>> Henri
>>
>>
>>
>>
>> On 23 September 2015 at 17:00, Rick Brownrigg <brownrig at ucar.edu> wrote:
>>
>>> Hi,
>>>
>>> If I were to guess, you have this declaration of these two arrays:
>>>
>>>    xp = new((/6,5/),float)            ; allocate memory
>>>    yp = new((/6,5/),float)
>>>
>>> But then you have three instances were you attempt to assign the
>>> righthand side of the arrays to an array of dimension 4, not 5:
>>>
>>> ;best track
>>>    yp(0,:) = (/ 29.1,   30.3,   31.7,   33.5/)
>>>    xp(0,:) = (/-94.6,  -95.2,  -95.3,  -94.9/)
>>> ;da
>>>
>>>
>>> Hope that helps...
>>> Rick
>>>
>>> On Wed, Sep 23, 2015 at 9:23 AM, Henri Rossi Pinheiro <
>>> henrirpinheiro at gmail.com> wrote:
>>>
>>>> hi users
>>>>
>>>> I have used the classic example to plot trajectories with the
>>>> annotate_4.ncl script (attached) and it works. The problem is when one or
>>>> more lat-lon points are added to a single trajectory, so would anyone know
>>>> how to deal with this?
>>>>
>>>> the error message is
>>>>
>>>>       fatal:Dimension size mismatch on subscript #1, left-hand and
>>>> right-hand side dimensions do  not match
>>>>
>>>> Henri
>>>>
>>>> _______________________________________________
>>>> 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/20150923/91530af5/attachment-0001.html 


More information about the ncl-talk mailing list