This section describes the uses of the class Q3DataCube, which is a backwards compatibility layer for older scripts, see the examples in the methods below.
The main use for the old API is to convert from zone to XY notation, and produce radial profiles.
Returns a tensor to transform from zone notation to spatial notation, with shape (zone, y, x). The normalization of the pixels can take into account the area of the zones or the luminosity weigth, using the following parameters:
Parameters : | extensive : boolean
dezonification : boolean
|
---|---|
Returns : | zoneToYX : 3-D array
|
Examples
To transform a cube named mycube, with axes (age, zone), into a cube with axes (age, y, x), one can perform the operation
>>> K = Q3DataCube(filename)
>>> zyx = K.getZoneToYXTensor()
>>> numpy.tensordot(mycube, zyx, (1, 0))
where 1 is the number of the zone axis in mycube, and 0 is the zone axis number in zyx.
Compute a tensor that transforms an array from zone binning notation to radial binning notation. Given the radial profile for this galaxy, this method calculates a tensor similar to the zonesToYXTensor, it transforms an image from spatial coordinates (x,y) to a radial profile.
Parameters : | d_r : float
rad_bin_ini : float, defaults to 0.0
rad_bin_fin : float, defaults to infinity
use_HLR_units : boolean
normalize_area : boolean
|
---|---|
Returns : | YXToRad : array, shape (rad. bins, y, x).
bin_R : array of float
bin_area : array of float
|
See also
Examples
>>> c = Q3DataCube(file)
>>> yxToRad, bins, unused = c.getYXToRadialBinsTensor(d_r=0.2)
c.LobnSD__yx is the luminosity surface desity in each pixel. Compute the radial profile of the average luminosity surface density.
>>> radProf__R = np.tensordot(Lobn_tot__yx, yxToRad, [(0,1),(1,2)])
>>> plot(bins, radProf__R)
Return a tensor that transforms an array from zone binning notation to radial binning notation. Given the radial profile for this galaxy, this method calculates a tensor similar to the zonesToYXTensor, it transforms an image from spatial coordinates (x,y) to a radial profile.
Parameters : | d_r : float
rad_bin_ini : float, defaults to 0.0
rad_bin_fin : float, defaults to infinity
use_HLR_units : boolean
extensive : boolean
dezonification : boolean
|
---|---|
Returns : | YXToRad : array, shape (y, x, zone)
bin_R : array of float
bin_area : array of float
|
See also
Examples
>>> c = Q3DataCube(file)
>>> zoneToRad, bins, unused = c.getZoneToRadialBinsTensor(d_r=0.2)
c.popx is luminosity fraction per zone. c.popx.shape is (ageBase, metBase, zone). Get the flux per unit area (?) for each zone.
>>> Lobn = c.popx / 100.0 * c.Lobs_norm
Total luminosity in each zone.
>>> Lobn_tot = Lobn.sum(axis=1).sum(axis=0)
>>> radProf = np.tensordot(Lobn_tot, zoneToRad, (1,1))
>>> plot(bins, radProf)
TODO: Deprecated findHLR_pix_CID(). Find the half light radius using the image at 5650 Angstrom. Using radial bins of 1 pixel, calculate the cumulative sum of luminosity. The HLR is the radius where the cum. sum reaches 50% of its peak value.
Returns : | HLR : float
|
---|
See also
setGeometry
Notes
This value should be close to $dfrac{HLR_{circular}}{sqrt{b/a}}$.