marvin.tools.mixins.mma.MMAMixIn(input=None, filename=None, mangaid=None, plateifu=None, mode=None, data=None, release=None, drpall=None, download=None, ignore_db=False)[source]¶A mixin that provides multi-modal data access.
Add this mixin to any new class object to provide that class with the Multi-Modal Data Access System for using local files, database, or remote connection when initializing new objects. See decision tree
| Parameters: |
|
|---|---|
| Variables: |
|
ifu¶Returns the IFU.
plate¶Returns the plate id.
release¶Returns the release.
marvin.tools.mixins.nsa.NSAMixIn(nsa_source='auto')[source]¶A mixin that provides access to NSA paremeters.
Must be used in combination with MarvinToolsClass and initialised
before nsa can be called.
| Parameters: | nsa_source ({'auto', 'drpall', 'nsa'}) – Defines how the NSA data for this object should loaded when
.nsa is first called. If drpall, the drpall file will
be used (note that this will only contain a subset of all the NSA
information); if nsa, the full set of data from the DB will be
retrieved. If the drpall file or a database are not available, a
remote API call will be attempted. If nsa_source='auto', the
source will depend on how the parent object has been
instantiated. If the parent has data_origin='file',
the drpall file will be used (as it is more likely that the user
has that file in their system). Otherwise, nsa_source='nsa'
will be assumed. This behaviour can be modified during runtime by
modifying the nsa_mode attribute with one of the valid values. |
|---|
nsa¶Returns the contents of the NSA catalogue for this target.
marvin.tools.mixins.dapall.DAPallMixIn[source]¶A mixin that provides access to DAPall paremeters.
Must be used in combination with MarvinToolsClass and initialised
before dapall can be called.
DAPallMixIn uses the MarvinToolsClass.data_origin of the object to
determine how to obtain the DAPall information. However, if the object
contains a dapall attribute with the path to a DAPall file, that file
will be used.
dapall¶Returns the contents of the DAPall data for this target.
marvin.tools.mixins.aperture.MarvinAperture[source]¶Bases: object
Extends photutils.Aperture allowing to extract spaxels in the aperture.
This class is not intended for general use and it is dynamically set as
the base for a Aperture instance.
getSpaxels(threshold=0.5, lazy=True, mask=None, **kwargs)[source]¶Returns the spaxels that fall within the aperture.
| Parameters: |
|
|---|
mask¶Returns the fractional overlap mask.
Equivalent to using photutils.PixelAperture.to_mask followed
by photutils.ApertureMask.to_image using the shape of the parent
object. Combines all the apertures in a single mask.
parent¶Returns or sets the parent object.
marvin.tools.mixins.aperture.GetApertureMixIn[source]¶getAperture(coords, aperture_params, aperture_type='circular', coord_type='pixel')[source]¶Defines an aperture.
This method is mostly a wrapper around the aperture classes defined in photutils. It allows to
| Parameters: |
|
|---|---|
| Returns: | marvin_aperture (MarvinAperture object) – A |
Examples
A single circular aperture with a radius of 3 pixels can created as
>>> cube = marvin.tools.Cube('8485-1901')
>>> aperture = cube.getAperture((17, 15), 3)
aperture can then be used to return all spaxels that have a
fractional overlap with the aperture of more than 0.6 pixels
>>> spaxels = aperture.getSpaxels(threshold=0.6, lazy=True)
>>> spaxels[0]
<Marvin Spaxel (x=15, y=13, loaded=False)
Apertures can also be defined from sky coordinates. To define two elliptical apertures with semi-axes 3 and 1 arcsec and rotated 30 degrees we do
>>> ap_ell = cube.getAperture([(232.546173, 48.6892288), (232.544069, 48.6906177)],
(3, 1, 30), aperture_type='elliptical')
>>> ap_ell
<MarvinAperture([[232.546173 , 48.6892288],
[232.544069 , 48.6906177]], a=3.0, b=1.0, theta=30.0)>