{"id":18290216,"url":"https://github.com/deshima-dev/galspec","last_synced_at":"2025-04-05T10:30:38.655Z","repository":{"id":57433022,"uuid":"292601405","full_name":"deshima-dev/GalSpec","owner":"deshima-dev","description":"GalSpec package","archived":false,"fork":false,"pushed_at":"2020-11-18T09:25:40.000Z","size":197,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T02:32:34.923Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deshima-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-03T14:59:16.000Z","updated_at":"2021-01-19T21:24:12.000Z","dependencies_parsed_at":"2022-08-27T20:52:16.459Z","dependency_job_id":null,"html_url":"https://github.com/deshima-dev/GalSpec","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deshima-dev%2FGalSpec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deshima-dev%2FGalSpec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deshima-dev%2FGalSpec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deshima-dev%2FGalSpec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deshima-dev","download_url":"https://codeload.github.com/deshima-dev/GalSpec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247324321,"owners_count":20920622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T14:09:53.564Z","updated_at":"2025-04-05T10:30:38.294Z","avatar_url":"https://github.com/deshima-dev.png","language":"Python","readme":"[![License](https://img.shields.io/badge/license-MIT-blue.svg?label=License\u0026style=flat-square)](LICENSE)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4279062.svg)](https://doi.org/10.5281/zenodo.4279062)\n\n# GalSpec package\nThis package is intended to quickly and easily generate a galaxy spectrum with a blackbody continuum emission and emission lines. The lines in this package are:\n* CO lines \n* SIII\n* SiII\n* OIII, OI \n* NIII, NII \n* CII, CI\n\n*Code by Tom Bakx, packaging and addition of molecular lines and rescaling by Stefanie Brackenhoff*\n\n## Functionalities \u0026 Usage\n* A spectrum can be generated using the ```spectrum()``` function. \n\nIt takes the following inputs:\n* **luminosity** in units of log(L_fir [L_sol])\n* **redshift** z\n* **fLow, fHigh** minimum and maximum frequency that will be in the spectrum in units of GHz\n* **numFreqBins** amount of linearly spaced frequency bins at which the spectrum should be evaluated\n* **linewidth** width of spectral lines in units of km/s\n* **COlines** 'Kamenetzky' [1] or 'Rosenberg' [2] determines the amplitude of the CO lines, default is Kamenetzky. \n* **lines** 'Bonato' [3] or 'Spinoglio' [4] determines the amplitude of the remaining spectral lines, default is Bonato\n* **mollines** 'True' or 'False'. Toggles whether molecularlines are shown. Values estimated using [5]. Defaults as 'True'\n* **variance** adds uncertainty to the amplitude of the atomic lines. Defaults to 0. Variation in molecular lines not implemented in the current version.\n* **manualrescale** sets whether the lines should be default ratios by Kamenetzky/Rosenberg and Bonato/Spinoglio, or set by user. Options: \n\t- **'False'** default line amplitudes used\n    - **'Absolute'** numpy array of 37 line amplitudes in Jy additive to blackbody emission can be set in rescaleArray. Additional entries ignored if mollines is set to 'False'.\n    - **'Relative'** numpy array of 37 scalars can be set in rescaleArray. The default ratios from Kamenetzky/Rosenberg are multiplied by these scalars prior to addition to the blackbody spectrum. Additional entries ignored if mollines is set to 'False'.\n* **rescaleArray** rescales the emission lines according to setting in 'manualrescale'. Order of the lines can be found using ```linenames()```\n\nAnd creates as output:\n* **freqArray** array frequencies in units of GHz\n* **spectrum** array of the flux densities in the spectrum in units of Jy\n\n[1]: http://dx.doi.org/10.3847/0004-637X/829/2/93\n[2]: https://ui.adsabs.harvard.edu/link_gateway/2015ApJ...801...72R/doi:10.1088/0004-637X/801/2/72\n[3]: https://ui.adsabs.harvard.edu/link_gateway/2014MNRAS.438.2547B/doi:10.1093/mnras/stt2375\n[4]: https://ui.adsabs.harvard.edu/link_gateway/2012ApJ...745..171S/doi:10.1088/0004-637X/745/2/171\n[5]: https://arxiv.org/pdf/1106.5054.pdf\n\n\n\n* The spectrum can quickly be plotted using the ```plotspectrum()``` function\n\nThis function takes the outputs of ```spectrum()``` as an input and creates a plot with axis labels\n\n\n\n* The names of the spectral lines and their order for the ```rescaleArray``` in ```spectrum()``` are outputted in a numpy array. Whether the names of molecular lines are shown can be toggled by setting the keyword mollines to 'False'.\n\n## Examples\n* Simple example\n```\nimport galspec\n\nluminosity = 13.7\nz = 4.43\nfLow = 90 #GHz\nfHigh = 910 #GHz\nnumFreqBins = 1500\nlinewidth = 600\ngal_freq, gal_flux = galspec.spectrum(luminosity, z, fLow, fHigh, numFreqBins, linewidth, mollines = 'False')\n\ngalspec.plotspectrum(gal_freq, gal_flux)\n```\n\n![Example](/example_spectrum.png)\n\n* Using the ratios by Rosenberg and Spinoglio\n```\nimport galspec\n\nluminosity = 13.7\nz = 4.43\nfLow = 90 #GHz\nfHigh = 910 #GHz\nnumFreqBins = 1500\nlinewidth = 600\ngal_freq, gal_flux = galspec.spectrum(luminosity, z, fLow, fHigh, numFreqBins, linewidth, 'Rosenberg', 'Spinoglio', mollines = 'False')\n\ngalspec.plotspectrum(gal_freq, gal_flux)\n```\n![Example2](/example_spectrum_RosSpin.png)\n\n* Using manual ratios to only show CO lines\n```\nimport galspec\nimport numpy as np\n\nluminosity = 13.7\nz = 4.43\nfLow = 90 #GHz\nfHigh = 910 #GHz\nnumFreqBins = 1500\nlinewidth = 600\n\nnames = galspec.linenames()\nlines = np.zeros(len(names))\nfor i in range(len(names)):\n    if names[i].startswith('CO'): lines[i]=1\n\ngal_freq, gal_flux = galspec.spectrum(luminosity, z, fLow, fHigh, numFreqBins, linewidth, manualrescale = 'Relative', rescaleArray = lines, mollines = 'False')\n\ngalspec.plotspectrum(gal_freq, gal_flux)\n```\n![Example3](/example_spectrum_CO_only.png)\n\n* Including molecular lines\n```\nimport galspec\nimport numpy as np\n\nluminosity = 13.7\nz = 4.43\nfLow = 90 #GHz\nfHigh = 910 #GHz\nnumFreqBins = 1500\nlinewidth = 600\n\n\ngal_freq, gal_flux = galspec.spectrum(luminosity, z, fLow, fHigh, numFreqBins, linewidth)\n\ngalspec.plotspectrum(gal_freq, gal_flux)\n```\n![Example4](/example_spectrum_with_mols.png)\n\n## Installation\n```pip install galspec```\n\n## Required packages\n* ```Numpy```\n* ```astropy```\n* ```matplotlib```\n* ```scipy```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeshima-dev%2Fgalspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeshima-dev%2Fgalspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeshima-dev%2Fgalspec/lists"}