Skip to content

Commit

Permalink
Revision and some bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SelinaItzigehl committed Dec 30, 2022
1 parent 0f3a010 commit 8159d52
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 333 deletions.
22 changes: 11 additions & 11 deletions SAS-workflows/Giess_2022/M1_AnIML.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"from lxml import etree\n",
"from pyaniml import AnIMLDocument, Sample, Series, ExperimentStep, Device, IndividualValueSet, SeriesSet, Category, Parameter, Unit, SIUnit\n",
"from pyaniml.core.method import Author, Software\n",
"from sastools.readers import PDHReader\n",
"from sastools.readers import PDHReader, infer_type\n",
"print (\"Done.\")"
]
},
Expand Down Expand Up @@ -136,7 +136,7 @@
"source": [
"#### **Conversion of PDH to AnIML** <a class=\"anchor\" name=\"conversion\"></a>\n",
"\n",
"With this section of the notebook, a new AnIML document can be created in memory and later be serialized to XML. The presented code cells provide the most important API calles for building an AnIML document with pyAnIML. \n",
"With this section of the notebook, a new AnIML document can be created in memory and later be serialized to XML. The presented code cells provide the most important API calls for building an AnIML document with pyAnIML. \n",
"Running a code cell more than once will add the contents of this cell to the AnIML document accordingly more than once. This can be used to add multiple samples, experiments, series, ... to the same document by simple changing the respective code cell before serializing it."
]
},
Expand Down Expand Up @@ -202,7 +202,7 @@
"metadata": {},
"outputs": [],
"source": [
"pdh_dir = PDHReader(path_to_datasets / \"raw/OTAC_measurement_data/OTAC_097wtp_T\")\n",
"pdh_dir = PDHReader(path_to_datasets / \"raw/OTAC_measurement_data/OTAC_065wtp_T\")\n",
"dict_of_files = pdh_dir.enumerate_available_files()\n",
"for index, file in dict_of_files.items():\n",
" print(f\"{index}: {file}\")"
Expand All @@ -223,7 +223,7 @@
"metadata": {},
"outputs": [],
"source": [
"pdh_file = dict_of_files[65]\n",
"pdh_file = dict_of_files[0]\n",
"raw_dataframe = pdh_dir.extract_data(pdh_file)\n",
"raw_metadata = pdh_dir.extract_metadata(pdh_file)\n",
"print(raw_dataframe)"
Expand Down Expand Up @@ -358,7 +358,7 @@
"id": "3b271c79-6191-4701-95a5-8dbe1276a5a1",
"metadata": {},
"source": [
"7. If applicable, create the device with its various settings and/or software on which the sample(s) were measured/analysed and add them to the experiment step object:"
"7. If applicable, create the device with its various settings and/or software on which the sample(s) were measured/analyzed and add them to the experiment step object:"
]
},
{
Expand Down Expand Up @@ -484,7 +484,7 @@
"id": "cccc81e3-826f-4bfa-b507-f2459d8e1017",
"metadata": {},
"source": [
"8. Create a series for every dimension of data present in the dataframe. The data from the dataframe goes into an IndividualValueSet in form of a list, which is then added to the actual series object, together with unit information (from PDH metadata) a name, ID, the data type, the dependency, and plot scale:"
"8. Create a series for every dimension of data present in the dataframe. The data from the dataframe goes into an IndividualValueSet in form of a list, which is then added to the actual series object, together with unit information (from PDH metadata) a name, ID, data type, dependency, and plot scale:"
]
},
{
Expand Down Expand Up @@ -770,7 +770,7 @@
"metadata": {},
"outputs": [],
"source": [
"path_to_AnIML_file = path_to_datasets / f\"processed/fairsaxs_220502.animl\""
"path_to_AnIML_file = path_to_datasets / f\"processed/fairsaxs_220512.animl\""
]
},
{
Expand Down Expand Up @@ -879,7 +879,7 @@
"metadata": {},
"outputs": [],
"source": [
"path_to_AnIML_file = path_to_datasets / f\"processed/fairsaxs_220502.animl\""
"path_to_AnIML_file = path_to_datasets / f\"processed/fairsaxs_220512.animl\""
]
},
{
Expand Down Expand Up @@ -952,9 +952,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python [conda env:fairsaxs]",
"language": "python",
"name": "python3"
"name": "conda-env-fairsaxs-py"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -966,7 +966,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.10.4"
},
"vscode": {
"interpreter": {
Expand Down
18 changes: 9 additions & 9 deletions SAS-workflows/Giess_2022/M2-1_Curve_fitting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"metadata": {},
"outputs": [],
"source": [
"path_to_AnIML_file = path_to_datasets / f\"download/fairsaxs_220512/fairsaxs_220512.animl\""
"path_to_AnIML_file = path_to_datasets / f\"processed/fairsaxs_220512.animl\""
]
},
{
Expand Down Expand Up @@ -185,8 +185,8 @@
"outputs": [],
"source": [
"list_of_IDs = reader.available_seriesIDs\n",
"for series_ID in list_of_IDs:\n",
" print(series_ID)"
"for index, series_ID in enumerate(list_of_IDs):\n",
" print(index, series_ID)"
]
},
{
Expand Down Expand Up @@ -330,7 +330,7 @@
"id": "c114d047",
"metadata": {},
"source": [
"Automatically setting up the specifications for the fitting algorithm. Parameters are as following:\n",
"Automatically setting up the specifications for the fitting algorithm. Parameters are as follows:\n",
"- model_type: The type of model ('GaussianModel', 'LorentzianModel' or 'VoigtModel')\n",
"- tolerance: Tolerated variance of the peak location between model parameters given by the automatic_peak_finding and the final fit parameters (default is 0.5)"
]
Expand All @@ -344,7 +344,7 @@
"source": [
"curvefitting.set_specifications_automatically(\n",
" model_type = 'LorentzianModel',\n",
" tolerance = 0.01\n",
" tolerance = 0.5\n",
")"
]
},
Expand Down Expand Up @@ -449,7 +449,7 @@
"metadata": {},
"outputs": [],
"source": [
"curvefitting.save_list_of_peak_centers()\n"
"curvefitting.save_list_of_peak_centers()"
]
},
{
Expand Down Expand Up @@ -491,9 +491,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python [conda env:fairsaxs]",
"language": "python",
"name": "python3"
"name": "conda-env-fairsaxs-py"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -505,7 +505,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.10.4"
},
"vscode": {
"interpreter": {
Expand Down
8 changes: 4 additions & 4 deletions SAS-workflows/Giess_2022/M2-1_Origin.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"metadata": {},
"outputs": [],
"source": [
"path_to_AnIML_file = path_to_datasets / f\"download/fairsaxs_220512/fairsaxs_220512.animl\""
"path_to_AnIML_file = path_to_datasets / f\"processed/fairsaxs_220512.animl\""
]
},
{
Expand Down Expand Up @@ -269,9 +269,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python [conda env:fairsaxs]",
"language": "python",
"name": "python3"
"name": "conda-env-fairsaxs-py"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -283,7 +283,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.10.4"
},
"vscode": {
"interpreter": {
Expand Down
Loading

0 comments on commit 8159d52

Please sign in to comment.