Subject: Re: python and contour levels
From: Eagle
Date: Mar 4, 2009

Previous: 569

Of course this was something simple and of course I figured it out moments after posting. Contour_Levels() constructor initializes the lowest attribute to *positive* 1e4. I guess to avoid trouble negative_levels and positive_levels are really defined by the sign of lowest. So I just had to set lowest to something negative and everything was cool.


--- In nmr_sparky@yahoogroups.com , Eagle kvander11@... wrote:

Hi, Im trying to get comfortable with writing up short python
extensions. Right now Ive just been working on setting up a uniform
view for several spectra, but Im running into a weird problem.
Heres my snippet of code-

####
myview=session_list[0].project.view_list()[0]
a=Contour_Levels() #this will be used for positive contours
a.levels=20
a.color=red-blue
b=Contour_Levels() #this will be used for negative contours
b.color=beige
myview.positive_levels=a #assignment 1
myview.negative_levels=b #assignment 2
####

assignment 1 works, but the problem is assignment 2 also sets
positive_levels=b (ie, both positive_levels and negative_levels seem
to refer to the positive contour). Is this a bug or am I doing
something wrong? Thanks,

Kirk