{ "info": { "author": "lesnat", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Scientific/Engineering :: Physics" ], "description": "# Particle Phase Space Analysis Toolkit\n\np2sat is an open-source, object-oriented python package created to simplify particle phase-space analysis.\n\nCore features of the package are :\n- Automatic calculation of kinetic energy, divergence angle and gamma factor of the particles from phase space informations\n- Histogram making (1D, 2D, 3D) and data fits (1D)\n- Plotting (1D to 3D histograms, scatter and contour plots) with automatic normalizations and legend\n- Particle filtering with a given property (for example select all the particles at a given position)\n- Statistical tools (standard deviation, covariance, ...)\n- Import data from simulation files (Smilei, Geant4, text files, ...)\n- Low memory load\n\nThis allows to process complex operations in a very concise and clear way, as shown in the examples.\n\nSee objects documentation for more informations.\n\n**Notes :**\n- This package was made for my personal use and then contains only few methods to import data from code results, but you can easily add your own (please, share !) and use it to perform your data analysis. See sub-object ``_Extract`` for more informations.\n- This tool can be usefull to physicists working with Particle-In-Cell or Monte Carlo codes\n\n## Installation\n\nThe most simple way to install p2sat is to use pip (https://pypi.org/project/p2sat/)\n\n```bash\npip install p2sat\n```\n\nOtherwise, you can also download the source code from github and type the following commands\n\n```bash\ncd p2sat\npython setup.py install\n```\n\nIf it is not working, you can add the following lines at the beginning of your script\n\n```python\np2sat_path=\"/path/to/p2sat/\"\nimport sys\nif p2sat_path not in sys.path: sys.path.append(p2sat_path)\n\nimport p2sat\n```\n\n## Examples\n\nHere is one quick example of p2sat usage, with my Geant4 app results (see ``examples/`` for more informations).\n\n### Import results from a simulation file\n\n```python\neps = p2sat.PhaseSpace(particle=\"electron\")\neps.extract.txt(\"example.csv\", sep=\",\")\n```\n\n### 1D histogram\n\nSpectrum (Number/MeV) of all the electrons with time selection between 700 and 900 fs (bin width of 0.1 MeV)\n```python\nekin,spectrum = eps.hist.h1('ekin',bwidth=0.1,select={'t':[700.0,900.0]})\n```\n\n### 1D histogram plot and fit\n\nSpectrum of electrons, and exponential fit for energy > 0.511 MeV (bin width of 0.1 MeV, log scale)\n```python\neps.plot.h1('ekin', log=True, bwidth=0.1)\neps.plot.f1('ekin', func_name=\"exp\", log=True, bwidth=0.1, select={'ekin':[0.511,None]})\n```\n\n![](Figure_0.png)\n\n### 2D histogram plot\n\nTransverse particle dispersion (y, z) at x = 300 \u00b5m, for electrons with kinetic energy > 0.511 MeV (log color scale, bin width of 5 \u00b5m each, between -300 and 300 \u00b5m each)\n```python\neps.plot.h2('y','z',log=True,\n bwidth1=5.0,bwidth2=5.0,\n brange1=[-300.,300.],brange2=[-300.,300.],\n select={'x':300,'ekin':[0.511,None]})\n```\n\n![](Figure_1.png)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lesnat/p2sat", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "p2sat", "package_url": "https://pypi.org/project/p2sat/", "platform": "", "project_url": "https://pypi.org/project/p2sat/", "project_urls": { "Homepage": "https://github.com/lesnat/p2sat" }, "release_url": "https://pypi.org/project/p2sat/1.4.2/", "requires_dist": null, "requires_python": "", "summary": "Particle Phase Space Analysis Toolkit", "version": "1.4.2" }, "last_serial": 4390387, "releases": { "1.4.1": [ { "comment_text": "", "digests": { "md5": "a43a92ce47023a37229d88cd33813c28", "sha256": "302751c0cf0fd97303fd678a4a24606df454abfa69965970bad58353b8b320be" }, "downloads": -1, "filename": "p2sat-1.4.1.tar.gz", "has_sig": false, "md5_digest": "a43a92ce47023a37229d88cd33813c28", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 85073, "upload_time": "2018-10-12T10:49:57", "url": "https://files.pythonhosted.org/packages/50/99/58497f5e0035cf6447d5465946e2b9b9a159c095862f721940856b154892/p2sat-1.4.1.tar.gz" } ], "1.4.2": [ { "comment_text": "", "digests": { "md5": "f6a17c9a656de50781a7e9bda66400ab", "sha256": "82db32fcecc1f741a07cf7232742944a186dbd376bc809a881bd86e76acf07c9" }, "downloads": -1, "filename": "p2sat-1.4.2.tar.gz", "has_sig": false, "md5_digest": "f6a17c9a656de50781a7e9bda66400ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 85069, "upload_time": "2018-10-18T13:42:22", "url": "https://files.pythonhosted.org/packages/d2/f2/9db1a0d14ce3d961e07624a7304676f5d89c6c123ca19a184bbd1dd32c48/p2sat-1.4.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f6a17c9a656de50781a7e9bda66400ab", "sha256": "82db32fcecc1f741a07cf7232742944a186dbd376bc809a881bd86e76acf07c9" }, "downloads": -1, "filename": "p2sat-1.4.2.tar.gz", "has_sig": false, "md5_digest": "f6a17c9a656de50781a7e9bda66400ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 85069, "upload_time": "2018-10-18T13:42:22", "url": "https://files.pythonhosted.org/packages/d2/f2/9db1a0d14ce3d961e07624a7304676f5d89c6c123ca19a184bbd1dd32c48/p2sat-1.4.2.tar.gz" } ] }