https://github.com/andresgur/muse_project

Scripts to deal with some subtleties regarding MUSE data

https://github.com/andresgur/muse_project

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: iop.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.4%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Scripts to deal with some subtleties regarding MUSE data

Basic Info
  • Host: GitHub
  • Owner: andresgur
  • Language: Python
  • Default Branch: main
  • Size: 16.1 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • Open Issues: 2
  • Releases: 0
Created almost 5 years ago · Last pushed 6 months ago
Metadata Files
Readme

README.md

muse_project

These scripts were developed for Gúrpide et al. 2022 and have been regularly updated since then. They allow to extract useful information mainly from MUSE datacubes and images but there's also some functionality to extract fluxes from hst images and chandra PSF profiles. Scripts can be run from the command line. Run python <script> -h to check the input variables and a small description of the script.

CHANDRA

marxsim_script.py --> Script to be run from the command line to simulate N PSFs based on a given chandra observation. Ciao and marx need to be properly setup before running the script.

checkextension.py --> Script to be run after marxsimscript.py has been run to analyse the output. Use python marxsim_script.py -h to obtain the available command line arguments

HST

aperture_photometry.py --> Script to retrieve magnitudes, fluxes from a given ds9 region (it automatically reads the necessary keywords from the header to perform the corrections). A finite aperture correction is needed for small PSFs. Background subtraction is also possible (must be added a second line in the ds9 region file).

astro_corr.py --> Script to refine the astrometry of several HST images (more than one is possible, and the solution will be global to all of them) using the gaia catalogue. It uses tweakreg https://drizzlepac.readthedocs.io/en/latest/tweakreg.html.

MUSE

Line ratios

lineratio.py --> Script to perform the radio between two line flux maps

python lineratio.py -n NUMERATORS [NUMERATORS ...] [-en ENUMERATORS [ENUMERATORS ...]] -d DENOMINATOR [DENOMINATOR ...] [-ed EDENOMINATOR [EDENOMINATOR ...]] [-o [OUTDIR]] [-f [FILE] Where numeratos and denominators are a space-separed list of fits files. The files with an "e" prefix are the uncertainty maps. -o and -f control the output dir and file naming.

Reddening

deredden.py --> Script to deredden flux line maps, it needs as input the balmer decrement map (Halpha/Hbeta) and it will automatically localize the flux maps

dereddenmomcheva.py --> Script to deredden flux line maps (based on e.g. Momcheva et al. 2013 see the Appendix), it needs as input the hbeta and halpha directories and it will automatically look for the line flux maps and deredden them. ``` python dereddenmomcheva.py -a halphapath -b hbetapath -Rv 4.05 -i 2.86). It creates a map of E(B-V) and one with the uncertainty on E(B-V) Correct cube from Galactic extinction (both Rv and EBV are optional. If not given EBV is taken from the [Schlafly & Finkbeiner 2011](https://ui.adsabs.harvard.edu/abs/2011ApJ...737..103S/abstract) EBV map using the cube coordinates. python dereddencube.py cube -R Rv --ebvgal EBV EBV_err ```

Utils

Get the peak position and FWHM of a given ds9 region or entire image python get_image_peak.py <image> -r ds9regionfile.reg --psf [gaussian, moffat] --ext 1 --circular Cut images from an input region ds9 file. python cutfromregion.py <image or cube .fits? -r <ds9 region for the cut> -o <outname> (otherwise autonamed as cut+image)

Before | After :-------------------------:|:-------------------------: Sectors profile | Radial profile

imagestats.py --> Retrieve statistical information (min, max, mean) of a region or entire image by default imagestats.py image.fits -region ds9reigonfile.reg

extractradialprofiles.py images -n numberrectangles -r maxr (pixels) --offset -w

e.g. python extractradialprofiles.py images -n 4 -r 70 --offset 10 Extraction regions | Radial averaged profiles :-------------------------:|:-------------------------: Extraction regions | Radial profile

Coordinate adjustment

adjustcoordinates.py --> Runs a cross-correlation between an input reference image and the cube and estimates the offset needed to adjust the cube coordinates to the reference image (uses mpdaf estimatecoordinateoffset and adjustcoordinates) python adjust_coordinates.py cube.fits --hst <ref image, typically HST>

Diagnostics

H2diags.py --> Computes metallicity maps based on Pilyugin, L. S., & Grebel, E. K. 2016, MNRAS, 457, 3678. A config file is needed and optionally a BPT file to exclude non-H2 regions (currently defined as having an index >1). Otherwise the whole map is used python H2diags.py --config metalconfig.py -bpt lineratios/bptdiagramsv2/BPT2.fits or simply python H2diags.py --config metal_config.py

Spectral extraction

extract_spectrum.py --> Extracts a spectrum from a ds9 region file.

cleanskyres.py --> Uses ZAP to remove sky features. Make sure to mask your sources before hand! (with the -r option you can pass a ds9 with several regions to be masked, ideally you wan to mask bright and extended sources)

MAPPINGS

readmappings.py --> Script to obtain predicted line ratios from the mapping libraries (python readmappings.py (for instance V*b0001slines.txt Vb1slines.txt [MVQP]_b[0e]slines.txt [MVQ]*b10slines.txt Tb0001slines.txt Tb1s* T*b10slines.txt). The script will read the paths to the BPT diagrams from bptconfig.py file

readmappingsV.py --> Script to obtain predicted line ratios from the mapping V libraries. The script will read the paths to the BPT diagrams from bptconfig.py file

BPT Diagram

bpt_colored.py -> Classifies each pixel based on the IFU-improved BPT diagrams from Law+2021. Outputs fits and pngs of BPT diagrams, colored for better visualization

python bptcolored.py --config configfile (see an example in config_files)

|

Acknowledging

If these scripts were useful to you, we would greatly appreciate if you could cite the original paper for which these scripts were developed.

@article{2022A&A...666A.100G, author = {{G{\'u}rpide}, A. and {Parra}, M. and {Godet}, O. and {Contini}, T. and {Olive}, J. -F.}, title = "{MUSE spectroscopy of the ULX NGC 1313 X-1: A shock-ionised bubble, an X-ray photoionised nebula, and two supernova remnants}", journal = {\aap}, keywords = {instrumentation: spectrographs, stars: black holes, ISM: jets and outflows, stars: neutron, X-rays: binaries, accretion, accretion disks, Astrophysics - High Energy Astrophysical Phenomena}, year = 2022, month = oct, volume = {666}, eid = {A100}, pages = {A100}, doi = {10.1051/0004-6361/202142229}, archivePrefix = {arXiv}, eprint = {2201.09333}, primaryClass = {astro-ph.HE}, adsurl = {https://ui.adsabs.harvard.edu/abs/2022A&A...666A.100G}, adsnote = {Provided by the SAO/NASA Astrophysics Data System} }

Owner

  • Login: andresgur
  • Kind: user

GitHub Events

Total
  • Push event: 12
  • Create event: 1
Last Year
  • Push event: 12
  • Create event: 1