Software for Stationary Scales

Software to make nomographs or nomograms
pheon
Posts: 3
Joined: Fri Mar 14, 2008 9:05 pm

Software for Stationary Scales

Postby pheon » Thu Mar 27, 2008 11:17 pm

Does anyone know of software for producing stationary scales, i.e. nomographs of functions of just two variables?
RonDoerfler
Posts: 27
Joined: Mon Feb 04, 2008 9:43 pm
Location: USA
Contact:

Re: Software for Stationary Scales

Postby RonDoerfler » Mon Mar 31, 2008 3:32 am

Just so you know that your post isn't being ignored, I did try to find something available online that would work but I wasn't able to find anything. You're talking about a simple scale like that shown in the upper corner of this blog, right? I tried to make PyNomo plot one by doing the "general" type of nomogram and having two of the scales reside at x=0, but Leif is too smart for me and the code complains about a "singular matrix." I tried doing the same thing to an interactive online software tool at http://www.ece.rochester.edu/~jones/NomoDevel/index.htm but I couldn't fake that out, either. You would think that there would be some software somewhere that could create such a scale.

Ron
Leif
Posts: 55
Joined: Mon Dec 31, 2007 3:03 pm
Location: Finland
Contact:

Re: Software for Stationary Scales

Postby Leif » Mon Mar 31, 2008 5:07 pm

Dear pheon (and Rob)

I try to make simple code example to build a double scale by using pynomo...

\leif
Leif
Posts: 55
Joined: Mon Dec 31, 2007 3:03 pm
Location: Finland
Contact:

Re: Software for Stationary Scales

Postby Leif » Mon Mar 31, 2008 7:40 pm

Here is code to produce Fahrenheit-Celcius conversion by using PyNomo 0.1.0b1. See http://pynomo.org. The language is python.
I have corrected bugs and changed syntax in the class Nomo_Axis in the future version of PyNomo. It will take still my
limited time to have it out.

Code: Select all

from nomo_axis import *

F_start=-40.0
F_stop=90.0
C_start=-40.0
C_stop=30.0

def celcius(fahrenheit):
    return (fahrenheit-32.0)/1.8

c = canvas.canvas()
# define Fahrenheit scale
Nomo_Axis(func_f=lambda x:0,func_g=lambda y:celcius(y)*0.2,start=F_start,stop=F_stop,
              turn=-1,title=r'$^\circ$ F',canvas=c,title_x_shift=-1.0)
# define Celsius scale
Nomo_Axis(func_f=lambda x:0,func_g=lambda y:y*0.2,start=C_start,stop=C_stop,
              turn=1,title=r'$^\circ$ C',canvas=c,title_x_shift=0.5)
# write pdf-file
c.writePDFfile("double_test.pdf")


So no warranty... hope it works.

\leif
pheon
Posts: 3
Joined: Fri Mar 14, 2008 9:05 pm

Re: Software for Stationary Scales

Postby pheon » Wed Apr 02, 2008 10:41 pm

I tried the code but got this error

$ /opt/local/bin/python2.4 test.py Traceback (most recent call last):
File "test.py", line 1, in ?
from nomo_axis import *
ImportError: No module named nomo_axis

I assume I haven't installed something correctly. I followed the pynomo instructions and can run the examples OK.
Leif
Posts: 55
Joined: Mon Dec 31, 2007 3:03 pm
Location: Finland
Contact:

Re: Software for Stationary Scales

Postby Leif » Thu Apr 03, 2008 6:54 am

pheon wrote:$ /opt/local/bin/python2.4 test.py Traceback (most recent call last):
File "test.py", line 1, in ?
from nomo_axis import *
ImportError: No module named nomo_axis


If you installed PyNomo using command (or using windows .exe)

Code: Select all

python setup.py install

you should have pynomo in your path and this command should find.

Python tries to load file nomo_axis.py with the command

Code: Select all

from nomo_axis import *

and cannot for some reason find it.

\leif
RonDoerfler
Posts: 27
Joined: Mon Feb 04, 2008 9:43 pm
Location: USA
Contact:

Re: Software for Stationary Scales

Postby RonDoerfler » Fri Apr 04, 2008 3:28 am

I had the same problem as pheon, but after I re-installed Pynomo (via the Windows executable) everything worked fine. It looks great--thanks, Leif!

Ron
Leif
Posts: 55
Joined: Mon Dec 31, 2007 3:03 pm
Location: Finland
Contact:

Re: Software for Stationary Scales

Postby Leif » Sat Apr 05, 2008 9:52 am

Sorry for inconvience, but there was a mistake in the code above in package loading definitions.
The code above works only if it resides in same directory as nomo_axis.py. Below is corrected code that
works.

Code: Select all

from pynomo.nomo_axis import *
from pyx import *

F_start=-40.0
F_stop=90.0
C_start=-40.0
C_stop=30.0

def celcius(fahrenheit):
    return (fahrenheit-32.0)/1.8

c = canvas.canvas()
# define Fahrenheit scale
Nomo_Axis(func_f=lambda x:0,func_g=lambda y:celcius(y)*0.2,start=F_start,stop=F_stop,
              turn=-1,title=r'$^\circ$ F',canvas=c,title_x_shift=-1.0)
# define Celsius scale
Nomo_Axis(func_f=lambda x:0,func_g=lambda y:y*0.2,start=C_start,stop=C_stop,
              turn=1,title=r'$^\circ$ C',canvas=c,title_x_shift=0.5)
# write pdf-file
c.writePDFfile("double_test.pdf")


One day there will be PyNomo documentation and more examples... I should integrate grid elements to build overall nomograms with 3+ variables. With this done, I think there is enough features for next distribution.

\leif
RonDoerfler
Posts: 27
Joined: Mon Feb 04, 2008 9:43 pm
Location: USA
Contact:

Re: Software for Stationary Scales

Postby RonDoerfler » Sat Apr 05, 2008 4:46 pm

I had downloaded nomo_axis.py separately and put it in the same directory when I was trying different things to get it to work, so that's probably why it worked for me.

Thanks, Leif.

Ron
pheon
Posts: 3
Joined: Fri Mar 14, 2008 9:05 pm

Re: Software for Stationary Scales

Postby pheon » Mon Apr 07, 2008 3:00 pm

After reading about Python a bit, I got it to work by changing the first line to

from pynomo.nomo_axis import *

Return to “Software”

Who is online

Users browsing this forum: No registered users and 1 guest