diff --git a/Resonanz/tools/swing.ipynb b/Resonanz/tools/swing.ipynb index 8fe93ecd7c661f3f2d57a43824d5d4e52f866107..8311df78c435f0ae1d8e922e719ffbfe6a7b6728 100644 --- a/Resonanz/tools/swing.ipynb +++ b/Resonanz/tools/swing.ipynb @@ -47,30 +47,21 @@ "Mit dem folgenden Code-Fragment zeigen wir Ihnen:\n", " \n", " * Wie man mit der PhyPrakit Funktion *labxParser* Daten aus einer *labx*-Datei des CASSY-Messsystems **einließt**.\n", - " * Wir verwenden hierzu die Beispiel-Datei `CassyExample.labx`, aus dem *tools*-Verzeichnis." + " * Bei der vom CASSY-Messsystem ausgegebenen *labx*-Datei handelt es sich um eine **gezippte *xml*-Datei**.\n", + " * Wenn Sie die Datei entpacken findent Sie die *xml*-Datei in einem entsprechend entpackten Verzeichnis.\n", + " * Diese Datei können Sie mit der Funktion *labxParser* wie in der folgenden Code-Zelle gezeigt einlesen.\n", + " * Wir verwenden hierzu die Beispiel-Datei `CassyExample.xml`, aus dem *tools*-Verzeichnis." ] }, { "cell_type": "code", - "execution_count": 105, + "execution_count": null, "id": "c5723f54-17d7-4ba2-ac75-56ce00cbac87", "metadata": {}, - "outputs": [ - { - "ename": "ModuleNotFoundError", - "evalue": "No module named 'PhyPraKit.phyTools'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[105], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mnumpy\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mnp\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mPhyPraKit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mphyTools\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m labxParser\n\u001b[1;32m 4\u001b[0m \u001b[38;5;66;03m# Read data from CASSY; \u001b[39;00m\n\u001b[1;32m 5\u001b[0m \u001b[38;5;66;03m# column_names: hosts the column names; \u001b[39;00m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;66;03m# data: hosts the individual columns as lists. \u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[38;5;66;03m# the labx file. If you want to shut the function up set prlevel=0. Check \u001b[39;00m\n\u001b[1;32m 10\u001b[0m \u001b[38;5;66;03m# help(labxParser) to learn more about this function\u001b[39;00m\n\u001b[1;32m 11\u001b[0m column_names, data \u001b[38;5;241m=\u001b[39m labxParser(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCassyExample.labx\u001b[39m\u001b[38;5;124m\"\u001b[39m, prlevel\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m)\n", - "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'PhyPraKit.phyTools'" - ] - } - ], + "outputs": [], "source": [ "import numpy as np\n", - "from PhyPraKit.phyTools import labxParser\n", + "from PhyPraKit.PhyPraKit.phyTools import labxParser\n", "\n", "# Read data from CASSY; \n", "# column_names: hosts the column names; \n", @@ -79,7 +70,7 @@ "# set it to 1 here, so that you can learn something about the structure of \n", "# the labx file. If you want to shut the function up set prlevel=0. Check \n", "# help(labxParser) to learn more about this function\n", - "column_names, data = labxParser(\"CassyExample.labx\", prlevel=1)\n", + "column_names, data = labxParser(\"CassyExample.xml\", prlevel=1)\n", "# For this example we collect the oservables \"Zeit\" and \"Winkel\"\n", "t=[]; phi=[]\n", "# We cut off the first 400 and last 450 lines to reduce the amount of data \n", @@ -97,7 +88,8 @@ " t = np.array(data[i][LOWER_CUT:UPPER_CUT])\n", " if tcn == \"Winkel\":\n", " # Copy full column in variable phi\n", - " phi = np.array(data[i][LOWER_CUT:UPPER_CUT])" + " phi = np.array(data[i][LOWER_CUT:UPPER_CUT])\n", + "#print(t, phi)" ] }, {