From: Nadav H. <na...@vi...> - 2006-10-21 19:05:34
|
1. If at least one of your data sets to be interpulated is on a grid, = you can use numpy.ndimage.map function for fast interpolation for 2d (in = fact for any dimensional) dataset. 2. Isn't there an analytic expression to average the expectration values = of SH over all possible orientations between B and the crystal axis? My = experience shows that some analytic work can save 99% of simulation = time. Nadav -----Original Message----- From: num...@li... on behalf of = Sebastian Zurek Sent: Sat 21-Oct-06 15:41 To: num...@li... Cc:=09 Subject: Re: [Numpy-discussion] Model and experiment fitting. Robert Kern napisal(a): > Your description is a bit vague.=20 Possibly by my weak English... I'll try to make myself clearer now. Do you mean that you have some model function f > that maps X values to Y values? >=20 > f(x) -> y >=20 My model is quantum energy operator - spin hamiltonian (SH) with some additional assumption about so called 'line shape', 'line widths',etc. It describes various electron interactions, visible in electron=20 paramagnetic resonance (EPR, ESR) experiment. The simplest SH can be written in a form: H =3D m B g S (1) where m is a constant (bohr magneton), B is magnetic field (my=20 x-variable), g is so called 'zeeman matrix' and S is total spin angular momentum operator. Summing it all together: the simple model is parametrized by: - line shape, - line width, - zeeman matrix (3x3 diagonal matrix - the spatial dependence), - total spin S. After SH (1) diagonalization one can obtain so called 'resonance fields' = and 'resonance intensities'. After a convolution with appropriate line = shape function which is parametrized by the line width one can finally get the simulated EPR spectrum (simDat=3D[[X1,...,Xn],[Y1,...,Yn]]). This is a roughly, schematic description, appropriate to EPR spectra of monocrystals. In my situation the problem is more sophisticated - I have=20 polycrystaline (powders) data, and to obtain a simulated EPR powder=20 spectrum I need to sum up the EPR spectra of monocrystals that come from = many possible spatial orientations, and the resultant spectrum is an=20 envelope of all the monocrystals spectra. There's no simple model function that maps X -> Y. > If that is the case, is there some reason that you cannot run your = simulation=20 > using the same X points as your experimental data? >=20 I can only demand a X range and number of X values within the range,=20 there's no possibility to find the Y(X) for a specified X. These=20 limitations on one hand come from the external program I'm using to=20 simulate the EPR spectra, on the other are a result of spatial averaging = of EPR data for powders, where a lot of interpolations are involved. > OTOH, is there some other independent variable (say Z) that *is* = common between=20 > your experimental and simulated data? >=20 > f(z) -> (x, y) >=20 This is probably the situation I'm in. These other variables are my=20 model parameters, namely: line shape-width, zeeman matrix... and they're commen between the experiment and the simulation. To make it clear. I've already solved the problem by a simple linear interpolation of=20 simulated points within the narrow neighborhood of experimental data=20 point. The simulation points are uniformly distributed along the=20 X-range, with a density I'm able to tune. It all works quite well but=20 I'm founding it as a 'brute-force' method and I wonder, if there's any=20 more sophisticated and maybe already incorporated into any Python module = method? Anyway, it looks like it's impossible to compare two discrete 2D data=20 sets without any interpolations included... :] A. M. Archibald has proposed spline fitting, which I'll try. I'll also=20 look at the Numerical Recipes discussion he has proposed. Sebastian -------------------------------------------------------------------------= Using Tomcat but need to do more? Need to support web services, = security? Get stuff done quickly with pre-integrated technology to make your job = easier Download IBM WebSphere Application Server v.1.0.1 based on Apache = Geronimo http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 121642 _______________________________________________ Numpy-discussion mailing list Num...@li... https://lists.sourceforge.net/lists/listinfo/numpy-discussion |
From: <se...@pi...> - 2006-10-22 10:39:48
|
Nadav Horesh napisał(a): > 1. If at least one of your data sets to be interpulated is on a grid, > you can use numpy.ndimage.map function for fast interpolation for 2d (in fact for any dimensional) dataset. I've already used a splines to interpolate a missing simulated points. That procedure works great and is very fast. But I'll check the numpy.ndimage - I haven't used it, yet. > 2. Isn't there an analytic expression to average the expectration values of SH over all possible orientations > between B and the crystal axis? My experience shows that some analytic work can save 99% of simulation time. Well, the simulations are already very fast. The time consumption is approximately ~0.3s for a single powder spectrum (2.8GHz Pentium D). The calculations are held by an external, very fine EPR spectra simulation tool. The author must have incorporated into it a lot of rationalizations, but this is a binary tool (unfortunately) and I do not know, what exactly sits inside of it... All I know, is that the orientations are represented by a grid (with an increment step tunable by a user). From library documentation: "After having computed the spectrum for a number of orientations specified, the simulation function interpolates these spectra for additional orientations before summing up all spectra." The interpolation is accomplish with a splines. Thank you for your comment, best regards Sebastian |