Prints STARLIGHT runs contained in synthesis dataset.
Parameters : | synthesisFile : string
|
---|
See also
Prints bases used in STARLIGHT runs contained in synthesis dataset..
Parameters : | synthesisFile : string
|
---|
Prints qbick runs contained in synthesis dataset.
Parameters : | synthesisFile : string
|
---|
Interface to CALIFA HDF5 synthesis dataset.
Identifier of the base used in the synthesis.
Identifier of the qbick run used in the synthesis.
Version of PyCASSO used to import the synthesis.
Version of qbick.
NED name of the galaxy.
CALIFA name of the galaxy.
Number of ages in base.
Number of metallicities in base.
Number of elements in base.
Number of pixels in X direction.
Number of pixels in Y direction.
Number of voronoi zones.
Number of wavelengths.
X position of the galaxy center.
Y position of the galaxy center.
Half light radius in pixels.
Half light radius in parsecs.
Distance to galaxy in megaparsecs.
Pixel scale in parsecs.
Pixel scale in arcseconds.
Half light radius in pixels.
\(A_\lambda / A_V\). Used in reddening calculations.
Initial wavelength of spectra, in angstroms.
Final wavelength of spectra, in angstroms.
Wavelength step, in angstroms.
Dictionary containing the masterlist data for this galaxy.
Dictionary containing all synthesis, base and qbick keywords. Keys are uppercase.
Dictionary containing additional synthesis data for integrated spectra. Keys are uppercase.
Position angle of the ellipse used in radial profiles.
Ellipticity \(b/a\) of the ellipse used in radial profiles.
Distance of each pixel to the galaxy center.
- Units: [pixel]
- Shape: (N_y, N_x)
Angle of each pixel relative to the semimajor axis, corrected for a disk perspective. See pa and ba. Ranges from \(-\pi\) to \(+\pi\).
- Units: [radians]
- Shape: (N_y, N_x)
Area in pixels of each zone.
- Units: [pixel]
- Shape: (N_Zone)
Area in square parsecs of each zone.
- Units: :mqth:`[pc^2]`
- Shape: (N_y, N_x)
Fill value used when building images from zones.
Load a galaxy from a run, and update the metadata.
Parameters : | runId : string
TODO: test LoadGalaxy() : |
---|
Ages of the base.
- Units: \([Yr]\)
- Shape: (N_zone)
Metalicities of the base.
- Units: dimensionless
- Shape: (N_zone)
A recarray (x, y) containing the position of the center of each zone.
- Units: pixel
- Shape: (N_zone)
Signal at wavelength WINDOWSN.
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (N_y, N_x)
TODO: Add description of cubes.
S/N at wavelength WINDOWSN.
- Units: dimensionless
- Shape: (N_y, N_x)
Image at wavelength WINDOWSN (quick, not masked).
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (N_y, N_x)
TODO: Add description of qNoiseUnmasked.
TODO: Add description of qPipeNoise.
Voronoi/segmentation zones (bins).
- Units: index
- Shape: (N_y, N_x)
S/N in Voronoi zones.
- Units: dimensionless
- Shape: (N_y, N_x)
Noise (RMS) in Voronoi zones.
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (N_y, N_x)
Ratio of flags in window at wavelength WINDOWSN
- Units: \([\%]\)
- Shape: (N_y, N_x)
S/N in Voronoi zones (unresampled, beta).
- Units: dimensionless
- Shape: (N_y, N_x)
Noise (RMS) in Voronoi zones (unresampled, beta).
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (N_y, N_x)
Voronoi program output S/N.
- Units: dimensionless
- Shape: (N_y, N_x)
Noise image derived from formal errors (unresampled).
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (N_y, N_x)
Noise image derived from formal errors in Voronoi zones (unresampled).
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (N_y, N_x)
TODO: Add description of qSpatialMask.
TODO: Add description of qSnMask.
TODO: Add description of qFilledMask.
Boolean image mask used for data.
- Units: bool
- Shape: (N_y, N_x)
Flux in norm window for output spectra, in voronoi zones.
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (Nl_obs, N_zone)
Observed flux (input spectra for the synthesis), in voronoi zones.
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (Nl_obs, N_zone)
Error in observed spetra, in voronoi zones.
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (Nl_obs, N_zone)
Flagged spaxels, in voronoi zones.
FIXME: describe flags.
- Units: dimensionless
- Shape: (Nl_obs, N_zone)
Observed flux (input spectra for the synthesis), in integrated spectrum.
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (Nl_obs)
Error in integrated observed spetrum.
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (Nl_obs)
Flagged spaxels, in integrated spectrum.
FIXME: describe flags.
- Units: dimensionless
- Shape: (Nl_obs)
Fraction of the initial stellar mass for a given population that is still trapped inside stars.
- Units: dimensionless
- Shape: (N_age, N_met)
TODO: Add description of cubes.
Light fractions for each population, in voronoi zones.
- Units: \([\%]\)
- Shape: (N_age, N_met, N_zone)
Current mass fractions for each population, in voronoi zones.
- Units: \([\%]\)
- Shape: (N_age, N_met, N_zone)
Initial mass fractions for each population, in voronoi zones.
- Units: \([\%]\)
- Shape: (N_age, N_met, N_zone)
Extinction for each population, in voronoi zones.
- Units: \([mag]\)
- Shape: (N_age, N_met, N_zone)
TODO: Add description of popexAV_flag.
TODO: Add description of cubes.
TODO: Add description of cubes.
TODO: Add description of cubes.
TODO: Add description of cubes.
Luminosity density in norm window, in voronoi zones.
- Units: \([L_\odot/\overset{\circ}{A}]\)
- Shape: (N_zone)
Initial mass for each population, in voronoi zones.
- Units: \([M_\odot]\)
- Shape: (N_zone)
Current mass for each population, in voronoi zones.
- Units: \([M_\odot]\)
- Shape: (N_zone)
Extinction by dust, in voronoi zones.
- Units: \([mag]\)
- Shape: (N_zone)
Velocity displacement, in voronoi zones.
- Units: \([km/s]\)
- Shape: (N_zone)
Velocity dispersion, in voronoi zones.
- Units: \([km/s]\)
- Shape: (N_zone)
Mean absolute relative deviation, in percent, only for the Nl_eff points actually used in the synthesis.
- Units: \([\%]\)
- Shape: (N_zone)
Best single SSP fit, to use in SSP_*, in voronoi zones.
FIXME: index_Best_SSP is j or (age,met)?
- Units: index
- Shape: (N_zone)
Number of OK wavelengths in input spectrum, in voronoi zones.
- Units: dimensionless
- Shape: (N_zone)
Number of wavelengths actually used in spectral fit, in voronoi zones.
- Units: dimensionless
- Shape: (N_zone)
Number of wavelengths clipped, in voronoi zones.
- Units: dimensionless
- Shape: (N_zone)
Number of steps in spectral fitting, in voronoi zones.
- Units: dimensionless
- Shape: (N_zone)
\(\chi^2 / Nl_{eff}\) of the fit, in voronoi zones.
- Units: dimensionless
- Shape: (N_zone)
Total \(\chi^2\) of the fit, in voronoi zones.
- Units: dimensionless
- Shape: (N_zone)
\(\chi^2\) of the optical fit, in voronoi zones.
- Units: dimensionless
- Shape: (N_zone)
\(\chi^2\) of the far-IR fit, in voronoi zones.
- Units: dimensionless
- Shape: (N_zone)
\(\chi^2\) of the QH-related fit in voronoi zones.
- Units: dimensionless
- Shape: (N_zone)
\(\chi^2\) of the photometric fit, in voronoi zones.
- Units: dimensionless
- Shape: (N_zone)
Synthetic spectra, in voronoi zones.
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (Nl_obs, N_zone)
Spatially resolved extinction by dust.
- Units: \([mag]\)
- Shape: (N_y, N_x)
Spatially resolved “dereddened” luminosity surface density of each population in normalization window.
- Units: \([L_\odot / pc^2]\)
- Shape: (N_age, N_met, N_y, N_x)
“Dereddened” luminosity surface density of each population in normalization window.
- Units: \([L_\odot / pc^2]\)
- Shape: (N_y, N_x)
“Dereddened” luminosity of each population in normalization window, in voronoi zones.
- Units: \([L_\odot]\)
- Shape: (N_age, N_met, N_zone)
“Dereddened” luminosity in normalization window, in voronoi zones.
- Units: \([L_\odot]\)
- Shape: (N_zone)
Spatially resolved “dereddened” mass to light ratio.
- Units: \([M_\odot / L_\odot]\)
- Shape: (N_y, N_x)
Spatially resolved luminosity surface density of each population in normalization window.
- Units: \([L_\odot / pc^2]\)
- Shape: (N_age, N_met, N_y, N_x)
Luminosity surface density of each population in normalization window.
- Units: \([L_\odot / pc^2]\)
- Shape: (N_y, N_x)
Luminosity of each population in normalization window, in voronoi zones.
- Units: \([L_\odot]\)
- Shape: (N_age, N_met, N_zone)
Luminosity in normalization window, in voronoi zones.
- Units: \([L_\odot]\)
- Shape: (N_zone)
Spatially resolved mass to light ratio.
- Units: \([M_\odot / L_\odot]\)
- Shape: (N_y, N_x)
Spatially resolved current mass surface density of each population.
- Units: \([M_\odot / pc^2]\)
- Shape: (N_age, N_met, N_y, N_x)
Spatially resolved current mass surface density.
- Units: \([M_\odot / pc^2]\)
- Shape: (N_y, N_x)
Current mass of each population, in voronoi zones.
- Units: \([M_\odot]\)
- Shape: (N_age, N_met, N_zone)
Current mass, in voronoi zones.
- Units: \([M_\odot]\)
- Shape: (N_age, N_met, N_zone)
Spatially resolved initial mass surface density of each population.
- Units: \([M_\odot / pc^2]\)
- Shape: (N_age, N_met, N_y, N_x)
Spatially resolved initial mass surface density.
- Units: \([M_\odot / pc^2]\)
- Shape: (N_y, N_x)
Initial mass of each population, in voronoi zones.
- Units: \([M_\odot]\)
- Shape: (N_age, N_met, N_zone)
Initial mass, in voronoi zones.
- Units: \([M_\odot]\)
- Shape: (N_age, N_met, N_zone)
Spatially resolved, flux-weighted average metallicity.
- Units: dimensionless
- Shape: (N_y, N_x)
Flux-weighted average metallicity, in voronoi zones.
- Units: dimensionless
- Shape: (N_zone)
Spatially resolved, mass-weighted average metallicity.
- Units: dimensionless
- Shape: (N_y, N_x)
Mass-weighted average metallicity, in voronoi zones.
- Units: dimensionless
- Shape: (N_zone)
From Cid @ 26/05/2012: Here’s my request for pycasso reader: That it defines a new figure of merit analogous to adev, but which uses the synthetic flux in the denominator instead of the observed one. This is the adevS__z thing defined below in awful python. Why? Well, despite all our care there are still some non-flagged pixels with very low fluxes, which screws up adev, and this alternative definition fixes it.
Original code:
>>> adevS__z = np.zeros((self.nZones))
>>> for i_z in np.arange(self.nZones):
>>> _a = np.abs(self.f_obs[:,i_z] - self.f_syn[:,i_z]) / self.f_syn[:,i_z]
>>> _b = _a[self.f_wei[:,i_z] > 0]
>>> adevS__z[i_z] = 100.0 * _b.mean()
>>> return adevS__z
Returns : | aDevS : array of length (nZones) |
---|
Mean absolute relative deviation, in percent, only for the Nl_eff points actually used in the synthesis.
- Units: \([\%]\)
- Shape: (N_y, N_x)
Return ageBase as a row matrix to simplify multiplications.
Parameters : | n : integer
|
---|---|
Returns : | ageBaseNd : n-D array
|
See also
Area, in pixels, of the convex hull of qMask. This is the area to use when dealing with qConvexHull.
Aarea, in pixels, of the masked regions. This is the area to use when dealing with qHollowPixels.
Spatially resolved, flux-weighted average log. age.
- Units: \([\log Gyr]\)
- Shape: (N_y, N_x)
Flux-weighted average log. age, in voronoi zones.
- Units: \([\log Gyr]\)
- Shape: (N_zone)
Spatially resolved, mass-weighted average log. age.
- Units: \([\log Gyr]\)
- Shape: (N_y, N_x)
Mass-weighted average log. age, in voronoi zones.
- Units: \([\log Gyr]\)
- Shape: (N_zone)
Attributes attached to this object
Calculate the azimuthal profile of a property. The last two dimensions of prop must be of legth N_y and N_x.
Parameters : | prop : array
bin_a : array
bin_r : array
rad_scale : float, optional
mask : array, optional
r__yx : array, optional
a__yx : array, optional
mode : string, optional
return_npts : bool, optional
|
---|---|
Returns : | azProf : array
npts : array, optional
|
See also
Examples
Load the dataset:
>>> from pycasso.h5datacube import h5Q3DataCube
>>> K = h5Q3DataCube('qalifa-synthesis.002.h5', 'run001', 'K0277')
Create the radial bins from 0.0 to 3.0 in 0.5 steps, using rad_scale units, and the angular bins as 21 boundaries between -180 and 180 degrees, converted to radians.
>>> import numpy as np
>>> bin_r = np.arange(0.0, 3.0 + 0.5, 0.5)
>>> bin_a = np.linspace(-180.0, 180.0, 21) / 180.0 * np.pi
Calculate the azimuthal profile of the time resolved mass surface density, using a radial scale of 10.5 pixels.
>>> McorSD__tyx = K.McorSD__tZyx.sum(axis=1)
>>> McorSD__taR = K.azimuthalProfileNd(McorSD__tyx, bin_a, bin_r, rad_scale=10.5)
Note that bin_a contains the bin boundaries, it is not fit for plotting along with McorSD__tZaR. We will use the bin centers.
>>> bin_a_center = (bin_a[:-1] + bin_a[1:]) / 2.0
Plot the azimuthal profile for the first and last radial bins, summing in all ages. Note that McorSD__taR.shape is (N_ages, len(bin_a) - 1, len(bin_r) - 1).
>>> import matplotlib.pyplot as plt
>>> plt.plot(bin_a_center, McorSD__taR[...,0].sum(axis=0)
>>> plt.plot(bin_a_center, McorSD__taR[...,-1].sum(axis=0)
\(\chi^2 / Nl_{eff}\) of the fit.
- Units: dimensionless
- Shape: (N_y, N_x)
Close the file. All open objects become invalid
Copy an object or group.
The source can be a path, Group, Dataset, or Datatype object. The destination can be either a path or a Group object. The source and destinations need not be in the same file.
If the source is a Group object, all objects contained in that group will be copied recursively.
When the destination is a Group object, by default the target will be created in that group with its current name (basename of obj.name). You can override that by setting “name” to a string.
Example:
>>> f = File('myfile.hdf5')
>>> f.listnames()
['MyGroup']
>>> f.copy('MyGroup', 'MyCopy')
>>> f.listnames()
['MyGroup', 'MyCopy']
Create a new HDF5 dataset
Keyword-only arguments:
Create and return a new subgroup.
Name may be absolute or relative. Fails if the target name already exists.
Low-level HDF5 file driver used to open file
Spatially resolved error in observed spetra.
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (Nl_obs, N_y, N_x)
Spatially resolved flagged spaxels.
FIXME: describe flags.
- Units: dimensionless
- Shape: (Nl_obs, N_y, N_x)
Spatially resolved observed flux (input spectra for the synthesis).
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (Nl_obs, N_y, N_x)
Spatially resolved synthetic spectra.
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (Nl_obs, N_y, N_x)
Weight of the spaxels in the input spectra. This is the weight actually used by the synthesis, after clipping, etc. Values for voronoi zones.
FIXME: describe flags and weights.
- Units: dimensionless
- Shape: (Nl_obs, N_zone)
Spatially resolved weight of the spaxels in the input spectra. This is the weight actually used by the synthesis, after clipping, etc.
FIXME: describe flags and weights.
- Units: dimensionless
- Shape: (Nl_obs, N_y, N_x)
File ID (backwards compatibility)
Return a File instance associated with this object
File name on disk
Fill a 2-D the masked pixels of an image of a property using the values of a radial profile. The pixels to fill are chosen by mode.
Parameters : | prop : array
prop__r : the radial profile to use to fill the data.
r : array
r__yx : array
mode : string
|
---|---|
Returns : | prop_fill : array
mask : array
|
Tell the HDF5 library to flush its buffers.
Retrieve an item or other information.
Example:
>>> cls = group.get('foo', getclass=True)
>>> if cls == SoftLink:
... print '"foo" is a soft link!'
Create the weight image for dezonification. If smooth is True, use prop image to weight the pixels in each zone. Otherwise use the zone area. If prop is not set, use qSignal.
Here we use a scheme similar to zoneToYX(), when using smooth dezonification, except that we use numpy.histogram() to calculate the weight of the pixels.
Parameters : | smooth : boolean
prop : array, optional
|
---|
Estimate ellipticity and orientation of the galaxy using the “Stokes parameters”, as described in: http://adsabs.harvard.edu/abs/2002AJ....123..485S The image used is qSignal.
Returns : | pa : float
ba : float
|
---|
Find the half light radius using the image at the normalization window (qSignal). 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.
Parameters : | fill : boolean
|
---|---|
Returns : | HLR : float
|
See also
Notes
This value should be close to $dfrac{HLR_{circular}}{sqrt{b/a}}$ if the isophotes of the galaxy are all ellipses with parameters p.a. and b/a.
Find the half radius of the desired property. Using radial bins of 1 pixel, calculate the cumulative sum of prop. The “half prop radius” is the radius where the cumulative sum reaches 50% of its peak value.
Parameters : | prop : array
fill : boolean
|
---|---|
Returns : | HXR : float
|
See also
Notes
This value should be close to $dfrac{HLR_{circular}}{sqrt{b/a}}$ if the isophotes of the galaxy are all ellipses with parameters p.a. and b/a.
Examples
Load the dataset:
>>> from pycasso.h5datacube import h5Q3DataCube
>>> K = h5Q3DataCube('qalifa-synthesis.002.h5', 'run001', 'K0277')
Calculate the half mass radius, in pixels.
>>> HMR_pix = K.getHalfRadius(K.McorSD)
Calculate the radial profile of extinction by dust, using HMR_pix as radial scale, in bins from 0.0 to 3.0, in 0.1 steps.
>>> import numpy as np
>>> bin_r = np.arange(0.0, 3.0 + 0.1, 0.1)
>>> A_V__r = K.radialProfile(K.A_V__yx, bin_r, rad_scale=HMR_pix)
Note that bin_r is the bin boundaries, it is not fit for plotting along with A_V__r. We need the bin centers.
>>> bin_center = bin_center = (bin_r[:-1] + bin_r[1:]) / 2.0
Plot the Radial profile.
>>> import matplotlib.pyplot as plt
>>> plt.plot(bin_center, A_V__r)
Return an image (numpy.ndarray of same shape as :attr`qSignal`) of the angle in radians (default) of each pixel, relative from the axis of the position angle pa. The projection is fixed assuming the galaxy is a disk, throught the ellipticity parameter ba.
Parameters : | units : string, optional
pa : float, optional
ba : float, optional
|
---|---|
Returns : | pixelDistance : 2-D array
|
Return an image (numpy.ndarray of same shape as :attr`qSignal`) of the distance from the center of the galaxy (x0, y0) in HLR units (default), assuming a projected disk.
Parameters : | use_HLR_units : boolean, optional
pixel_scale : float, optional
pa : float, optional
ba : float, optional
|
---|---|
Returns : | pixelDistance : 2-D array
|
See also
Calculate the star formation rate using a smooth-resampled age base, as prescribed by Asari et al. (2007) <http://adsabs.harvard.edu/abs/2007MNRAS.381..263A>.
Parameters : | logtc_ini : float
logtc_fin : float
logtc_step : float
logtc_FWHM : float
|
---|---|
Returns : | SFR : array
logtc : array
|
See also
pystarlight.util.StarlightUtils.calcSFR
TODO: move to utils?
Calculate the cumulative growth in age space. In age = 0, we have the sum of prop in age, and as age increases the sum of prop decreases.
Parameters : | prop : array
mask : array
relative : bool
|
---|---|
Returns : | cs : array
|
Examples
Load the dataset:
>>> from pycasso.h5datacube import h5Q3DataCube
>>> K = h5Q3DataCube('qalifa-synthesis.002.h5', 'run001', 'K0277')
Get the spatially resolved mass surface density for each age.
>>> MiniSD__tyx = K.MiniSD__tZyx.sum(axis=1)
Calculate the mass build up for the whole galaxy (notice the “all data” mask, K.qMask). The mask could be any selection of data pixels.
>>> MtotGrow__t = K.growthInAge(MiniSD__tyx, mask=K.qMask)
MtotGrow__t is a surface mass density, in \(M_\odot / pc^2\). Converting to absolute mass.
>>> MtotGrow__t *= K.parsecPerPixel ** 2
Plot the mass buildup as a function of log. time.
>>> ages = np.log10(K.ageBase)
>>> import matplotlib.pyplot as plt
>>> plt.plot(ages, MtotGrow__t)
Low-level identifier appropriate for this object
Get a list of tuples containing (name, object) pairs
Get an iterator over (name, object) pairs
Get an iterator over member names
Get an iterator over member objects
Get a list containing member names
File format version bounds (2-tuple: low, high)
Age bin edges, in log. Computes the bin edges as the bissection of the bins, expanding the borders accordingly.
- Units: \([\log age / yr]\)
- Shape: (N_age + 1)
Return metBase as a row matrix to simplify multiplications.
Parameters : | n : integer
|
---|---|
Returns : | metBaseNd : n-D array
|
See also
Python mode used to open file
Return the full name of this object. None if anonymous.
Return the parent group of this object.
This is always equivalent to obj.file[posixpath.dirname(obj.name)]. ValueError if this object is anonymous.
Spatially resolved extinction by dust for each population.
- Units: \([mag]\)
- Shape: (N_age, N_met, N_y, N_x)
Spatially resolved corrected mass fractions for each population.
- Units: \([\%]\)
- Shape: (N_age, N_met, N_y, N_x)
Spatially resolved initial mass fractions for each population.
- Units: \([\%]\)
- Shape: (N_age, N_met, N_y, N_x)
Spatially resolved light fractions for each population.
- Units: \([\%]\)
- Shape: (N_age, N_met, N_y, N_x)
Convex hull of data mask.
- Units: bool
- Shape: (N-y, N_x)
Masked (bad) pixels inside the data mask.
- Units: bool
- Shape: (N-y, N_x)
Calculate the radial profile of a property image (2-D array).
Parameters : | prop : array
bin_r : array
rad_scale : float, optional
mask : array, optional
r__yx : array, optional
|
---|---|
Returns : | radProf : array
|
See also
Examples
Load the dataset:
>>> from pycasso.h5datacube import h5Q3DataCube
>>> K = h5Q3DataCube('qalifa-synthesis.002.h5', 'run001', 'K0277')
Create the bins from 0.0 to 3.0 in 0.1 steps, using rad_scale units.
>>> import numpy as np
>>> bin_r = np.arange(0.0, 3.0 + 0.1, 0.1)
Calculate the radial profile of mass surface density, using a radial scale of 10.5 pixels.
>>> McorSD__r = K.radialProfile(K.McorSD__yx, bin_r, rad_scale=10.5)
Note that bin_r is the bin boundaries, it is not fit for plotting along with McorSD__r. We need the bin centers.
>>> bin_center = bin_center = (bin_r[:-1] + bin_r[1:]) / 2.0
Plot the Radial profile.
>>> import matplotlib.pyplot as plt
>>> plt.plot(bin_center, McorSD__r)
Calculate the radial profile of a property. The last two dimensions of prop must be of length N_y and N_x.
Parameters : | prop : array
bin_r : array
rad_scale : float, optional
mask : array, optional
r__yx : array, optional
mode : string, optional
return_npts : bool, optional
|
---|---|
Returns : | radProf : array
npts : array, optional
|
See also
Examples
Load the dataset:
>>> from pycasso.h5datacube import h5Q3DataCube
>>> K = h5Q3DataCube('qalifa-synthesis.002.h5', 'run001', 'K0277')
Create the bins from 0.0 to 3.0 in 0.1 steps, using rad_scale units.
>>> import numpy as np
>>> bin_r = np.arange(0.0, 3.0 + 0.1, 0.1)
Calculate the radial profile of the time resolved mass surface density, using a radial scale of 10.5 pixels.
>>> McorSD__tyx = K.McorSD__tZyx.sum(axis=1)
>>> McorSD__tZr = K.radialProfileNd(McorSD__tyx, bin_r, rad_scale=10.5)
Plot the Radial profile.
>>> import matplotlib.pyplot as plt
>>> plt.pcolormesh(np.log10(K.ageBase), bin_r, McorSD__r)
An (opaque) HDF5 reference to this object
Open a dataset, creating it if it doesn’t exist.
If keyword “exact” is False (default), an existing dataset must have the same shape and a conversion-compatible dtype to be returned. If True, the shape and dtype must match exactly.
Other dataset keywords (see create_dataset) may be provided, but are only used if a new dataset is to be created.
Raises TypeError if an incompatible object already exists, or if the shape or dtype don’t match according to the above rules.
Return a group, creating it if it doesn’t exist.
TypeError is raised if something with that name already exists that isn’t a group.
Change the geometry of the rings used when calculating radial profiles.
Parameters : | pa : float
ba : float
HLR_pix : float, optional
|
---|
See also
Examples
Load the dataset:
>>> from pycasso.h5datacube import h5Q3DataCube
>>> K = h5Q3DataCube('qalifa-synthesis.002.h5', 'run001', 'K0277')
Find the ellipse parameters.
>>> pa, ba = K.getEllipseParams()
Set the geometry, using a predefined value for HLR_pix.
>>> K.setGeometry(pa, ba, HLR_pix=10.5)
Get the distance for each pixel from the galaxy center.
>>> dist__yx = K.getPixelDistance()
Plot the distance image. Note that its shape should resemble the ellipticity of the galaxy (if it is well-behaved).
>>> import matplotlib.pyplot as plt
>>> plt.imshow(dist__yx)
Enable or disable smooth dezonification. If smooth is True, use qSignal image to weight the pixels in each zone. Otherwise use the zone area.
Parameters : | smooth : boolean, optional
|
---|
User block size (in bytes)
Spatially resolved velocity displacement.
- Units: \([km/s]\)
- Shape: (N_y, N_x)
Spatially resolved velocity dispersion.
- Units: \([km/s]\)
- Shape: (N_y, N_x)
Get a list containing member objects
Recursively visit all names in this group and subgroups (HDF5 1.8).
You supply a callable (function, method or callable object); it will be called exactly once for each link in this group and every group below it. Your callable must conform to the signature:
func(<member name>) => <None or return value>
Returning None continues iteration, returning anything else stops and immediately returns that value from the visit method. No particular order of iteration within groups is guranteed.
Example:
>>> # List the entire contents of the file
>>> f = File("foo.hdf5")
>>> list_of_names = []
>>> f.visit(list_of_names.append)
Recursively visit names and objects in this group (HDF5 1.8).
You supply a callable (function, method or callable object); it will be called exactly once for each link in this group and every group below it. Your callable must conform to the signature:
func(<member name>, <object>) => <None or return value>
Returning None continues iteration, returning anything else stops and immediately returns that value from the visit method. No particular order of iteration within groups is guranteed.
Example:
# Get a list of all datasets in the file >>> mylist = [] >>> def func(name, obj): ... if isinstance(obj, Dataset): ... mylist.append(name) ... >>> f = File(‘foo.hdf5’) >>> f.visititems(func)
Return zoneArea_pc2 as a row matrix to simplify multiplications.
Parameters : | n : integer
|
---|---|
Returns : | zoneAreaNd : n-D array
|
Calculates the radial profile from a zone array. This method is a wrapper for zoneToYX() and radialProfile().
Parameters : | prop : array
bin_r : array
rad_scale : float, optional
mask : array, optional
r__yx : array, optional
extensive : boolean, optional
|
---|---|
Returns : | radProf : array
|
See also
Examples
Load the dataset:
>>> from pycasso.h5datacube import h5Q3DataCube
>>> K = h5Q3DataCube('qalifa-synthesis.002.h5', 'run001', 'K0277')
Create the bins from 0.0 to 3.0 in 0.1 steps, using rad_scale units.
>>> import numpy as np
>>> bin_r = np.arange(0.0, 3.0 + 0.1, 0.1)
Calculate the radial profile of mass surface density, using a radial scale of 10.5 pixels. The extensive option is the key for “surface density”.
>>> McorSD__r = K.zoneToRad(K.Mcor__z, bin_r, rad_scale=10.5, extensive=True)
Note that bin_r is the bin boundaries, it is not fit for plotting along with McorSD__r. We need the bin centers.
>>> bin_center = (bin_r[:-1] + bin_r[1:]) / 2.0
Plot the Radial profile.
>>> import matplotlib.pyplot as plt
>>> plt.plot(bin_center, McorSD__r)
Convert a zone array to an image.
This scheme takes advantage of the qZones image, which has, for every pixel (x, y) the index of the corresponding zone. Using this array as a “smart index” for prop, we get to reconstruct the image.
Parameters : | prop : array
extensive : boolean, optional
surface_density : boolean, optional
fill_value : float, optional
|
---|---|
Returns : | prop__yx : array
|
Examples
Load the dataset:
>>> from pycasso.h5datacube import h5Q3DataCube
>>> K = h5Q3DataCube('qalifa-synthesis.002.h5', 'run001', 'K0277')
The A_V attribute contains the extincion for each zone.
>>> K.A_V.shape
(1638,)
Convert A_V to spatial coordinates. Note that the extinction is not extensive.
>>> A_V__yx = K.zoneToYX(K.A_V, extensive=False)
>>> A_V__yx.shape
(73, 77)
Plot the image.
>>> import matplotlib.pyplot as plt
>>> plt.imshow(A_V__yx)
TODO: Add description of chains_best_par.
TODO: Add description of chains_ave_par.
TODO: Add description of chains_par.
TODO: Add description of chains_best_LAx.
TODO: Add description of chains_ave_LAx.
TODO: Add description of chains_LAx.
TODO: Add description of chains_best_mu_cor.
TODO: Add description of chains_ave_mu_cor.
TODO: Add description of chains_mu_cor.
Best \(\chi^2\) (in chains), in voronoi zones.
- Units: dimensionless
- Shape: (N_zone)
Average \(\chi^2\) (in chains), in voronoi zones.
- Units: dimensionless
- Shape: (N_zone)
TODO: Add description of cubes.
Best Mcor (in chains), in voronoi zones.
- Units: \([M_\odot]\)
- Shape: (N_zone)
Average Mcor (in chains), in voronoi zones.
- Units: \([M_\odot]\)
- Shape: (N_zone)
TODO: Add description of cha_Mcor.
Light fractions for each population, in integrated spectrum.
- Units: \([\%]\)
- Shape: (N_age, N_met)
Current mass fractions for each population, in integrated spectrum.
- Units: \([\%]\)
- Shape: (N_age, N_met)
Current mass fractions for each population, in integrated spectrum.
- Units: \([\%]\)
- Shape: (N_age, N_met)
Extinction by dust for each population, in integrated spectrum.
- Units: \([mag]\)
- Shape: (N_age, N_met)
TODO: Add description of popexAV_flag.
TODO: Add description of integrated_SSP_chi2r.
TODO: Add description of integrated_SSP_adev.
TODO: Add description of integrated_SSP_AV.
TODO: Add description of integrated_SSP_x.
Synthetic integrated spectrum.
- Units: \([erg / s / cm^2 / \overset{\circ}{A}]\)
- Shape: (Nl_obs)
Weight of the spaxels in the integrated input spectra. This is the weight actually used by the synthesis, after clipping, etc.
FIXME: describe flags and weights.
- Units: dimensionless
- Shape: (Nl_obs, N_y, N_x)
TODO: Add description of integrated_chains_best_par.
TODO: Add description of integrated_chains_ave_par.
TODO: Add description of integrated_chains_par.
TODO: Add description of integrated_chains_best_LAx.
TODO: Add description of integrated_chains_ave_LAx.
TODO: Add description of integrated_chains_LAx.
TODO: Add description of integrated_chains_best_mu_cor.
TODO: Add description of integrated_chains_ave_mu_cor.
TODO: Add description of integrated_chains_mu_cor.
Wavelength array for the spectral.
- Units: \([\overset{\circ}{A}]\)
- Shape: (Nl_obs)