source: sasview/src/examples/data_generator/test_transfo.py @ 8c9ffde

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 8c9ffde was 5777106, checked in by Mathieu Doucet <doucetm@…>, 11 years ago

Moving things around. Will definitely not build.

  • Property mode set to 100644
File size: 990 bytes
Line 
1import math
2
3# log(x)
4def from_log10(x, y=0):
5    return math.pow(10.0, x)
6def err_log10(x, y, dx, dy):
7    return math.pow(10.0, x)*dx
8
9# ln(x)
10def from_lnx(x, y=0):
11    return math.exp(x)
12def err_lnx(x, y, dx, dy):
13    return math.exp(x)*dx
14
15# x^2
16def from_x2(x, y=0):
17    return math.sqrt(x)
18def err_x2(x, y, dx, dy):
19    return 0.5*dx/math.sqrt(x)
20
21# 1/x
22def from_inv_x(x, y=0):
23    return 1.0/x
24def err_inv_x(x, y, dx, dy):
25    return 1.0/(x**2)*dx
26
27# 1/sqrt(y)
28def from_inv_sqrtx(x, y=0):
29    return 1.0/x**2
30def err_inv_sqrtx(x, y, dx, dy):
31    return 2.0*math.pow(x,-3.0)*dx
32
33# ln(xy)
34def from_lnxy(x, y):
35    return math.exp(x)/y
36def err_lnxy(x, y, dx, dy):
37    return math.exp(x)/y*dx
38
39# ln(xy2)
40def from_lnx2y(x, y):
41    return math.exp(x)/y**2
42def err_lnx2y(x, y, dx, dy):
43    return math.exp(x)/y**2*dx
44
45# ln(xy4)
46def from_lnx4y(x, y):
47    return math.exp(x)/y**4
48def err_lnx4y(x, y, dx, dy):
49    return math.exp(x)/y**4*dx
50
Note: See TracBrowser for help on using the repository browser.