Commit ff3367c8 authored by Bjoern Wehinger's avatar Bjoern Wehinger

- New version compatible with Linux, Mac and Windows

- compatible with recent version of PyMca
parent 022a5b0a
......@@ -26,16 +26,21 @@
#
import sys, traceback, string, os, time, h5py
import sys, traceback, string, os, time, platform
import h5py
import numpy as np
from types import *
from matplotlib import pyplot as plt
from PyMca import Gefit
try:
from PyMca import Gefit
except ImportError:
try:
from PyMca5 import Gefit
except ImportError:
raise
from numpy import array
#--------------------------------------------------------------------------------------------------------
# Basic function Model
#--------------------------------------------------------------------------------------------------------
......@@ -501,9 +506,15 @@ def interactive_define_ext_constrains(params_and_functions,constrains):
s=s+("constrains[0][%d]= %d \n"%(k,int(constrains[0][k]) ))
s=s+("param_list[%d],constrains[1][%d],constrains[2][%d] = %10.4f,%.4f,%.4f \n"% (k,k,k,param_list[k], constrains[1][k],constrains[2][k] ))
filename="/tmp/inpufitter"
open(filename,"w").write(s)
os.system("emacs %s >/dev/null < /dev/null " % (filename),)
if platform.system() == 'Windows':
filename="temp"
open(filename,"w").write(s)
os.system("emacs %s >NUL < NUL " % (filename),)
else :
filename="/tmp/inputfitter"
open(filename,"w").write(s)
os.system("emacs %s >/dev/null < /dev/null " % (filename),)
s= open(filename,"r").read()
exec(s)
return constrains
......
......@@ -25,15 +25,19 @@
# Reintroduire l' option de simplex downhill.-> a faire
#
import sys, traceback, string, os, time, h5py
import sys, traceback, string, os, time, platform
import h5py
import numpy as np
from types import *
from matplotlib import pyplot as plt
from PyMca import Gefit
try:
from PyMca import Gefit
except ImportError:
try:
from PyMca5 import Gefit
except ImportError:
raise
from numpy import array
import h5py
#--------------------------------------------------------------------------------------------------------
......@@ -526,9 +530,15 @@ def interactive_define_ext_constrains(params_and_functions,constrains):
s=s+("constrains[0][%d]= %d \n"%(k,int(constrains[0][k]) ))
s=s+("param_list[%d],constrains[1][%d],constrains[2][%d] = %10.4f,%.4f,%.4f \n"% (k,k,k,param_list[k], constrains[1][k],constrains[2][k] ))
filename="/tmp/inpufitter"
open(filename,"w").write(s)
os.system("emacs %s >/dev/null < /dev/null " % (filename),)
if platform.system() == 'Windows':
filename="temp"
open(filename,"w").write(s)
os.system("emacs %s >NUL < NUL " % (filename),)
else :
filename="/tmp/inputfitter"
open(filename,"w").write(s)
os.system("emacs %s >/dev/null < /dev/null " % (filename),)
s= open(filename,"r").read()
exec(s)
return constrains
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment