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 c09ace41 was
82a54b8,
checked in by Mathieu Doucet <doucetm@…>, 13 years ago
|
adding plottools Part 2
|
-
Property mode set to
100644
|
File size:
990 bytes
|
Line | |
---|
1 | import math |
---|
2 | |
---|
3 | # log(x) |
---|
4 | def from_log10(x, y=0): |
---|
5 | return math.pow(10.0, x) |
---|
6 | def err_log10(x, y, dx, dy): |
---|
7 | return math.pow(10.0, x)*dx |
---|
8 | |
---|
9 | # ln(x) |
---|
10 | def from_lnx(x, y=0): |
---|
11 | return math.exp(x) |
---|
12 | def err_lnx(x, y, dx, dy): |
---|
13 | return math.exp(x)*dx |
---|
14 | |
---|
15 | # x^2 |
---|
16 | def from_x2(x, y=0): |
---|
17 | return math.sqrt(x) |
---|
18 | def err_x2(x, y, dx, dy): |
---|
19 | return 0.5*dx/math.sqrt(x) |
---|
20 | |
---|
21 | # 1/x |
---|
22 | def from_inv_x(x, y=0): |
---|
23 | return 1.0/x |
---|
24 | def err_inv_x(x, y, dx, dy): |
---|
25 | return 1.0/(x**2)*dx |
---|
26 | |
---|
27 | # 1/sqrt(y) |
---|
28 | def from_inv_sqrtx(x, y=0): |
---|
29 | return 1.0/x**2 |
---|
30 | def err_inv_sqrtx(x, y, dx, dy): |
---|
31 | return 2.0*math.pow(x,-3.0)*dx |
---|
32 | |
---|
33 | # ln(xy) |
---|
34 | def from_lnxy(x, y): |
---|
35 | return math.exp(x)/y |
---|
36 | def err_lnxy(x, y, dx, dy): |
---|
37 | return math.exp(x)/y*dx |
---|
38 | |
---|
39 | # ln(xy2) |
---|
40 | def from_lnx2y(x, y): |
---|
41 | return math.exp(x)/y**2 |
---|
42 | def err_lnx2y(x, y, dx, dy): |
---|
43 | return math.exp(x)/y**2*dx |
---|
44 | |
---|
45 | # ln(xy4) |
---|
46 | def from_lnx4y(x, y): |
---|
47 | return math.exp(x)/y**4 |
---|
48 | def 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.