python and filter design: calculating "s" optimal transform

2010-06-01 Thread robert somerville
Hi; this is an airy question. does anybody have some code or ideas on how to calculate the optimal "S" transform of user specified order (wanting the coefficients) for a published filter response curve, ie. f(s) = 1.0/(a1*S^2 + a2*S + a3) -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree write creates large one line XML file ....

2010-05-28 Thread robert somerville
Thanks Robert Kern : "prettyprint" ; indent() does the trick ;-) >ElementTree writes exactly what you tell it to. In XML, whitespace is >significant. If you want newlines and/or indentation to make it pretty-looking, >then you need to add those to your elements. > >Fredrik provides an example f

ElementTree write creates large one line XML file ....

2010-05-27 Thread robert somerville
Hi I am using Ubuntu 9.10 and Python 2.6.4 .. when I create an ElementTree object and the write it out using: xml.etree.ElementTree.write() , I get one single long single line files, instead of something that looks reasonable , what gives ??? (and is it important ??) eg: I get : OneTwo instea

re ElemenTree producing and reading examples needed :

2010-05-27 Thread robert somerville
does anybody have some working code that they can point me to so i could see ElemenTtree in action (especially writing XML files) ??? Thanks Robert Somerville -- http://mail.python.org/mailman/listinfo/python-list

Best XML python package to learn for Ubuntu Linux ?

2010-05-19 Thread Robert Somerville
Hi; I am about to get my feet wet with Python XML, there appears to be many libraries ... can someone recommend a good package to use on Ubuntu ??? regards; Robert Somerville -- http://mail.python.org/mailman/listinfo/python-list

How to test whether bit is set within a flag with Python ?

2010-05-12 Thread robert somerville
bit set ?? a & 4 =, true in this case thanks Robert Somerville -- http://mail.python.org/mailman/listinfo/python-list

problems creating and adding class instances to a list:

2010-04-19 Thread Robert Somerville
I am trying to create a list of consisting of multiple instances of the same class, The Problems i am having is that i seem to be accessing the same memory.. How should i solve this Python problem ? Here is some sample code demonstraing my problem (same memory) : from copy import copy as cp cl

Python 2.6 and modules dbi AND odbc

2010-03-10 Thread robert somerville
promising .. Robert Somerville -- http://mail.python.org/mailman/listinfo/python-list

Elementtree install problem in Ubuntu (a newbie ..)

2010-03-10 Thread robert somerville
all last): File "", line 1, in ImportError: No module named elementtree.ElementTree >>> import elementtree Traceback (most recent call last): File "", line 1, in ImportError: No module named elementtree thanks; Robert somerville -- http://mail.python.org/mailman/listinfo/python-list

how to sort two dimensional array ??

2010-01-19 Thread Robert Somerville
Hi; i am having trouble trying to sort the rows of a 2 dimensional array by the values in the first column .. does anybody know how or have an example of how to do this ??? while leaving the remain columns remain relative to the leading column from numpy import * a=array( [ [4, 4, 3], [4, 5,

how to sort two dimensional array ??

2010-01-19 Thread robert somerville
Hi; i am having trouble trying to sort the rows of a 2 dimensional array by the values in the first column .. does anybody know how or have an example of how to do this ??? while leaving the remain columns remain relative to the leading column from numpy import * a=array( [ [4, 4, 3], [4, 5, 2],

how to sort two dimensional array

2010-01-19 Thread robert somerville
Hi; i am having trouble trying to sort the rows of a 2 dimensional array by the values in the first column .. does anybody know how or have an example of how to do this ??? while leaving the remain columns remain relative to the leading column from numpy import * a=array( [ [4, 4, 3], [4, 5, 2],

24 bit signed integer binary conversion help needed

2010-01-08 Thread Robert Somerville
thanks Grant, your sext24 function does the trick (this Python newbie thanks you a lot ...) so i loop on d=wave.readframes(1) call dd=sext24(d) on the frame read , then ddd=struct.unpack("<%ul" % 1 ,dd) unpack(dd) the output of sext24 into a 32bit integer (seems to do the trick correctly f

24 bit signed integer binary conversion help needed

2010-01-08 Thread Robert Somerville
) > On 2010-01-08, Robert Somerville <rsomerville at sjgeophysics.com> wrote: > >> I am trying to read 24bit signed WAV format (little endian) data from a >> WAV file and convert it to 32 bit little endian integer format ... can >> anybody please tell me how to do

24 bit signed integer binary conversion help needed

2010-01-08 Thread Robert Somerville
hi; I am trying to read 24bit signed WAV format (little endian) data from a WAV file and convert it to 32 bit little endian integer format ... can anybody please tell me how to do the conversion from 24 bit to 32 bit with a snippet of Python code ??? Thanks so much Robert Somerville -- http