Re: Segmentation fault, nglYAxisType

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 21 2010 - 07:43:11 MDT

Hi Koyla,

I've figured out why it's core dumping, but I'm not sure what the proper fix is.

The problem is that an sfYArray is being set, but no sfXArray. Internally, PyNGL
is trying to retrieve sfXArray, and fails on this.

The work-around is to go ahead and set sfXArray to what it's defaulting to:

resources.sfXArray = [0,1,2,3,4,5,6,7,8,9]

I'm in a workshop this week. I'll try to look at this more later.

--Mary

On Jul 20, 2010, at 4:35 PM, Nikolay Koldunov wrote:

> Hello Sasha,
>
> Thanks for your response. But the resulting image still have irregular
> Y axis, and additionally
> resources.trYReverse = True
> doesn't work :(
>
> I believe that the name of the resource is right and there is
> something else that I missing, or there is something wrong in the Ngl
> code.
>
> Anyway many thanks for your try!
>
> Kolya
>
> On Tue, Jul 20, 2010 at 11:54 PM, Oleksandr Huziy <guziy.sasha@gmail.com> wrote:
>> Hello Kolya,
>>
>> works for me like this(produced image is attached), this is my first use of
>> ngl))
>>
>> import Ngl
>> import numpy
>>
>>
>> def main():
>> foo = numpy.load('outfile1.npz')
>> print 'loaded'
>> print repr(foo)
>> llev = foo['arr_0']
>> temp_prof = foo['arr_1']
>>
>> # llev = numpy.arange(0,10.0,0.1)
>> # temp_prof = 0.25 * llev
>>
>> print 'read in the array'
>>
>> wkres = Ngl.Resources()
>> # wkres.wkColorMap = "gui_default"
>> wks_type = "ps"
>> wks = Ngl.open_wks(wks_type,"axix_line",wkres)
>>
>> resources = Ngl.Resources()
>> resources.sfMissingValueV = -9.99999978e22
>> resources.sfYArray = llev[:]
>> resources.trYAxisType = "LinearAxis" #I think your error was here, the
>> name of the resource was wrong
>>
>> resources.trYLog = False
>>
>> resources.cnFillOn = True
>> resources.trYReverse = True
>>
>> print temp_prof.shape
>> print llev.shape
>>
>> Ngl.contour(wks, temp_prof,resources)
>> Ngl.end()
>>
>> if __name__ == '__main__':
>> main()
>>
>> --
>> good luck
>> Sasha
>>
>>
>>
>> 2010/7/20 Nikolay Koldunov <koldunovn@gmail.com>
>>>
>>> Dear list members,
>>>
>>> I have a problem with nglYAxisType resource. When I am trying to set
>>> it to "linearaxis" or "logaxis" it cause segmentation fault error.
>>> Default "irregularaxis" works fine.
>>> I test it with different data values (salinity and temperature) but
>>> the error is still there.
>>>
>>> My script and two files with the data are in attachment.
>>>
>>> version = '1.3.0b3'
>>> array_module = 'numpy'
>>> array_module_version = '1.3.0'
>>> python_version = '2.6'
>>>
>>> Any help will be very much appreciated.
>>>
>>> Kolya
>>>
>>> --
>>> Nikolay Koldunov
>>> University of Hamburg
>>> Institute of Oceanography
>>> KlimaCampus
>>>
>>> koldunovn@gmail.com
>>> nikolay.koldunov@zmaw.de
>>> ph. +49 40 42838 7580
>>> Grindelberg 5, room 211,
>>> 20144 Hamburg, Germany
>>>
>>> _______________________________________________
>>> pyngl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>>>
>>
>>
>
>
>
> --
> Nikolay Koldunov
> University of Hamburg
> Institute of Oceanography
> KlimaCampus
>
> koldunovn@gmail.com
> nikolay.koldunov@zmaw.de
> ph. +49 40 42838 7580
> Grindelberg 5, room 211,
> 20144 Hamburg, Germany
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Wed Jul 21 07:43:16 2010

This archive was generated by hypermail 2.1.8 : Wed Aug 04 2010 - 09:35:05 MDT