You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: nmrpy/docs/quickstart_tutorial.ipynb
+92-6Lines changed: 92 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -537,10 +537,23 @@
537
537
"cell_type": "markdown",
538
538
"metadata": {},
539
539
"source": [
540
-
"Peak integrals of the complete `FidArray` are stored in `deconvoluted_integrals`, or in each individual `Fid` as `deconvoluted_integrals`.\n",
540
+
"Peak integrals of the complete `FidArray` are stored in `deconvoluted_integrals`, or in each individual `Fid` as `deconvoluted_integrals`."
541
+
]
542
+
},
543
+
{
544
+
"cell_type": "markdown",
545
+
"metadata": {},
546
+
"source": [
547
+
"## Plotting the time-course"
548
+
]
549
+
},
550
+
{
551
+
"cell_type": "markdown",
552
+
"metadata": {},
553
+
"source": [
554
+
"The acquisition times for the individual `Fid` objects in the `FidArray` are stored in an array `t` for easy access. Note that when each `Fid` is collected with multiple transients/scans on the spectrometer, the acquisition time is calculated as the middle of its overall acquisition period.\n",
541
555
"\n",
542
-
"The species integrals can easily be plotted using the following code:\n",
543
-
""
556
+
"We could thus easily plot the time-course of the species integrals using the following code: "
544
557
]
545
558
},
546
559
{
@@ -578,6 +591,60 @@
578
591
"ax.legend(loc=0, frameon=False)"
579
592
]
580
593
},
594
+
{
595
+
"cell_type": "markdown",
596
+
"metadata": {},
597
+
"source": [
598
+
"## Deleting individual `Fid` objects from a `FidArray`"
599
+
]
600
+
},
601
+
{
602
+
"cell_type": "markdown",
603
+
"metadata": {},
604
+
"source": [
605
+
"Sometimes it may be desirable to remove one or more `Fid` objects from a `FidArray`, e.g. to remove outliers from the time-course of concentrations. This can be conveniently achieved with the `del_fid()` method, which takes as argument the `id` of the `Fid` to be removed. The acquisition time array `t` is updated accordingly by removing the corresponding time-point. After this, `deconv_fids()` has to be run again to update the array of peak integrals.\n",
606
+
"\n",
607
+
"A list of all the `Fid` objects in a `FidArray` is returned by the `get_fids()` method."
608
+
]
609
+
},
610
+
{
611
+
"cell_type": "code",
612
+
"execution_count": null,
613
+
"metadata": {},
614
+
"outputs": [],
615
+
"source": [
616
+
"print([f.id for f in fid_array.get_fids()])"
617
+
]
618
+
},
619
+
{
620
+
"cell_type": "code",
621
+
"execution_count": null,
622
+
"metadata": {},
623
+
"outputs": [],
624
+
"source": [
625
+
"for fid_id in [f.id for f in fid_array.get_fids()][::4]:\n",
626
+
" fid_array.del_fid(fid_id)\n",
627
+
"\n",
628
+
"print([f.id for f in fid_array.get_fids()])\n",
629
+
"print(['{:.2f}'.format(i) for i in fid_array.t])"
630
+
]
631
+
},
632
+
{
633
+
"cell_type": "markdown",
634
+
"metadata": {},
635
+
"source": [
636
+
"The gaps left by the deleted `Fid` objects are clearly visible in the plotted `FidArray`:"
"The filename need not be specified, if not given the name is taken from `fid_path` and the *.nmrpy* extension is appended. If the file exists, it is not overwritten; a forced overwrite can be specified with:"
0 commit comments