Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion RATapi/examples/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from RATapi.examples.absorption.absorption import absorption
from RATapi.examples.convert_rascal_project import convert_rascal
from RATapi.examples.convert_rascal_project.convert_rascal import convert_rascal
from RATapi.examples.domains.domains_custom_layers import domains_custom_layers
from RATapi.examples.domains.domains_custom_XY import domains_custom_XY
from RATapi.examples.domains.domains_standard_layers import domains_standard_layers
from RATapi.examples.non_polarised.DSPC_custom_layers import DSPC_custom_layers
from RATapi.examples.non_polarised.DSPC_custom_XY import DSPC_custom_XY
from RATapi.examples.non_polarised.DSPC_data_background import DSPC_data_background
from RATapi.examples.non_polarised.DSPC_function_background import DSPC_function_background
from RATapi.examples.non_polarised.DSPC_standard_layers import DSPC_standard_layers

__all__ = [
Expand All @@ -15,5 +17,7 @@
"DSPC_custom_layers",
"DSPC_custom_XY",
"DSPC_standard_layers",
"DSPC_data_background",
"DSPC_function_background",
"convert_rascal",
]
8 changes: 4 additions & 4 deletions RATapi/examples/absorption/absorption.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@
"problem.background_parameters.append(name=\"Background parameter 3\", min=1.0e-06, value=9.01e-06, max=9.0e-05, fit=True)\n",
"problem.background_parameters.append(name=\"Background parameter 4\", min=1.0e-06, value=5.61e-06, max=9.0e-05, fit=True)\n",
"\n",
"problem.backgrounds.append(name=\"Background 1\", type=\"constant\", value_1=\"Background parameter 1\")\n",
"problem.backgrounds.append(name=\"Background 2\", type=\"constant\", value_1=\"Background parameter 2\")\n",
"problem.backgrounds.append(name=\"Background 3\", type=\"constant\", value_1=\"Background parameter 3\")\n",
"problem.backgrounds.append(name=\"Background 4\", type=\"constant\", value_1=\"Background parameter 4\")\n",
"problem.backgrounds.append(name=\"Background 1\", type=\"constant\", source=\"Background parameter 1\")\n",
"problem.backgrounds.append(name=\"Background 2\", type=\"constant\", source=\"Background parameter 2\")\n",
"problem.backgrounds.append(name=\"Background 3\", type=\"constant\", source=\"Background parameter 3\")\n",
"problem.backgrounds.append(name=\"Background 4\", type=\"constant\", source=\"Background parameter 4\")\n",
"\n",
"# Make the resolution fittable\n",
"problem.resolution_parameters.set_fields(0, fit=True)\n"
Expand Down
8 changes: 4 additions & 4 deletions RATapi/examples/absorption/absorption.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ def absorption():
name="Background parameter 4", min=1.0e-06, value=5.61e-06, max=9.0e-05, fit=True
)

problem.backgrounds.append(name="Background 1", type="constant", value_1="Background parameter 1")
problem.backgrounds.append(name="Background 2", type="constant", value_1="Background parameter 2")
problem.backgrounds.append(name="Background 3", type="constant", value_1="Background parameter 3")
problem.backgrounds.append(name="Background 4", type="constant", value_1="Background parameter 4")
problem.backgrounds.append(name="Background 1", type="constant", source="Background parameter 1")
problem.backgrounds.append(name="Background 2", type="constant", source="Background parameter 2")
problem.backgrounds.append(name="Background 3", type="constant", source="Background parameter 3")
problem.backgrounds.append(name="Background 4", type="constant", source="Background parameter 4")

# Make the resolution fittable
problem.resolution_parameters.set_fields(0, fit=True)
Expand Down
82 changes: 82 additions & 0 deletions RATapi/examples/data/d2o_background_data.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
0.011403 1.90034798968076e-06 -9.65035874608547e-07
0.011973 1.81361996101478e-06 -4.67852140773275e-09
0.012572 1.5763144199176e-06 -1.36151693657437e-06
0.013201 2.66861902156408e-06 5.28737972088124e-07
0.013861 1.19184137102607e-06 6.5429177234931e-07
0.014554 1.75409120253422e-06 -4.50039804064594e-07
0.015281 1.51534921649628e-06 3.54060605152339e-07
0.016045 1.76294603973655e-06 2.30273872099416e-07
0.016848 1.66691808740296e-06 1.02729272466451e-06
0.01769 2.2391873415575e-06 2.02710446930881e-07
0.018575 1.47947093349392e-06 9.31566506641381e-07
0.019503 1.58967045467121e-06 6.58308695637623e-09
0.020479 2.05056480300655e-06 -4.18637528083399e-07
0.021502 2.54199126843229e-06 6.96150360898885e-08
0.022578 1.07273638130851e-06 -5.94598550176916e-08
0.023706 2.89987639289405e-06 8.05335897612554e-07
0.024892 1.56081284721073e-06 5.50847432744533e-08
0.026136 2.32386636321661e-06 -5.72991095509919e-07
0.027443 2.52478251612625e-06 -2.38750704688337e-08
0.028815 2.66154668842285e-06 1.05087573637142e-06
0.030256 1.74132051718101e-06 -2.3192582338868e-07
0.031769 2.01215747485553e-06 -4.26893410009117e-07
0.033357 1.91881656322323e-06 8.87192534478923e-07
0.035025 1.69716945696631e-06 1.80981995646851e-07
0.036777 2.13585488200451e-06 -1.90164659296111e-07
0.038615 2.17932170608953e-06 -4.91062265460096e-07
0.040546 1.82384243860966e-06 -1.08387392818395e-06
0.042573 2.06617996409986e-06 2.22697399577916e-07
0.044702 3.33679088859971e-06 -1.53613977488785e-07
0.046937 1.99621696227773e-06 3.55134601922439e-07
0.049284 2.3551514683307e-06 -1.06523727035749e-06
0.051748 1.76873031859355e-06 1.15746760150783e-06
0.054336 1.73606104969994e-06 4.89763150040874e-07
0.057052 1.82710646654775e-06 -1.15330099931726e-06
0.059905 2.28227888686718e-06 9.45647703159621e-07
0.0629 1.59923042799896e-06 -3.70062237263438e-07
0.066045 1.07352660741589e-06 3.41777294345909e-07
0.069348 2.02660800872659e-06 2.75569910736786e-07
0.072815 1.78179239147256e-06 -6.0256088120987e-07
0.076456 2.14000373613308e-06 -2.18911980741668e-06
0.080279 2.04230294359047e-06 5.284442372682e-07
0.084292 2.36455952978407e-06 -1.73629847921614e-07
0.088507 2.45037654782291e-06 -3.78287083788833e-07
0.092932 1.33718085273407e-06 4.35130166728242e-07
0.097579 1.23771058575749e-06 -4.51744576618967e-07
0.10246 2.25121666653143e-06 6.36952833032752e-07
0.10758 2.15319571282475e-06 2.20717968415214e-07
0.11296 1.53041976734067e-06 -6.93055107868105e-07
0.11861 2.61870106321507e-06 7.69463958198665e-07
0.12454 2.01650595727752e-06 4.79607176188218e-07
0.13077 2.06178415911062e-06 1.10173268381594e-06
0.1373 2.13696968977538e-06 -6.14098124528528e-07
0.14417 2.3770829041412e-06 -6.16219383494697e-07
0.15138 2.7622487528669e-06 3.50660742020884e-07
0.15895 1.86901211887215e-06 6.33626529015099e-07
0.16689 1.13465824611353e-06 7.62493241842828e-07
0.17524 2.50673214999504e-06 1.05207422581854e-07
0.184 1.53613195077685e-06 -8.87137577093779e-08
0.1932 2.62184014311179e-06 6.22256875962273e-07
0.20286 1.70525565120706e-06 1.67162600924891e-06
0.213 2.74574086739327e-06 8.07667338780613e-07
0.22365 1.59701095264287e-06 1.67629565660922e-07
0.23484 1.4437004736234e-06 -3.59611249006791e-07
0.24658 2.47846978404969e-06 4.99800504594724e-07
0.25891 1.31847420553136e-06 -2.87283586089481e-07
0.27185 2.34029248136207e-06 2.90756508518823e-07
0.28544 2.21891181128286e-06 7.22598553179947e-07
0.29972 1.92836622666398e-06 8.39418345516717e-07
0.3147 1.82923374769972e-06 5.70510331434857e-07
0.33044 3.02890531703209e-06 1.20234742176368e-06
0.34696 1.8127324822871e-06 1.58096394623758e-06
0.36431 1.90489840127358e-06 -1.41813181395574e-06
0.38252 1.53063379469415e-06 -1.32294734328625e-06
0.40165 1.59326881780842e-06 -6.38112989285387e-07
0.42173 1.7081906242357e-06 -1.49834166690205e-06
0.44282 2.85476268526193e-06 -1.85680046178151e-07
0.46496 1.80479009111448e-06 -1.69120607911057e-07
0.48821 1.6549673183601e-06 3.00340803829798e-07
0.51262 1.77588964903545e-06 3.28929520936145e-07
0.53825 2.35718817504981e-06 -4.48934854489947e-07
0.56516 1.34213437585845e-06 -5.50651590195596e-07
0.59342 2.31356104763158e-06 7.347220470815e-07
6 changes: 3 additions & 3 deletions RATapi/examples/languages/setup_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ def make_example_problem():
)

# And add the two new constant backgrounds
problem.backgrounds.append(name="Background SMW", type="constant", value_1="Background parameter SMW")
problem.backgrounds.append(name="Background H2O", type="constant", value_1="Background parameter H2O")
problem.backgrounds.append(name="Background SMW", type="constant", source="Background parameter SMW")
problem.backgrounds.append(name="Background H2O", type="constant", source="Background parameter H2O")

# And edit the other one
problem.backgrounds.set_fields(0, name="Background D2O", value_1="Background parameter D2O")
problem.backgrounds.set_fields(0, name="Background D2O", source="Background parameter D2O")

# Finally modify some of the other parameters to be more suitable values for a solid / liquid experiment
problem.scalefactors.set_fields(0, value=1.0, min=0.5, max=2.0, fit=True)
Expand Down
6 changes: 3 additions & 3 deletions RATapi/examples/non_polarised/DSPC_custom_XY.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ def DSPC_custom_XY():
problem.background_parameters.append(name="Background parameter H2O", min=0.0, value=1.0e-7, max=1.0e-5, fit=True)

# And add the two new constant backgrounds
problem.backgrounds.append(name="Background SMW", type="constant", value_1="Background parameter SMW")
problem.backgrounds.append(name="Background H2O", type="constant", value_1="Background parameter H2O")
problem.backgrounds.append(name="Background SMW", type="constant", source="Background parameter SMW")
problem.backgrounds.append(name="Background H2O", type="constant", source="Background parameter H2O")

# And edit the other one
problem.backgrounds.set_fields(0, name="Background D2O", value_1="Background parameter D2O")
problem.backgrounds.set_fields(0, name="Background D2O", source="Background parameter D2O")

# Finally modify some of the other parameters to be more suitable values for a solid / liquid experiment
problem.scalefactors.set_fields(0, value=1.0, min=0.5, max=2.0, fit=True)
Expand Down
6 changes: 3 additions & 3 deletions RATapi/examples/non_polarised/DSPC_custom_layers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,11 @@
"problem.background_parameters.append(name=\"Background parameter H2O\", min=1.0e-10, value=1.0e-7, max=1.0e-5, fit=True)\n",
"\n",
"# And add the two new constant backgrounds\n",
"problem.backgrounds.append(name=\"Background SMW\", type=\"constant\", value_1=\"Background parameter SMW\")\n",
"problem.backgrounds.append(name=\"Background H2O\", type=\"constant\", value_1=\"Background parameter H2O\")\n",
"problem.backgrounds.append(name=\"Background SMW\", type=\"constant\", source=\"Background parameter SMW\")\n",
"problem.backgrounds.append(name=\"Background H2O\", type=\"constant\", source=\"Background parameter H2O\")\n",
"\n",
"# And edit the other one\n",
"problem.backgrounds.set_fields(0, name=\"Background D2O\", value_1=\"Background parameter D2O\")\n",
"problem.backgrounds.set_fields(0, name=\"Background D2O\", source=\"Background parameter D2O\")\n",
"\n",
"# Finally modify some of the other parameters to be more suitable values for a solid / liquid experiment\n",
"problem.scalefactors.set_fields(0, value=1.0, min=0.5, max=2.0, fit=True)"
Expand Down
6 changes: 3 additions & 3 deletions RATapi/examples/non_polarised/DSPC_custom_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ def DSPC_custom_layers():
)

# And add the two new constant backgrounds
problem.backgrounds.append(name="Background SMW", type="constant", value_1="Background parameter SMW")
problem.backgrounds.append(name="Background H2O", type="constant", value_1="Background parameter H2O")
problem.backgrounds.append(name="Background SMW", type="constant", source="Background parameter SMW")
problem.backgrounds.append(name="Background H2O", type="constant", source="Background parameter H2O")

# And edit the other one
problem.backgrounds.set_fields(0, name="Background D2O", value_1="Background parameter D2O")
problem.backgrounds.set_fields(0, name="Background D2O", source="Background parameter D2O")

# Finally modify some of the other parameters to be more suitable values for a solid / liquid experiment
problem.scalefactors.set_fields(0, value=1.0, min=0.5, max=2.0, fit=True)
Expand Down
6 changes: 3 additions & 3 deletions RATapi/examples/non_polarised/DSPC_custom_xy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@
"problem.background_parameters.append(name=\"Background parameter H2O\", min=0.0, value=1.0e-7, max=1.0e-5, fit=True)\n",
"\n",
"# And add the two new constant backgrounds\n",
"problem.backgrounds.append(name=\"Background SMW\", type=\"constant\", value_1=\"Background parameter SMW\")\n",
"problem.backgrounds.append(name=\"Background H2O\", type=\"constant\", value_1=\"Background parameter H2O\")\n",
"problem.backgrounds.append(name=\"Background SMW\", type=\"constant\", source=\"Background parameter SMW\")\n",
"problem.backgrounds.append(name=\"Background H2O\", type=\"constant\", source=\"Background parameter H2O\")\n",
"\n",
"# And edit the other one\n",
"problem.backgrounds.set_fields(0, name=\"Background D2O\", value_1=\"Background parameter D2O\")\n",
"problem.backgrounds.set_fields(0, name=\"Background D2O\", source=\"Background parameter D2O\")\n",
"\n",
"# Finally modify some of the other parameters to be more suitable values for a solid / liquid experiment\n",
"problem.scalefactors.set_fields(0, value=1.0, min=0.5, max=2.0, fit=True)\n",
Expand Down
Loading
Loading