MapLines.tools.tools module

Utility routines used throughout MapLines for spectral modelling, data extraction from FITS cubes, diagnostic diagrams, region handling, and map manipulation.

MapLines.tools.tools.wfits_ext(name, hlist)[source]

Write a FITS HDUList to disk, removing an existing compressed file if needed.

Parameters:
  • name (str) – Output FITS file name.

  • hlist (astropy.io.fits.HDUList) – FITS HDUList to be written.

Return type:

None

Notes

If a compressed version name + '.gz' exists, it is removed before writing the new file.

MapLines.tools.tools.sycall(comand)[source]

Execute a shell command.

Parameters:

comand (str) – Shell command to be executed.

Return type:

None

MapLines.tools.tools.conv(xt, ke=2.5)[source]

Smooth a one-dimensional array with a Gaussian kernel.

Parameters:
  • xt (array-like) – Input vector or spectrum.

  • ke (float, optional) – Gaussian kernel width in pixels.

Returns:

Smoothed array.

Return type:

ndarray

MapLines.tools.tools.voigt(x, sigma=1.0, xo=0.0, A1=1.0, gam1=0.0)[source]

Evaluate a normalized Voigt line profile.

Parameters:
  • x (array-like) – Wavelength or coordinate grid.

  • sigma (float, optional) – Gaussian width of the Voigt profile.

  • xo (float, optional) – Central position of the profile.

  • A1 (float, optional) – Peak amplitude scaling.

  • gam1 (float, optional) – Lorentzian width parameter.

Returns:

Voigt profile evaluated on x.

Return type:

ndarray

MapLines.tools.tools.spow_law(x, A=1.0, alpha=0.0, xo=5100.0)[source]

Evaluate a power-law continuum model.

Parameters:
  • x (array-like) – Wavelength grid.

  • A (float, optional) – Amplitude at the reference wavelength xo.

  • alpha (float, optional) – Power-law index.

  • xo (float, optional) – Reference wavelength.

Returns:

Power-law continuum evaluated on x.

Return type:

ndarray

MapLines.tools.tools.lorentz(x, sigma=1.0, xo=0.0, A1=1.0)[source]

Evaluate a Lorentzian line profile.

Parameters:
  • x (array-like) – Wavelength or coordinate grid.

  • sigma (float, optional) – Profile width parameter.

  • xo (float, optional) – Central position of the profile.

  • A1 (float, optional) – Peak amplitude.

Returns:

Lorentzian profile evaluated on x.

Return type:

ndarray

MapLines.tools.tools.gauss_K(x, sigma=1.0, xo=0.0, A1=1.0, alp=0)[source]

Evaluate a skewed Gaussian line profile.

Parameters:
  • x (array-like) – Wavelength or coordinate grid.

  • sigma (float, optional) – Gaussian width parameter.

  • xo (float, optional) – Central position of the line.

  • A1 (float, optional) – Amplitude scaling.

  • alp (float, optional) – Skewness parameter.

Returns:

Skewed Gaussian profile evaluated on x.

Return type:

ndarray

MapLines.tools.tools.gauss_M(x, sigma=1.0, xo=0.0, A1=1.0)[source]

Evaluate a Gaussian line profile.

Parameters:
  • x (array-like) – Wavelength or coordinate grid.

  • sigma (float, optional) – Gaussian dispersion.

  • xo (float, optional) – Central position of the line.

  • A1 (float, optional) – Peak amplitude.

Returns:

Gaussian profile evaluated on x.

Return type:

ndarray

MapLines.tools.tools.opticFeII(x, data, sigma=1.0, xo=0.0, A1=1.0)[source]

Evaluate an optical FeII template model.

Parameters:
  • x (array-like) – Wavelength grid.

  • data (ndarray) – Template array containing wavelength and flux columns.

  • sigma (float, optional) – Smoothing width applied to the template.

  • xo (float, optional) – Wavelength shift applied to the template.

  • A1 (float, optional) – Amplitude scaling factor.

Returns:

Interpolated and smoothed FeII template spectrum.

Return type:

ndarray

Notes

The implementation follows the optical FeII template approach referenced in Kovacevic et al. (2010). :contentReference[oaicite:2]{index=2}

MapLines.tools.tools.step_vect(fluxi, sp=20, pst=True, sigma=10)[source]

Estimate a local noise or step-like uncertainty vector from a spectrum.

Parameters:
  • fluxi (array-like) – Input spectrum.

  • sp (int, optional) – Window size used to estimate the local scatter.

  • pst (bool, optional) – If True, use percentile-based robust estimation. If False, use the standard deviation.

  • sigma (float, optional) – Smoothing width used to remove large-scale structure before estimating local scatter.

Returns:

Estimated uncertainty vector.

Return type:

ndarray

MapLines.tools.tools.read_config_file(file)[source]

Read a YAML configuration file.

Parameters:

file (str) – Path to the YAML file.

Returns:

Parsed configuration dictionary, or None if the file could not be read.

Return type:

dict or None

MapLines.tools.tools.get_priorsvalues(filename)[source]

Parse the line-model configuration file and assemble fitting priors.

Parameters:

filename (str) – Path to the YAML configuration file describing the emission-line setup and priors.

Returns:

Tuple containing the prior dictionary, number of lines, continuum windows, initial values, lower and upper limits, line names, wavelengths, colors, scaling relations, and parameter labels.

Return type:

tuple

Notes

This function builds the internal parameter bookkeeping used by MapLines.tools.line_fit and MapLines.tools.models. It reads the lines, continum and priors sections from the YAML file. :contentReference[oaicite:3]{index=3}

MapLines.tools.tools.get_oneDspectra(file1, flux_f=1, erft=0, input_format='SDSS', error_c=True)[source]

Read a one-dimensional spectrum from several supported formats.

Parameters:
  • file1 (str) – Input file name.

  • flux_f (float, optional) – Global multiplicative flux factor.

  • erft (float, optional) – Additional multiplicative scaling applied to the error vector.

  • input_format ({'TableFits', 'SDSS', 'IrafFits', 'CSV', 'ASCII'}, optional) – Input spectrum format.

  • error_c (bool, optional) – If True, also read or estimate the uncertainty vector.

Returns:

  • pdl_data (ndarray) – Flux array.

  • pdl_dataE (ndarray) – Error array.

  • wave (ndarray) – Wavelength array.

Notes

For SDSS spectra, the routine converts LOGLAM to linear wavelength and IVAR to uncertainties. :contentReference[oaicite:4]{index=4}

MapLines.tools.tools.get_cubespectra(file1, file3, flux_f=1, erft=0, error_c=True)[source]

Read a spectral cube, associated uncertainty cube, and spatial mask.

Parameters:
  • file1 (str) – Input spectral cube.

  • file3 (str) – Mask file. If it does not exist, a full-valid mask is created.

  • flux_f (float, optional) – Global multiplicative flux factor.

  • erft (float, optional) – Additional multiplicative scaling applied to the error cube.

  • error_c (bool, optional) – If True, read or estimate the error cube.

Returns:

  • pdl_cube (ndarray) – Flux cube with shape (nz, nx, ny).

  • pdl_cubeE (ndarray or None) – Error cube.

  • mask (ndarray) – Spatial mask.

  • wave (ndarray) – Wavelength vector.

  • hdr (astropy.io.fits.Header) – FITS header of the cube.

Notes

The function attempts multiple common FITS extension names such as FLUX, SCI, ERROR, ERR and IVAR. :contentReference[oaicite:5]{index=5}

MapLines.tools.tools.get_fluxline(file, path='', ind1=3, ind2=7, ind3=4, ind4=9, lo=6564.632, zt=0.0, val0=0)[source]

Derive line flux, velocity, dispersion, and equivalent width maps.

Parameters:
  • file (str) – FITS file containing parameter maps.

  • path (str, optional) – Directory containing the file.

  • ind1 (int, optional) – Indices of amplitude, FWHM, velocity, and continuum maps.

  • ind2 (int, optional) – Indices of amplitude, FWHM, velocity, and continuum maps.

  • ind3 (int, optional) – Indices of amplitude, FWHM, velocity, and continuum maps.

  • ind4 (int, optional) – Indices of amplitude, FWHM, velocity, and continuum maps.

  • lo (float, optional) – Rest wavelength of the emission line in Angstrom.

  • zt (float, optional) – Redshift correction applied to the velocity field.

  • val0 (float, optional) – Sentinel velocity value used to identify invalid pixels.

Returns:

  • flux (ndarray) – Integrated line-flux map.

  • vel (ndarray) – Velocity map.

  • sigma (ndarray) – Velocity-dispersion map.

  • ew (ndarray or None) – Equivalent-width map if a continuum map is available.

MapLines.tools.tools.extract_spec(filename, dir_cube_m='', ra='', dec='', rad=1.5, sig=10, smoth=False, avgra=False, head=0)[source]

Extract a 1D spectrum from a circular aperture in a spectral cube.

Parameters:
  • filename (str) – Cube file name.

  • dir_cube_m (str, optional) – Directory containing the cube.

  • ra (str, optional) – Sky coordinates of the aperture center. If not provided, the cube center is used.

  • dec (str, optional) – Sky coordinates of the aperture center. If not provided, the cube center is used.

  • rad (float, optional) – Aperture radius in arcseconds.

  • sig (float, optional) – Smoothing width applied if smoth=True.

  • smoth (bool, optional) – If True, smooth the extracted spectrum.

  • avgra (bool, optional) – If True, average the flux inside the aperture. Otherwise sum it.

  • head (int, optional) – FITS HDU index to read.

Returns:

  • wave_f (ndarray) – Wavelength vector.

  • single_T (ndarray) – Extracted spectrum.

MapLines.tools.tools.get_apertures(file)[source]

Read circular and box apertures from a DS9 region file.

Parameters:

file (str) – DS9 region file.

Returns:

Arrays containing RA, Dec, radius, box sizes, position angles, colors, names, and aperture types.

Return type:

tuple of ndarray

MapLines.tools.tools.get_segment(reg_dir='./', reg_name='test.reg')[source]

Read DS9 segment regions from a region file.

Parameters:
  • reg_dir (str, optional) – Directory containing the region file.

  • reg_name (str, optional) – Region file name.

Returns:

raL, decL, colr, widt, namet – Segment coordinates, colors, line widths, and labels.

Return type:

tuple

MapLines.tools.tools.extract_segment1d(file, path='', wcs=None, reg_dir='./', reg_name='test.reg', z=0, rad=1.5, lA1=6450.0, lA2=6850.0, plot_t=False, sigT=4, cosmetic=False, hdu=0, nzeros=False)[source]

Extract 1D spectra along DS9 segment regions from a spectral cube.

Parameters:
  • file (str) – Input cube file.

  • path (str, optional) – Directory containing the cube.

  • wcs (astropy.wcs.WCS, optional) – WCS object. If not provided, it is built from the FITS header.

  • reg_dir (str, optional) – DS9 region file location.

  • reg_name (str, optional) – DS9 region file location.

  • z (float, optional) – Redshift used to transform wavelengths to rest frame.

  • rad (float, optional) – Circular extraction radius around each segment node.

  • lA1 (float, optional) – Wavelength range to extract.

  • lA2 (float, optional) – Wavelength range to extract.

  • plot_t (bool, optional) – If True, display the extracted pseudo-slit.

  • sigT (float, optional) – Smoothing width used when cosmetic=True.

  • cosmetic (bool, optional) – If True, smooth the extracted spectra for display.

  • hdu (int, optional) – FITS HDU index.

  • nzeros (bool, optional) – If True, replace negative values with NaN before extraction.

Returns:

Extracted spectra, wavelength array, spatial scale, geometry values, header, colors, widths, names, and segment labels.

Return type:

tuple

MapLines.tools.tools.extract_regs(map, hdr, reg_file='file.reg', avgra=False)[source]

Extract values from multiple DS9 apertures on a 2D map.

Parameters:
  • map (ndarray) – Input 2D map.

  • hdr (astropy.io.fits.Header) – FITS header containing the spatial WCS.

  • reg_file (str, optional) – DS9 region file.

  • avgra (bool, optional) – If True, average values in each aperture. Otherwise sum them.

Returns:

Extracted values for all apertures.

Return type:

ndarray

MapLines.tools.tools.extract_single_reg(map, hdr, ra='', dec='', rad=1.5, pix=0.35, avgra=False)[source]

Extract the value of a single circular aperture from a 2D map.

Parameters:
  • map (ndarray) – Input 2D image.

  • hdr (astropy.io.fits.Header) – FITS header containing WCS information.

  • ra (str) – Aperture center coordinates.

  • dec (str) – Aperture center coordinates.

  • rad (float, optional) – Aperture radius in arcseconds.

  • pix (float, optional) – Pixel scale in arcseconds per pixel.

  • avgra (bool, optional) – If True, compute the average value. Otherwise compute the sum.

Returns:

Aperture-integrated or aperture-averaged value.

Return type:

float

MapLines.tools.tools.extract_segment_val(flux, hdr, dpix, reg_dir='./', reg_name='test.reg')[source]

Extract values along DS9 segment regions from a 2D map.

Parameters:
  • flux (ndarray) – Input 2D map.

  • hdr (astropy.io.fits.Header) – FITS header containing WCS information.

  • dpix (float) – Spatial scale in arcseconds per pixel.

  • reg_dir (str, optional) – DS9 region file location.

  • reg_name (str, optional) – DS9 region file location.

Returns:

Extracted 1D profiles along each segment.

Return type:

list of ndarray

MapLines.tools.tools.extract_segment(file, path='', reg_dir='./', reg_name='test.reg', z=0, lA1=6450.0, lA2=6850.0, plot_t=False, sigT=4, cosmetic=False, hdu=0)[source]

Extract pseudo-slit spectra along DS9 segment regions from a cube.

Parameters:
  • file (str) – Input cube file.

  • path (str, optional) – Directory containing the cube.

  • reg_dir (str, optional) – DS9 region file location.

  • reg_name (str, optional) – DS9 region file location.

  • z (float, optional) – Redshift used to shift the wavelength axis to rest frame.

  • lA1 (float, optional) – Wavelength interval to extract.

  • lA2 (float, optional) – Wavelength interval to extract.

  • plot_t (bool, optional) – If True, display the extracted pseudo-slit.

  • sigT (float, optional) – Smoothing width used for cosmetic plotting.

  • cosmetic (bool, optional) – If True, smooth extracted spectra.

  • hdu (int, optional) – FITS HDU index.

Returns:

Pseudo-slit spectra, wavelength axis, pixel scale, geometric metadata, header, colors, widths, and names.

Return type:

tuple

MapLines.tools.tools.extract_line_val(flux, hdr, dpix, reg_dir='./', reg_name='test.reg')[source]

Extract values along DS9 line regions from a 2D map.

Parameters:
  • flux (ndarray) – Input 2D map.

  • hdr (astropy.io.fits.Header) – FITS header with WCS information.

  • dpix (float) – Pixel scale in arcseconds.

  • reg_dir (str, optional) – DS9 region file location.

  • reg_name (str, optional) – DS9 region file location.

Returns:

Profiles extracted along each line region.

Return type:

list of ndarray

MapLines.tools.tools.extract_line(file, reg_dir='./', reg_name='test.reg', z=0, lA1=6450.0, lA2=6850.0, plot_t=False, sigT=4, cosmetic=False)[source]

Extract pseudo-slit spectra along DS9 line regions from a cube.

Parameters:
  • file (str) – Input cube file.

  • reg_dir (str, optional) – DS9 region file location.

  • reg_name (str, optional) – DS9 region file location.

  • z (float, optional) – Redshift used to shift the wavelength axis to rest frame.

  • lA1 (float, optional) – Wavelength interval to extract.

  • lA2 (float, optional) – Wavelength interval to extract.

  • plot_t (bool, optional) – If True, display the extracted pseudo-slit.

  • sigT (float, optional) – Smoothing width used for cosmetic display.

  • cosmetic (bool, optional) – If True, smooth extracted spectra.

Returns:

Extracted pseudo-slit spectra, wavelength axis, pixel scale, geometric metadata, and FITS header.

Return type:

tuple

MapLines.tools.tools.get_line(reg_dir='./', reg_name='test.reg')[source]

Read DS9 line regions from a region file.

Parameters:
  • reg_dir (str, optional) – Directory containing the region file.

  • reg_name (str, optional) – Region file name.

Returns:

Arrays containing line start/end coordinates, colors, and labels.

Return type:

tuple of ndarray

MapLines.tools.tools.bpt(wha, niiha, oiiihb, ret=4, agn=3, sf=1, inte=2.5, comp=5, save=False, path='', name='BPT_map', hdr=None)[source]

Build a BPT classification map.

Parameters:
  • wha (ndarray) – Halpha equivalent-width map.

  • niiha (ndarray) – Log([NII]/Halpha) map.

  • oiiihb (ndarray) – Log([OIII]/Hbeta) map.

  • ret (float, optional) – Numeric labels assigned to retired, AGN, star-forming, intermediate, and composite classes.

  • agn (float, optional) – Numeric labels assigned to retired, AGN, star-forming, intermediate, and composite classes.

  • sf (float, optional) – Numeric labels assigned to retired, AGN, star-forming, intermediate, and composite classes.

  • inte (float, optional) – Numeric labels assigned to retired, AGN, star-forming, intermediate, and composite classes.

  • comp (float, optional) – Numeric labels assigned to retired, AGN, star-forming, intermediate, and composite classes.

  • save (bool, optional) – If True, save the classification map to a FITS file.

  • path (str, optional) – Output directory.

  • name (str, optional) – Output base name.

  • hdr (astropy.io.fits.Header, optional) – Header used when saving the FITS file.

Returns:

BPT classification map.

Return type:

ndarray

MapLines.tools.tools.whan(wha, niiha, agn=4, sf=1.7, wagn=3, ret=1, save=False, path='', name='WHAN_map', hdr=None)[source]

Build a WHAN classification map.

Parameters:
  • wha (ndarray) – Halpha equivalent-width map.

  • niiha (ndarray) – Log([NII]/Halpha) map.

  • agn (float, optional) – Numeric labels assigned to strong AGN, star-forming, weak AGN, and retired classes.

  • sf (float, optional) – Numeric labels assigned to strong AGN, star-forming, weak AGN, and retired classes.

  • wagn (float, optional) – Numeric labels assigned to strong AGN, star-forming, weak AGN, and retired classes.

  • ret (float, optional) – Numeric labels assigned to strong AGN, star-forming, weak AGN, and retired classes.

  • save (bool, optional) – If True, save the classification map to a FITS file.

  • path (str, optional) – Output directory.

  • name (str, optional) – Output base name.

  • hdr (astropy.io.fits.Header, optional) – Header used when saving the FITS file.

Returns:

WHAN classification map.

Return type:

ndarray

MapLines.tools.tools.whad(logew, logsig, agn=5, sf=3, wagn=4, ret=2, unk=1, save=False, path='', name='WHAD_map', hdr=None)[source]

Build a WHAD classification map.

Parameters:
  • logew (ndarray) – Logarithmic equivalent-width map.

  • logsig (ndarray) – Logarithmic velocity-dispersion map.

  • agn (float, optional) – Numeric labels assigned to AGN, star-forming, weak AGN, retired, and uncertain classes.

  • sf (float, optional) – Numeric labels assigned to AGN, star-forming, weak AGN, retired, and uncertain classes.

  • wagn (float, optional) – Numeric labels assigned to AGN, star-forming, weak AGN, retired, and uncertain classes.

  • ret (float, optional) – Numeric labels assigned to AGN, star-forming, weak AGN, retired, and uncertain classes.

  • unk (float, optional) – Numeric labels assigned to AGN, star-forming, weak AGN, retired, and uncertain classes.

  • save (bool, optional) – If True, save the classification map to a FITS file.

  • path (str, optional) – Output directory.

  • name (str, optional) – Output base name.

  • hdr (astropy.io.fits.Header, optional) – Header used when saving the FITS file.

Returns:

WHAD classification map.

Return type:

ndarray

MapLines.tools.tools.get_map_to_stl(map, nameid='', path_out='', sig=2, smoth=False, pval=27, mval=0, border=False, logP=False, ofsval=-1, maxval=None, minval=None)[source]

Convert a 2D map into a normalized STL surface.

Parameters:
  • map (ndarray) – Input 2D map.

  • nameid (str, optional) – Output STL base name.

  • path_out (str, optional) – Output directory.

  • sig (float, optional) – Smoothing width used when smoth=True.

  • smoth (bool, optional) – If True, smooth the map before STL generation.

  • pval (float, optional) – Linear rescaling parameters applied before STL export.

  • mval (float, optional) – Linear rescaling parameters applied before STL export.

  • border (bool, optional) – If True, zero the border pixels.

  • logP (bool, optional) – If True, apply logarithmic scaling before normalization.

  • ofsval (float, optional) – Floor value used before smoothing.

  • maxval (float, optional) – Manual normalization bounds.

  • minval (float, optional) – Manual normalization bounds.

Return type:

None

MapLines.tools.tools.get_maps_to_stl(file_in, nameid='', path_in='', path_out='', sig=2, smoth=False, pval=27, mval=0, border=False)[source]

Convert all parameter maps stored in a FITS file into STL surfaces.

Parameters:
  • file_in (str) – Input FITS file containing parameter maps.

  • nameid (str, optional) – Suffix appended to the STL names.

  • path_in (str, optional) – Input directory.

  • path_out (str, optional) – Output directory.

  • sig (float, optional) – Smoothing width used when smoth=True.

  • smoth (bool, optional) – If True, smooth the maps before STL generation.

  • pval (float, optional) – Linear rescaling parameters.

  • mval (float, optional) – Linear rescaling parameters.

  • border (bool, optional) – If True, zero the border pixels.

Return type:

None

MapLines.tools.tools.map_to_stl(map, file_out, path_out='')[source]

Convert a 2D array into an STL triangular mesh.

Parameters:
  • map (ndarray) – Input 2D map.

  • file_out (str) – Output STL base name.

  • path_out (str, optional) – Output directory.

Return type:

None

MapLines.tools.tools.jwst_nirspecIFU_MJy2erg(file, file_out, zt=0, path='', path_out='')[source]

Convert a JWST/NIRSpec IFU cube from MJy/sr-like units to 1e-17 erg/s/cm^2/Angstrom units.

Parameters:
  • file (str) – Input FITS cube.

  • file_out (str) – Output FITS cube.

  • zt (float, optional) – Redshift used to shift the spectral axis to rest frame.

  • path (str, optional) – Input directory.

  • path_out (str, optional) – Output directory.

Return type:

None

Notes

The routine updates the output header to use Angstrom in the spectral axis and E-17erg/s/cm^2/Angstrom as brightness unit. :contentReference[oaicite:6]{index=6}

MapLines.tools.tools.A_l(Rv, l)[source]

Evaluate the Cardelli, Clayton, and Mathis (1989) extinction law.

Parameters:
  • Rv (float) – Total-to-selective extinction ratio.

  • l (array-like) – Wavelength array in Angstrom.

Returns:

Extinction curve A(lambda)/A(V).

Return type:

ndarray

MapLines.tools.tools.get_headervals(hdr, keymatch='HaBroad')[source]

Extract header keywords whose values match a given component name.

Parameters:
  • hdr (astropy.io.fits.Header) – FITS header containing parameter labels.

  • keymatch (str, optional) – Substring used to identify the desired component.

Returns:

  • vals (dict) – Dictionary of matching header keywords and values.

  • nkeys (list of str) – Matching keyword names.

MapLines.tools.tools.get_map_component_index(hdr, keymatch='HaBroad')[source]

Find the amplitude, velocity, and FWHM indices of a map component.

Parameters:
  • hdr (astropy.io.fits.Header) – FITS header containing VAL_* parameter labels.

  • keymatch (str, optional) – Component name to search for.

Returns:

indx_amp, indx_vel, indx_fwh – Arrays with indices of amplitude, velocity, and FWHM maps.

Return type:

ndarray

MapLines.tools.tools.get_map_param(hdr, keymatch='Noise')[source]

Return the index of a single parameter map identified from the header.

Parameters:
  • hdr (astropy.io.fits.Header) – FITS header containing VAL_* labels.

  • keymatch (str, optional) – Parameter name to search for.

Returns:

Index of the matching parameter map.

Return type:

int

MapLines.tools.tools.rescale_mapmodel(mapT, name, path_out='./', modelbasename='psf_NAME', sigmat=0.2, verbose=False)[source]

Rescale, smooth, and export a 2D model map as FITS and STL products.

Parameters:
  • mapT (ndarray) – Input 2D map.

  • name (str) – Object name used in the output file names.

  • path_out (str, optional) – Output directory.

  • modelbasename (str, optional) – Base output name containing the token NAME.

  • sigmat (float, optional) – Smoothing width applied to the map.

  • verbose (bool, optional) – If True, print normalization diagnostics.

Return type:

None

MapLines.tools.tools.get_mapmodel(name, path_map='./', path_out='./', basename='NAME-2iter_param_V2_HaNII.fits.gz', psfmbasename='psf_NAME', sigmat=0.2, lo=6564.632, verbose=False, pow_cr=False, set_am=False, AmpT=2)[source]

Build a rescaled broad-line model map from fitted parameter products.

Parameters:
  • name (str) – Object identifier used to replace NAME in file templates.

  • path_map (str, optional) – Directory containing the fitted parameter cubes.

  • path_out (str, optional) – Output directory.

  • basename (str, optional) – Input FITS file template.

  • psfmbasename (str, optional) – Output model base name.

  • sigmat (float, optional) – Smoothing width applied to the final map.

  • lo (float, optional) – Rest wavelength of the target emission line.

  • verbose (bool, optional) – If True, print normalization diagnostics.

  • pow_cr (bool, optional) – If True, use the power-law continuum to mask unreliable spaxels.

  • set_am (bool, optional) – If True, use the broad-line amplitude threshold to mask spaxels.

  • AmpT (float, optional) – Broad-line amplitude threshold used when set_am=True.

Return type:

None

Notes

The routine combines component maps identified in the FITS header, builds integrated flux maps, masks unreliable spaxels, rescales the result, and exports model products.