DiskMap#
- class diskmap.DiskMap(fitsfile: str | ndarray, pixscale: float, inclination: float, pos_angle: float, distance: float, image_type: str = 'polarized')[source]#
Bases:
object
Class for mapping a surface layer of a protoplanetary disk.
- Parameters:
fitsfile (str, np.ndarray) – Name of the FITS file with the scattered light image. Alternatively, a 2D
numpy
array with the image can be directly provided.pixscale (float) – Pixel scale of the image (arcsec per pixel).
inclination (float) – Inclination of the disk (deg). The convention is such that the near side of the disk is on the right side of the image when using an inclination between 0 and 90 deg and using a pos_angle of 0 deg. The near and far side of the disk mapping can be exchanged by using a minus sign for the inclination. To be certain about using the correct near and far side, it is best to check the _radius.fits file with a somewhat large inclination. The near side will show more strongly compressed radii compared to the far side of the disk.
pos_angle (float) – Position angle of the disk (deg). Defined in counterclockwise direction with respect to the vertical axis (i.e. east of north).
distance (float) – Distance between observer and star (pc).
image_type (str) – Image type (‘polarized’ or ‘total’). This parameter affects the output that will be stored. For example, the conversion from polarized to total intensity phase function is only done with image_type=’polarized’.
- Returns:
None
- Return type:
NoneType
Methods Summary
Function for deprojecting a disk surface based on the mapping of
map_disk()
.map_disk
(power_law[, radius, surface, ...])Function for mapping a scattered light image to a height profile (i.e.
phase_function
(radius, n_phase)Function for extracting the phase function.
r2_scaling
(r_max[, mask_planet])Function for correcting a scattered light image for the r^2 decrease of the stellar irradiation of the disk surface.
Function for creating a list with pixel values and creating a 2D array with the x and y pixel coordinates.
total_intensity
([pol_max])Function for estimating the (stellar irradiation corrected) total intensity image when
fitsfile
contains a polarized light image andimage_type='polarized'
.write_output
(filename)Function for writing the available results to FITS files.
Methods Documentation
- deproject_disk() None [source]#
Function for deprojecting a disk surface based on the mapping of
map_disk()
.- Returns:
None
- Return type:
NoneType
- map_disk(power_law: Tuple[float, float, float], radius: Tuple[float, float, int] = (1.0, 500.0, 100), surface: str = 'power-law', height_func: Callable[[ndarray], ndarray] | None = None, filename: str | None = None) None [source]#
Function for mapping a scattered light image to a height profile (i.e. height of the scattering surface as function of radius in the disk midplane) that is either parameterized with a power-law function or read from an input file (for example returned by a radiative transfer code).
- Parameters:
power_law (tuple(float, float, float)) – The height of the scattering surface is a power-law function, \(h(r) = a + b*(r/1\,\mathrm{au})^c\), with \(a\), \(b\), \(r\), and \(h(r)\) in au. The argument of
power_law
should be provided as(a, b, c)
. Set all values to zero for the mapping a geometrically flat disk, in which case only the inclination is used for the deprojection.radius (tuple(float, float, int)) – Radius points that are sampled, provided as (r_in, r_out, n_r), with
r_in
andr_out
in au. The outer radius should be set large enough such that a radius is sampled for each pixel in the field of view. To check if any NaNs are present, have a look at the _radius.fits output.surface (str) – Parameterization type for the disk surface (‘power-law’ or ‘function’ or ‘file’).
height_func (callable, None) – Function that returns the height of the scattering surface as a function of radius. The radii and returned height must be in au. Only used if surface=’function’.
filename (str, None) – Filename which contains the radius in au (first column) and the height of the disk surface in au (second column).
- Returns:
None
- Return type:
NoneType
- phase_function(radius: Tuple[float, float], n_phase: int)[source]#
Function for extracting the phase function. If
image_type='polarized'
, the polarized phase function is extracted and the total intensity phase function is estimated by assuming a bell-shaped degree of polarization. Ifimage_type='polarized'
, the total intensity phase function is extracted. The extracting is done on the r$^2$-scaled pixel values such that the phase function is not biased by irradiation effects. The phase functions are have been normalized by their maximum value.- Parameters:
radius (tuple(float, float)) – Inner and outer radius (au) between which pixels are selected for estimating the phase function.
n_phase (int) – Number of sampling points for the phase function between 0 and 180 deg.
- Returns:
None
- Return type:
NoneType
- r2_scaling(r_max: float, mask_planet: Tuple[int, int, float, float] | None = None) None [source]#
Function for correcting a scattered light image for the r^2 decrease of the stellar irradiation of the disk surface.
- Parameters:
r_max (float) – Maximum disk radius (au) for the r^2-scaling. Beyond this distance, a constant r^2-scaling is applied of value
r_max
.mask_planet (tuple(int, int, float, float), None) – Mask for a planet such that it will not be scaled. The tuple should have the following format:
(x_planet, y_planet, r_mask, scaling)
. Here,x_planet
andy_planet
are the central pixel of the planet position,r_mask
is the size (in pixels) of the planet signal, andscaling
is the scaling factor of the planet flux. This parameter is a bit experimental and typically not used by setting the argument toNone
.
- Returns:
None
- Return type:
NoneType
- sort_disk() Tuple[List[float64], ndarray] [source]#
Function for creating a list with pixel values and creating a 2D array with the x and y pixel coordinates.
- Returns:
None
- Return type:
NoneType
- total_intensity(pol_max: float = 1.0) None [source]#
Function for estimating the (stellar irradiation corrected) total intensity image when
fitsfile
contains a polarized light image andimage_type='polarized'
. A bell-shaped degree of polarized is assumed and effects of multiple scattering are ignored.- Parameters:
pol_max (float) – The peak of the bell-shaped degree of polarization, which effectively normalizes the estimated total intensity image.
- Returns:
None
- Return type:
NoneType