{ "info": { "author": "astropenguin", "author_email": "taniguchi@a.phys.nagoya-u.ac.jp", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# ndRADEX\n\n[![](https://img.shields.io/pypi/v/ndradex.svg?label=PyPI&style=flat-square)](https://pypi.org/pypi/ndradex/)\n[![](https://img.shields.io/pypi/pyversions/ndradex.svg?label=Python&color=yellow&style=flat-square)](https://pypi.org/pypi/ndradex/)\n[![Travis](https://img.shields.io/travis/astropenguin/ndradex/master.svg?label=Travis%20CI&style=flat-square)](https://travis-ci.org/astropenguin/ndradex)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?label=License&style=flat-square)](LICENSE)\n[![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.3384095-blue?style=flat-square)](https://doi.org/10.5281/zenodo.3384095)\n\n:zap: Python package for RADEX grid calculation\n\n## TL;DR\n\nndRADEX is a Python package which can run [RADEX], non-LTE molecular radiative transfer code, with parameters of multiple values (i.e., RADEX with grid parameters).\nThe output will be multi-dimensional arrays, which may be useful for parameter search of physical conditions in comparison with observed values.\n\n## Features\n\n- **Grid calculation:** ndRADEX has a simple `run()` function, where all parameters of RADEX can be griddable (i.e., they can be list-like with length of more than one).\n- **Builtin RADEX:** ndRADEX provides builtin RADEX binaries in the package, which are automatically downloaded and built during the package installation. You don't need any additional setups.\n- **Multiprocessing:** ndRADEX supports multiprocessing RADEX run by default. At least twice speedup is expected compared to single processing.\n- **Handy I/O:** The output of ndRADEX is a [xarray]'s Dataset, a standard multi-dimensional data structure as well as [pandas]. You can handle it in the same manner as NumPy and pandas (i.e., element-wise operation, save/load data, plotting, etc).\n\n## Requirements\n\n- Python 3.6 or 3.7\n- gfortran (necessary to build RADEX)\n\n## Installation\n\nYou can install ndRADEX with pip:\n\n```shell\n$ pip install ndradex\n```\n\nPlease make sure that all requirements are met before the installation.\n\n## Usages\n\nWithin Python, import the package like:\n\n```python\n>>> import ndradex\n```\n\n### Single RADEX run\n\nThe main funtion of ndRADEX is `ndradex.run()`.\nFor example, to get RADEX results of CO(1-0) with kinetic temperature of 100 K, CO column density of 1e15 cm^-2, and H2 density of 1e3 cm^-3:\n\n```python\n>>> ds = ndradex.run('co.dat', '1-0', 100, 1e15, 1e3)\n```\n\nwhere `'co.dat'` is a name of [LAMDA] datafile and `'1-0'` is a name of transition.\nThe available values are listed in [List of available LAMDA datafiles and transitions](https://github.com/astropenguin/ndradex/wiki/List-of-available-LAMDA-datafiles-and-transitions).\nNote that you don't need to any download datafiles:\nndRADEX automatically manage this.\n\nIn this case, other parameters like line width, background temperature are default values defined in the function.\nThe geometry of escape probability is uniform (`'uni'`) by default.\nYou can change these values with custom config (see customizations below).\n\nThe output is a [xarray]'s Dataset with no dimension:\n\n```python\n>>> print(ds)\n\nDimensions: ()\nCoordinates:\n QN_ul >> flux = ds['F'].values\n```\n\n### Grid RADEX run\n\nAs a natural extension, you can run grid RADEX calculation like:\n\n```python\n>>> ds = ndradex.run('co.dat', ['1-0', '2-1'], T_kin=[100, 200, 300],\n N_mol=1e15, n_H2=[1e3, 1e4, 1e5, 1e6, 1e7])\n```\n\nThere are 13 parameters which can be griddable:\n`QN_ul` (transition name), `T_kin` (kinetic temeperature), `N_mol` (column density), `n_H2` (H2 density), `n_pH2` (para-H2 density), `n_oH2` (ortho-H2 density), `n_e` (electron density), `n_H` (atomic hydrogen density), `n_He` (Helium density), `n_Hp` (ionized hydrogen density), `T_bg` (background temperature), `dv` (line width), and `geom` (photon escape geometry).\n\nThe output of this example is a [xarray]'s Dataset with three dimensions of (`QN_ul`, `T_kin`, `n_H2`):\n\n```python\n>>> print(ds)\n\nDimensions: (QN_ul: 2, T_kin: 3, n_H2: 5)\nCoordinates:\n * QN_ul (QN_ul) >> ndradex.save_dataset(ds, 'results.nc')\n\n# load results from a netCDF file\n>>> ds = ndradex.load_dataset('results.nc')\n```\n\n## Customizations\n\nFor the first time you import ndRADEX, the custom configuration file is created as `~/.config/ndradex/config.toml`.\nBy editing this, you can customize the following two settings of ndRADEX.\nNote that you can change the path of configuration file by setting an environment variable, `NDRADEX_PATH`.\n\n### Changing default values\n\nAs mentioned above, you can change the default values of the `run()` function like:\n\n```toml\n# config.toml\n\n[grid]\nT_bg = 10 # change default background temp to 10 K\ngeom = \"lvg\" # change default geometry to LVG\ntimeout = 30\nn_procs = 2\n```\n\nYou can also change the number of multiprocesses (`n_procs`) and timeout (`timeout`) here.\n\n### Setting datafile aliases\n\nSometimes datafile names are not intuitive (for example, name of CS datafile is `cs@lique.dat`).\nFor convenience, you can define aliases of datafile names like:\n\n```toml\n# config.toml\n\n[lamda]\nCO = \"co.dat\"\nCS = \"cs@lique.dat\"\nH13CN = \"https://home.strw.leidenuniv.nl/~moldata/datafiles/h13cn@xpol.dat\"\n```\n\nAs shown in the third example, you can also specify URL or local file path on the right hand.\nAfter the customization, you can use these aliases in the `run()` function:\n\n```python\n>>> ds = ndradex.run('CS', '1-0', ...) # equiv to cs@lique.dat\n```\n\n## References\n\n- [RADEX]\n- [LAMDA]\n- [xarray]\n- [pandas]\n\n[xarray]: http://xarray.pydata.org/en/stable/\n[RADEX]: https://home.strw.leidenuniv.nl/~moldata/radex.html\n[LAMDA]: https://home.strw.leidenuniv.nl/~moldata/\n[pandas]: https://pandas.pydata.org/", "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/astropenguin/ndradex", "keywords": "radio-astronomy,python,radex,xarray", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ndradex", "package_url": "https://pypi.org/project/ndradex/", "platform": "any", "project_url": "https://pypi.org/project/ndradex/", "project_urls": { "Homepage": "https://github.com/astropenguin/ndradex" }, "release_url": "https://pypi.org/project/ndradex/0.2.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Python package for RADEX grid calculation", "version": "0.2.0" }, "last_serial": 5771539, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "b5752f58a4e48617af574ddfc36fc306", "sha256": "fa0b0a39291012e4bf93c60eead43a543e989c97b300841aa1e02ddc0b3d3857" }, "downloads": -1, "filename": "ndradex-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b5752f58a4e48617af574ddfc36fc306", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10476, "upload_time": "2019-05-06T04:35:45", "url": "https://files.pythonhosted.org/packages/79/ae/9763b7505d098a73388e775056dbef1c04bdd9a5830a23f17d2783daa508/ndradex-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "7e7a3daa746ae9cb2eca5da2d4ea8144", "sha256": "5f8e4e1adda127d27f7f00cb8b4a0b9f3eab844f1a1ab981248e6d47b1a26f12" }, "downloads": -1, "filename": "ndradex-0.1.2.tar.gz", "has_sig": false, "md5_digest": "7e7a3daa746ae9cb2eca5da2d4ea8144", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10507, "upload_time": "2019-05-06T11:30:20", "url": "https://files.pythonhosted.org/packages/61/95/2416770fa881df3cc6487adc718f8c30f45c51d1bf8fba490023f5cc2867/ndradex-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "7c7eac19c44f6a229f77531c8c622a37", "sha256": "0d9f43c726958f5bdab0d72c266918535815a88503b0ce8fa6cef5308415c976" }, "downloads": -1, "filename": "ndradex-0.1.3.tar.gz", "has_sig": false, "md5_digest": "7c7eac19c44f6a229f77531c8c622a37", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10514, "upload_time": "2019-05-06T11:45:05", "url": "https://files.pythonhosted.org/packages/2d/34/895749f13b51803d7ffcd7c1b0a6b23db82f9f80412df6c4f278a3bc7df2/ndradex-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "38cd56d74866bdafb5270326135e12e1", "sha256": "d66f090f8702b53cba005cb522579b5e8ebc6aab2c0bc94cbee7fa6142f0125b" }, "downloads": -1, "filename": "ndradex-0.1.4.tar.gz", "has_sig": false, "md5_digest": "38cd56d74866bdafb5270326135e12e1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 15808, "upload_time": "2019-05-06T17:42:48", "url": "https://files.pythonhosted.org/packages/5d/1b/3fa9d132705aae629c8d63133f8784c30a4bbade514715e7fbc5e2e5377f/ndradex-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "665bd87a50659321beb5d7280a2eb9cd", "sha256": "aec655c025e4c38f4d9b8ddbf4bf56a2ee4690a0e05bf8c6a34133fddfdb7353" }, "downloads": -1, "filename": "ndradex-0.1.5.tar.gz", "has_sig": false, "md5_digest": "665bd87a50659321beb5d7280a2eb9cd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 15875, "upload_time": "2019-05-07T08:44:50", "url": "https://files.pythonhosted.org/packages/7e/40/e37b1ef3a79f8be16b52998f5f2412f3855bf2bb75f759471c3e22c3386b/ndradex-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "ae9400d6e55457450217b73d6cd2fd31", "sha256": "e03d09255bf25cd297c92b841b354daa51f715425d89f9b7fdf678ef0551c0e9" }, "downloads": -1, "filename": "ndradex-0.1.6.tar.gz", "has_sig": false, "md5_digest": "ae9400d6e55457450217b73d6cd2fd31", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 15901, "upload_time": "2019-05-08T11:59:40", "url": "https://files.pythonhosted.org/packages/a6/db/bed2efd4a58f783477f6d1cc0082f0ed76a3a2cd57dc5b341f81464f1131/ndradex-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "ea0cd10d15074b3681ae1057f6978a90", "sha256": "d4296dfb4ff5d028fe3fcc1ee76d7ab442f50a5e59c4b7781e7c5704c7800587" }, "downloads": -1, "filename": "ndradex-0.1.7.tar.gz", "has_sig": false, "md5_digest": "ea0cd10d15074b3681ae1057f6978a90", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 15923, "upload_time": "2019-05-12T12:34:27", "url": "https://files.pythonhosted.org/packages/28/12/c38124266fe88fabe3f637487066342df0b3dfe59be71fdec2e171054be3/ndradex-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "df2eff31a53b35173a62df140c6b7b9e", "sha256": "364ee07976f9ff56bc1bd49708edd6d27590532026041d508ab612698ced550b" }, "downloads": -1, "filename": "ndradex-0.1.8.tar.gz", "has_sig": false, "md5_digest": "df2eff31a53b35173a62df140c6b7b9e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 16106, "upload_time": "2019-05-16T09:40:36", "url": "https://files.pythonhosted.org/packages/0a/32/6f9ce23a1e3b375dfaa501ddbf3e84299382e3ecb675fc863cd5f60b9407/ndradex-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "6be629f97c7158ec2a70be99e6c73fe6", "sha256": "9246f8a72625e550ad99a5b42390f8477927a82fa9677951e41a95732c95ac9b" }, "downloads": -1, "filename": "ndradex-0.1.9.tar.gz", "has_sig": false, "md5_digest": "6be629f97c7158ec2a70be99e6c73fe6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 16105, "upload_time": "2019-09-02T13:51:17", "url": "https://files.pythonhosted.org/packages/98/05/69050d842f45cb886628a31735c57c1ebff31e3719fea329e9344bbc7f0d/ndradex-0.1.9.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "6851f0b6d53569ada499e884e59c31a9", "sha256": "a74640bcbfa4faf20d3975e990166e1954c745eb02536cbd310c1b0c18f689dc" }, "downloads": -1, "filename": "ndradex-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6851f0b6d53569ada499e884e59c31a9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 16076, "upload_time": "2019-09-02T15:48:11", "url": "https://files.pythonhosted.org/packages/33/a3/7ad4eddb8661b1313046aa9136154da68cc57ccf4f0a288ae3e3c63ff006/ndradex-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6851f0b6d53569ada499e884e59c31a9", "sha256": "a74640bcbfa4faf20d3975e990166e1954c745eb02536cbd310c1b0c18f689dc" }, "downloads": -1, "filename": "ndradex-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6851f0b6d53569ada499e884e59c31a9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 16076, "upload_time": "2019-09-02T15:48:11", "url": "https://files.pythonhosted.org/packages/33/a3/7ad4eddb8661b1313046aa9136154da68cc57ccf4f0a288ae3e3c63ff006/ndradex-0.2.0.tar.gz" } ] }