{ "info": { "author": "Bonan Zhu", "author_email": "bon.zhu@protonmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# peempy\n\nA suite for processing PEEM-XMCD data from I06 Diamond Light Source.\n\n\n## PEEM-XMCD work flow\n\nXMCD signals are from the difference of images taken under two different circular polarisation of X-ray.\nThere are two types of data - XMCD4 and XMCD2. The former captures 4N images of resonance+, off-resonance+, resonance-, off-resonance-.\nUsually N=10. Images of each set are averaged. The polarisation dependent signal is taken from the difference between on and off resonance.\n\nThe difficulty is that there is drift over time but averaging the signal is required to reduce noise. \nThe images need to be drift-corrected to minimize mismatch between them before taking the average.\nIn addition, on and off resonance images need to be drift corrected separately.\n\n\n## What this does\n### Drift correction for each capture\nA more robust drift correction scheme is implemented, taking the advantage that the drift is aggregation process.\nIn the original Igor implementation, an ROI containing a feature needs to be selected and the feature has to stay in the ROI in the entire series.\nHere, we allow a *floating* ROI for each frame.\nThe ROI of the next frame is shifted based on the calculated absolute displacement of the current frame.\nThis effectively makes the ROI \"lock on\" to feature in the image series.\nHence, the initial ROI only need to be as large as the *feature*, given that the relative drift between the frames does not move the feature completely out of the ROI. \n\nThe routine in `skimage.feature.register_translation` is used. \nIt is much faster than the standard (super-sampled) image convolution scheme.\nThe reference image is improved on-the-fly by adding weight averages of the corrected frames for noisy data.\n\n### Batch processing\nA script for batch processing has been written. Using python's `multiprocessing` module, \nparallel batch processing can be performed to use all computational power.\nCaptures can be previewed before processing for selecting a sensible drift area.\nFor memory efficiency, it is desirable to use the *inplace* drift processing model to avoid creating addition copies of the data.\n\n### XMCD signal calculation\nXMCD signal image can be generated using `peempy.xmcd`\n\n### XMCD vector map construction\nXMCD vector map can be generated from the signal of more than one of the angles. \nDue to the distortion from the instrument, frames need to be aligned before fitting.\nThis package allows image alignment between an arbitrary number of frames based on any number of control points for alignment.\nThree-dimensional vector map can be constructed if XMCD images are captured with more than three angles. \n\n## Get started\n\n### Installation\n\nThe stable version of the package is uploaded to Python Package Index (pypi) and can be installed with:\n\n```\npip install peempy\n```\n\nAlternatively, the develop version can be installed using:\n\n```\npip install git+https://gitlab.com/bz1/peempy@dev\n```\n\n### Comandline interface\n\nOnce the package is installed using `pip`, the command-line interface may be used to perform tasks such\nas computing XMCD signals from raw data, averaging XMCD signals and monitor the data taking progress.\nThe main command to be used is simple the package name - `peempy` and there are sub-commands for individual\nfunctionalities.\n\nAs an example:\n\n```\nUsage: peempy [OPTIONS] COMMAND [ARGS]...\n\n The command line interface of peempy\n\nOptions:\n --version Display the version of PEEMPY\n -pd, --peem-data-dir TEXT The beamline data directory\n -wd, --work-dir TEXT The base directory to be used for saving\n processed\n -dm, --drift-mode [one-pass|two-pass|iter]\n Drift correction mode\n -fp, --float-precision [single|double]\n Floating point precision when saving XMCD\n signal\n --help Show this message and exit.\n\nCommands:\n datalist Print the avaliable datafolders\n drift Perform batch drift operation.\n view-drift view the drift corrected images\n xmcdavg Align and average XMCD signals\n xmcdlist List IDs of captures that have XMCD computed.\n```\n\nFor any sub-commands the help information can be acces by passing the `--help` flag.\n\n### Python API\n\nThis package defines a number of classes to handle different tasks:\n\n* `ImageStack` is the base class for many others. It represent a stack of images stored an a multidimension array.\n* `ImageSeries` represents a time series of images and can be drift corrected.\n * `XMCDImageSeries` represents a XMCD capture, usually consisted of 40 frames with alternating energy/polarisation.\n * `DriftCorrector` is a class for conducting drift correction\n* `XMCDStack` is a stack of xmcd signals. This class is used for making vector maps.\n\n## TODOs\n* Write quick-start documentations", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/bz1/peempy", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "peempy", "package_url": "https://pypi.org/project/peempy/", "platform": "", "project_url": "https://pypi.org/project/peempy/", "project_urls": { "Homepage": "https://gitlab.com/bz1/peempy" }, "release_url": "https://pypi.org/project/peempy/0.2.1/", "requires_dist": null, "requires_python": ">=3.5", "summary": "Python tool for processing XMCD PEEM data", "version": "0.2.1" }, "last_serial": 5513269, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "3cc6173a6807156db3cfa5a428a24984", "sha256": "cb4bec95494a99abae268ce5740201fe6f6db8ca3e5107edde654127d33d65a8" }, "downloads": -1, "filename": "peempy-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3cc6173a6807156db3cfa5a428a24984", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 44652, "upload_time": "2019-05-22T21:39:23", "url": "https://files.pythonhosted.org/packages/7f/3e/70b4b78085be0187634a1f41f7696325b82baed5a92a9e7f0c43ced8fbf4/peempy-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b99688a4959d430192686f01715c4d8b", "sha256": "71ea9bf3322bf5635e7100a4d42a23f4627977d748d7beee54c37580d0e54b57" }, "downloads": -1, "filename": "peempy-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b99688a4959d430192686f01715c4d8b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35819, "upload_time": "2019-05-22T21:39:25", "url": "https://files.pythonhosted.org/packages/01/02/f4fb7097fca269279f2477126e3a10e4a86c30cf3cfbce3e609beedae8ec/peempy-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "02a3cc87a76de56ecce2e52a9229e3df", "sha256": "cb5aa63a6d3e58f3e9e424d303498b4d3a817c7d26958cd2d1e5f8df26edecbe" }, "downloads": -1, "filename": "peempy-0.2.1.tar.gz", "has_sig": false, "md5_digest": "02a3cc87a76de56ecce2e52a9229e3df", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 40938, "upload_time": "2019-07-10T17:47:26", "url": "https://files.pythonhosted.org/packages/ca/1f/1183765253198c54f066638dc9209b8929e1f1bb318a86ffc7f43ffc0d14/peempy-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "02a3cc87a76de56ecce2e52a9229e3df", "sha256": "cb5aa63a6d3e58f3e9e424d303498b4d3a817c7d26958cd2d1e5f8df26edecbe" }, "downloads": -1, "filename": "peempy-0.2.1.tar.gz", "has_sig": false, "md5_digest": "02a3cc87a76de56ecce2e52a9229e3df", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 40938, "upload_time": "2019-07-10T17:47:26", "url": "https://files.pythonhosted.org/packages/ca/1f/1183765253198c54f066638dc9209b8929e1f1bb318a86ffc7f43ffc0d14/peempy-0.2.1.tar.gz" } ] }