{ "info": { "author": "Jacopo Chevallard", "author_email": "jacopo.chevallard@mailfence.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Topic :: Scientific/Engineering :: Astronomy" ], "description": "# PySpecLines\n\nSome useful scripts to compute integrated line fluxes and equivalent widths from galaxy spectra using 3 different methods:\n\n- numerical (trapezoidal) integration\n- Gaussian fit using a \"standard\" Levenberg-Marquardt algorithm\n- Gaussian fit using an MCMC algorithm\n\n## Installing the package\n\nTo install ``PySpecLines`` you can use ``pip``, which will take care of installing the required dependencies as well\n```\npip install pyspeclines\n```\n\nTo upgrade to the latest available version you can run\n```\npip install pyspeclines --upgrade\n```\n\n## Data format\n\n### FITS binary table\n\n``PySpecLines`` works with FITS tables. Each spectrum should be contained in a separate FITS file, which **must** contain the following columns:\n\n- ``wl``, wavelength array in ``ang``\n- ``flux``, flux array in ``erg s^-1 cm^-2 ang^-1``\n- ``err``, error array in ``erg s^-1 cm^-2 ang^-1``\n\n### FITS header\n\n``PySpecLines`` also uses the following (**optional**) FITS header keywords:\n\n- ``REDSHIFT``, used to de-redshift a spectrum from the observed-frame to the rest-frame\n- ``RA``, right ascension of the object in ``deg``, in the ``ICRS`` frame, used to correct for Galactic absorption\n- ``DEC``, declination of the object in ``deg``, in the ``ICRS`` frame, used to correct for Galactic absorption\n\nWhen both keywords ``RA`` and ``DEC`` are present, ``PySpecLines`` can de-redden the spectrum (passing the option ``-deredden``) using the Galactic dust map of Schlegel, Finkbeiner & Davis (1998) recalibrated by Schlafly & Finkbeiner (2011), and the ``R_V=3.1`` extinction curve of Fitzpatrick (1999). \n\n### JSON configuration file\n\nA JSON file allows you to select and configure the emission lines to be measured. Some example JSON files are provided in the [PySpecLines/files](https://github.com/jacopo-chevallard/PySpecLines/tree/master/PySpecLines/files) folder. The JSON file contains a dictionary of ``key : values`` where ``key`` labels the line (or group of lines) and ``values`` contains multiple entries.\n\nBelow we report some simple examples:\n\n- single line: \n ```json\n {\n \"HeII4686\" : {\n \"wl_central\": [4686.0], \n \"wl_range\":[4680.0, 4681.0], \n \"continuum_left\":[4672.0, 4679.0],\n \"continuum_right\":[4692.0, 4700.0]\n }\n }\n ```\n - ``wl_central`` is used as starting point for the line center in the Gaussian fitting\n - ``wl_range`` is the range of numerical integration of the line\n - ``continuum_left`` is the range of numerical integration of the left-continuum\n - ``continuum_right`` is the range of numerical integration of the right-continuum \n - when using Gaussian fitting, the range over which the continuum is fitted is ``[continuum_left[0], continuum_right[1]]``\n\n- line doublet: \n ```json\n {\n \"SII6716_SII6731\" : {\n \"wl_central\": [6716.0, 6731.0], \n \"wl_range\":[6710.0, 6723.0], \n \"exclude\":[6710.0, 6721.0, 6726.0, 6740.0],\n \"continuum_left\":[6695.0, 6705.0],\n \"continuum_right\":[6740.0, 6750.0]\n }\n }\n ```\n - wrt to the example above, the ``key`` is composed of two labels separated by an underscore ``_``\n - ``exclude`` allows to define regions (``[exclude[0], exclude[1]], [exclude[2], exclude[3]]``) excluded from the continuum fitting \n \n- multiple kinematic components\n ```json\n {\n \"OIII5007N_OIII5007B\" : {\n \"wl_central\": [5007.0, 5007.0], \n \"width\": [100.0, 400.0], \n \"wl_range\":[5000.0, 5014.0], \n \"exclude\":[4995.0, 5020.0],\n \"continuum_left\":[4990.0, 5000.0],\n \"continuum_right\":[5020.0, 5034.0]\n }\n }\n ```\n - ``width`` allows to define multiple kinematic components, in this case a \"narrow\" (labelled ``OIII5007N``) and a \"broad\" (labelled ``OIII5007B``) component, whose starting widths **must** be set to different values.\n \n- multiple lines with multiple kinematic components\n ```json\n {\n \"NII6548_HalphaN_HalphaB_NII6584\" : {\n \"wl_central\": [6548.05, 6563.0, 6563.0, 6584.0], \n \"width\": [100.0, 100.0, 400.0, 100.0], \n \"exclude\":[6542.0, 6580.0],\n \"wl_range\":[6541.0, 6575.0], \n \"continuum_left\":[6515.0,6542.0],\n \"continuum_right\":[6595.0,6610.0]\n }\n }\n ```\n - in this case we want to use the same width for different lines (``NII6548``, ``HalphaN`` and ``NII6584``) and a different width for ``HalphaB``. We thus use the same ``width`` value for ``NII6548``, ``HalphaN`` and ``NII6584``, as this will \"tie\" together their widths during the Gaussian fitting, while the ``width`` of ``HalphaB`` will be kept separate.\n \n\n\n## Examples\n\nYou can see the different available options running\n```\npyspeclines --help\n```\n\nIf the spectrum is provided in the observed frame, then you must provide a ``REDSHIFT`` keyword in the FITS header containing the object redshift.\n\n- Compute the fluxes and EWs using numerical integration\n ```\n pyspeclines --file my_spectrum.fits --json-file emission_lines_EWs_config.json\n ```\n\n- Compute the fluxes and EWs using Gaussian fit (Levenberg-Marquardt)\n ```\n pyspeclines --file my_spectrum.fits --json-file emission_lines_EWs_config.json --gaussian-fit\n ```\n\n- Compute the fluxes and EWs using Gaussian fit (MCMC)\n ```\n pyspeclines --file my_spectrum.fits --json-file emission_lines_EWs_config.json --gaussian-fit --use-PyMC --MCMC-samples 5000\n ```", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jacopo-chevallard/PySpecLines", "keywords": "astronomy galaxies statistics visualization", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyspeclines", "package_url": "https://pypi.org/project/pyspeclines/", "platform": "", "project_url": "https://pypi.org/project/pyspeclines/", "project_urls": { "Homepage": "https://github.com/jacopo-chevallard/PySpecLines" }, "release_url": "https://pypi.org/project/pyspeclines/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "Package to compute integrated line fluxes and equivalent widths from galaxy spectra", "version": "0.2.1" }, "last_serial": 4821094, "releases": { "0.1.4": [ { "comment_text": "", "digests": { "md5": "b55197df74b23768d28034930907f405", "sha256": "b479a487b4bf4539fba538db05c1e2e475c7d4449fb66cb93ee23e8ecabb62e6" }, "downloads": -1, "filename": "pyspeclines-0.1.4-py2.7.egg", "has_sig": false, "md5_digest": "b55197df74b23768d28034930907f405", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 14041, "upload_time": "2019-02-12T17:17:32", "url": "https://files.pythonhosted.org/packages/54/44/9ed19de81ae924407a5171b804d4bdeb51039da69d70efee35a281e1b009/pyspeclines-0.1.4-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "e39ccc10c7fd22f19743fb14d825b84d", "sha256": "c6841906e9bbdcc323a50311e4469c71bc4eb33d6f9e2428da436591940cfcf0" }, "downloads": -1, "filename": "pyspeclines-0.1.4.tar.gz", "has_sig": false, "md5_digest": "e39ccc10c7fd22f19743fb14d825b84d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8138, "upload_time": "2019-02-12T17:17:34", "url": "https://files.pythonhosted.org/packages/b2/b0/5fb072e546f2ec4bf7d010a0a4a677cb3ebcec4e0dcb5e6d22a8e8845da1/pyspeclines-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "67fa1456cc6f3b7eb8f6892ddae69af7", "sha256": "d68b8cbd28877bd642ada49bcbfe5bb00e3f6469a24f62ce7125643317df1620" }, "downloads": -1, "filename": "pyspeclines-0.1.5-py2.7.egg", "has_sig": false, "md5_digest": "67fa1456cc6f3b7eb8f6892ddae69af7", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 15634, "upload_time": "2019-02-13T15:46:43", "url": "https://files.pythonhosted.org/packages/5c/7e/91b2c4711a4f955224ebafa4313362bceb1628161618c5442c9e455ce5e0/pyspeclines-0.1.5-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "e97f636f17139ec50ce4863d6712064b", "sha256": "006661e291f50c415d7a400e7f68f2d63052d6bf1ba9788f568ee48ac09c7850" }, "downloads": -1, "filename": "pyspeclines-0.1.5.tar.gz", "has_sig": false, "md5_digest": "e97f636f17139ec50ce4863d6712064b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8757, "upload_time": "2019-02-13T15:46:44", "url": "https://files.pythonhosted.org/packages/78/24/03bbe2f10789b1a8bb4bad08081bec9ced7faa5990e6f71363aa64dd46e1/pyspeclines-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "1f45a5c7479240da55c74112e2ce1209", "sha256": "cef6c93ae1e0f88ffe30956a59b880e07e7a60e1dae6d2d50d50f1d1673e8925" }, "downloads": -1, "filename": "pyspeclines-0.1.6-py2.7.egg", "has_sig": false, "md5_digest": "1f45a5c7479240da55c74112e2ce1209", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 15756, "upload_time": "2019-02-13T17:32:40", "url": "https://files.pythonhosted.org/packages/bb/7f/7a0d92aac8fce6080134eddc226bf755ce202aad3d20c2e8ebbb1db49548/pyspeclines-0.1.6-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "ad0a6338f729ee260d8c9d69b193a17a", "sha256": "5c6a8e2bd0ea046e9f07baad224daa184a3e79a8ab03ed26438c2ec510b976fd" }, "downloads": -1, "filename": "pyspeclines-0.1.6.tar.gz", "has_sig": false, "md5_digest": "ad0a6338f729ee260d8c9d69b193a17a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8814, "upload_time": "2019-02-13T17:32:41", "url": "https://files.pythonhosted.org/packages/a7/d9/d8f7a0bdb7d136a94b05954982d0f25c145eff93de4623ad01faff7fb407/pyspeclines-0.1.6.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "db41429aaae1d9ea8b30eb4c6c080731", "sha256": "c44b2189ac941733b7b2526420262693e5fd54e379b4a020eff0282cd8c821a3" }, "downloads": -1, "filename": "pyspeclines-0.2.1-py2.7.egg", "has_sig": false, "md5_digest": "db41429aaae1d9ea8b30eb4c6c080731", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 651196, "upload_time": "2019-02-14T16:07:17", "url": "https://files.pythonhosted.org/packages/39/e3/1eb108a5f65db17995dc4d39780ba8ffd58f1fb78d863f9d3f39a3c97feb/pyspeclines-0.2.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "5ac206961a9c5a1f2e9db3d561ed0b4e", "sha256": "3b5a02457e0a849168044caa054e98590111e04b44882ebac7e5d09622087420" }, "downloads": -1, "filename": "pyspeclines-0.2.1.tar.gz", "has_sig": false, "md5_digest": "5ac206961a9c5a1f2e9db3d561ed0b4e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 622406, "upload_time": "2019-02-14T16:07:19", "url": "https://files.pythonhosted.org/packages/6a/a1/3f2eece2e2c961f924b1217399c261a5ad811857c2c6188a56681c0e8b25/pyspeclines-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "db41429aaae1d9ea8b30eb4c6c080731", "sha256": "c44b2189ac941733b7b2526420262693e5fd54e379b4a020eff0282cd8c821a3" }, "downloads": -1, "filename": "pyspeclines-0.2.1-py2.7.egg", "has_sig": false, "md5_digest": "db41429aaae1d9ea8b30eb4c6c080731", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 651196, "upload_time": "2019-02-14T16:07:17", "url": "https://files.pythonhosted.org/packages/39/e3/1eb108a5f65db17995dc4d39780ba8ffd58f1fb78d863f9d3f39a3c97feb/pyspeclines-0.2.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "5ac206961a9c5a1f2e9db3d561ed0b4e", "sha256": "3b5a02457e0a849168044caa054e98590111e04b44882ebac7e5d09622087420" }, "downloads": -1, "filename": "pyspeclines-0.2.1.tar.gz", "has_sig": false, "md5_digest": "5ac206961a9c5a1f2e9db3d561ed0b4e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 622406, "upload_time": "2019-02-14T16:07:19", "url": "https://files.pythonhosted.org/packages/6a/a1/3f2eece2e2c961f924b1217399c261a5ad811857c2c6188a56681c0e8b25/pyspeclines-0.2.1.tar.gz" } ] }