Tools¶
Cube¶
-
class
marvin.tools.cube.
Cube
(input=None, filename=None, mangaid=None, plateifu=None, mode=None, data=None, release=None, drpall=None, download=None, nsa_source='auto')[source]¶ Bases:
marvin.tools.core.MarvinToolsClass
,marvin.tools.mixins.nsa.NSAMixIn
,marvin.tools.mixins.aperture.GetApertureMixIn
A class to interface with MaNGA DRP data cubes.
This class represents a fully reduced DRP data cube, initialised either from a file, a database, or remotely via the Marvin API.
See
MarvinToolsClass
andNSAMixIn
for a list of input parameters.-
getMaps
(**kwargs)[source]¶ Retrieves the DAP
Maps
for this cube.If called without additional
kwargs
,getMaps()
will initialise theMaps
using theplateifu
of thisCube
. Otherwise, thekwargs
will be passed when initialising theMaps
.
-
getSpaxel
(x=None, y=None, ra=None, dec=None, maps=False, modelcube=False, **kwargs)[source]¶ Returns the
Spaxel
matching certain coordinates.The coordinates of the spaxel to return can be input as
x, y
pixels relative to``xyorig`` in the cube, or asra, dec
celestial coordinates.- Parameters
x (int or array) – The spaxel coordinates relative to
xyorig
. Ifx
is an array of coordinates, the size ofx
must much that ofy
.y (int or array) – The spaxel coordinates relative to
xyorig
. Ifx
is an array of coordinates, the size ofx
must much that ofy
.ra (float or array) – The coordinates of the spaxel to return. The closest spaxel to those coordinates will be returned. If
ra
is an array of coordinates, the size ofra
must much that ofdec
.dec (float or array) – The coordinates of the spaxel to return. The closest spaxel to those coordinates will be returned. If
ra
is an array of coordinates, the size ofra
must much that ofdec
.xyorig ({'center', 'lower'}) – The reference point from which
x
andy
are measured. Valid values are'center'
, for the centre of the spatial dimensions of the cube, or'lower'
for the lower-left corner. This keyword is ignored ifra
anddec
are defined.xyorig
defaults tomarvin.config.xyorig.
maps (
Maps
or None or bool) – IfTrue
, the spaxel will be initiated with the DAP properties from the default Maps matching this cube.modelcube (
ModelCube
or None or bool) – AModelCube
object representing the DAP modelcube entity. If None, theSpaxel
will be returned without model information. Default is False.
- Returns
spaxels (list) – The
Spaxel
objects for this cube corresponding to the input coordinates. The length of the list is equal to the number of input coordinates.
-
Plate¶
-
class
marvin.tools.plate.
Plate
(input=None, filename=None, mangaid=None, plateifu=None, mode=None, data=None, release=None, plate=None, download=None, nocubes=None)[source]¶ Bases:
marvin.tools.core.MarvinToolsClass
,marvin.utils.general.structs.FuzzyList
A class to interface with MaNGA Plate.
This class represents a Plate, initialised either from a file, a database, or remotely via the Marvin API. The class inherits from Python’s list class, and is defined as a list of Cube objects. As it inherits from list, it can do all the standard Python list operations.
When instanstantiated, Marvin Plate will attempt to discover and load all the Cubes associated with this plate.
- Parameters
plate (str) – The plate id of the Plate to load.
plateifu (str) – The plate-ifu of the Plate to load
filename (str) – The path of the file containing the data cube to load.
mode ({'local', 'remote', 'auto'}) – The load mode to use. See Mode secision tree..
release (str) – The MPL/DR version of the data to use.
nocubes (bool) – Set this to turn off the Cube loading
- Variables
cubeXXXX (object) – The Marvin Cube object for the given ifu, e.g. cube1901 refers to the Cube for plateifu 8485-1901
plate/plateid (int) – The plate id for this plate
cartid (str) – The cart id for this plate
designid (int) – The design id for this plate
ra (float) – The RA of the plate center
dec (float) – The declination of the plate center
dateobs (str) – The date of observation for this plate
surveymode (str) – The survey mode for this plate
isbright (bool) – True if this is a bright time plate
- Returns
plate – An object representing the Plate entity. The object is a list of Cube objects, one for each IFU cube in the Plate entity.
Example
>>> from marvin.tools.plate import Plate >>> plate = Plate(plate=8485) >>> print(plate) >>> <Marvin Plate (plate=8485, n_cubes=17, mode='local', data_origin='db')> >>> >>> print('Cubes found in this plate: {0}'.format(len(plate))) >>> Cubes found in this plate: 4 >>> >>> # access the plate via index to access the individual cubes >>> plate[0] >>> <Marvin Cube (plateifu='8485-12701', mode='local', data_origin='db')> >>> >>> # or by name >>> plate['12702'] >>> <Marvin Cube (plateifu='8485-12702', mode='local', data_origin='db')> >>>
RSS¶
-
class
marvin.tools.rss.
RSS
(input=None, filename=None, mangaid=None, plateifu=None, mode=None, data=None, release=None, autoload=True, drpall=None, download=None, nsa_source='auto')[source]¶ Bases:
marvin.tools.core.MarvinToolsClass
,marvin.tools.mixins.nsa.NSAMixIn
,list
A class to interface with a MaNGA DRP row-stacked spectra file.
This class represents a fully reduced DRP row-stacked spectra object, initialised either from a file, a database, or remotely via the Marvin API. Instances of
RSS
are a list ofRSSFiber
objects, one for each fibre and exposure.RSSFiber
are initialised lazily, containing only basic information. They need to be initialised by callingRSSFiber.load
(unlessRSS.autoload
isTrue
, in which case the instance is loaded when first accessed).In addition to the input arguments supported by
MarvinToolsClass
andNSAMixIn
, this class accepts anautoload
keyword argument that defines whetherRSSFiber
objects should be automatically loaded when they are accessed.-
select_fibers
(exposure_no=None, set=None, mjd=None)[source]¶ Selects fibres that match one or multiple of the input parameters.
- Parameters
- Returns
rssfibers (list) – A list of
RSSFiber
instances whose obsinfo matches all the input parameters. TheRSS.autoload
option is respected.
Example
>>> rss = marvin.tools.RSS('8485-1901') >>> fibers = rss.select_fibers(set=2) >>> fibers [<RSSFiber [ 2.22306705, 11.84955406, 9.65761662, ..., 0. , 0. , 0. ] 1e-17 erg / (Angstrom cm2 fiber s)>, <RSSFiber [2.18669987, 1.4861778 , 2.55065155, ..., 0. , 0. , 0. ] 1e-17 erg / (Angstrom cm2 fiber s)>, <RSSFiber [2.75228763, 5.53485441, 2.31695175, ..., 0. , 0. , 0. ] 1e-17 erg / (Angstrom cm2 fiber s)>]
-
autoload
¶ If True, unloaded
RSSFiber
instances are automatically loaded when accessed. Otherwise, they need to be loaded viaRSSFiber.load
.
-
obsinfo
¶ An
astropy.table.Table
with the observing information associated with this RSS object.
-
-
class
marvin.tools.rss.
RSSFiber
(fiberid, rss, wavelength, pixmask_flag=None, load=False, obsinfo=None, **kwargs)[source]¶ Bases:
marvin.tools.quantities.spectrum.Spectrum
A
Quantity
representing a fibre observation.Represents the spectral flux observed though a fibre, and associated with an
RSS
object. In addition to the flux, it contains information about the inverse variance, mask, and other associated spectra defined in the datamodel.- Parameters
fiberid (int) – The fiberid (0-indexed row in the parent
RSS
object) for this fibre observation.rss (
RSS
) – The parentRSS
object with which this fibre observation is associated.wavelength (numpy.ndarray) – The wavelength positions of each array element, in Angstrom.
load (bool) – Whether the information in the
RSSFiber
should be loaded during instantiation. Defaults to lazy loading (useRSSFiber.load
to load the fibre information).obsinfo (astropy.table.Table) – A
Table
with the information for the exposure to which this fibre observation belongs.kwargs (dict) – Additional keyword arguments to be passed to
Spectrum
.
-
descale
()[source]¶ Returns a copy of the object in which the scale is unity.
Note that this only affects to the core value of this quantity. Associated array attributes will not be modified.
Example
>>> fiber.unit Unit("1e-17 erg / (Angstrom cm2 fiber s)") >>> fiber[100] <RSSFiber 0.270078063011169 1e-17 erg / (Angstrom cm2 fiber s)> >>> fiber_descaled = fiber.descale() >>> fiber_descaled.unit Unit("Angstrom cm2 fiber s") >>> fiber[100] <RSSFiber 2.70078063011169e-18 erg / (Angstrom cm2 fiber s)>
-
property
masked
¶ Return a masked array where the mask is greater than zero.
Maps¶
-
class
marvin.tools.maps.
Maps
(input=None, filename=None, mangaid=None, plateifu=None, mode=None, data=None, release=None, drpall=None, download=None, nsa_source='auto', bintype=None, template=None, template_kin=None)[source]¶ Bases:
marvin.tools.core.MarvinToolsClass
,marvin.tools.mixins.nsa.NSAMixIn
,marvin.tools.mixins.dapall.DAPallMixIn
,marvin.tools.mixins.aperture.GetApertureMixIn
A class that represents a DAP MAPS file.
Provides access to the data stored in a DAP MAPS file. In addition to the parameters and variables defined for
MarvinToolsClass
, the following parameters and attributes are specific toMaps
.- Parameters
bintype (str or None) – The binning type. For MPL-4, one of the following:
'NONE', 'RADIAL', 'STON'
(ifNone
defaults to'NONE'
). For MPL-5, one of,'ALL', 'NRE', 'SPX', 'VOR10'
(defaults to'SPX'
). MPL-6 also accepts the'HYB10'
binning schema.template (str or None) – The stellar template used. For MPL-4, one of
'M11-STELIB-ZSOL', 'MILES-THIN', 'MIUSCAT-THIN'
(ifNone
, defaults to'MIUSCAT-THIN'
). For MPL-5 and successive, the only option in'GAU-MILESHC'
(None
defaults to it).
- Variables
header (
astropy.io.fits.Header
) – The header of the datacube.wcs (
astropy.wcs.WCS
) – The WCS solution for this plate
-
getMap
(property_name, channel=None, exact=False)[source]¶ Retrieves a
Map
object.- Parameters
property_name (str) – The property of the map to be extractred. It may the name of the channel (e.g.
'emline_gflux_ha_6564'
) or just the name of the property ('emline_gflux'
).channel (str or None) – If defined, the name of the channel to be appended to
property_name
(e.g.,'ha_6564'
).exact (bool) – If
exact=False
, fuzzy matching will be used, retrieving the best match for the property name and channel. IfTrue
, will check that the name of returned map matched the input value exactly.
-
getMapRatio
(property_name, channel_1, channel_2)[source]¶ Returns a ratio
Map
.Attention
Deprecated, see Enhanced Map.
For a given
property_name
, returns aMap
which is the ratio ofchannel_1/channel_2
.For a given
property_name
, returns aMap
which is the ratio ofchannel_1/channel_2
.
-
getSpaxel
(x=None, y=None, ra=None, dec=None, cube=False, modelcube=False, **kwargs)[source]¶ Returns the
Spaxel
matching certain coordinates.The coordinates of the spaxel to return can be input as
x, y
pixels relative to``xyorig`` in the cube, or asra, dec
celestial coordinates.If
spectrum=True
, the returnedSpaxel
will be instantiated with the DRP spectrum of the spaxel for the DRP cube associated with this Maps.- Parameters
x (int or array) – The spaxel coordinates relative to
xyorig
. Ifx
is an array of coordinates, the size ofx
must much that ofy
.y (int or array) – The spaxel coordinates relative to
xyorig
. Ifx
is an array of coordinates, the size ofx
must much that ofy
.ra (float or array) – The coordinates of the spaxel to return. The closest spaxel to those coordinates will be returned. If
ra
is an array of coordinates, the size ofra
must much that ofdec
.dec (float or array) – The coordinates of the spaxel to return. The closest spaxel to those coordinates will be returned. If
ra
is an array of coordinates, the size ofra
must much that ofdec
.xyorig ({'center', 'lower'}) – The reference point from which
x
andy
are measured. Valid values are'center'
(default), for the centre of the spatial dimensions of the cube, or'lower'
for the lower-left corner. This keyword is ignored ifra
anddec
are defined.cube (bool) – If
True
, theSpaxel
will be initialised with the corresponding DRP cube data.modelcube (bool) – If
True
, theSpaxel
will be initialised with the correspondingModelCube
data.
- Returns
spaxels (list) – The
Spaxel
objects for this cube/maps corresponding to the input coordinates. The length of the list is equal to the number of input coordinates.
-
get_binid
(property=None)[source]¶ Returns the binid map associated with a property.
- Parameters
property (
datamodel.Property
or None) – The property for which the associated binid map will be returned. Ifbinid=None
, the default binid is returned.- Returns
binid (
Map
) – AMap
with the binid associated withproperty
or the default binid.
-
get_bpt
(method='kewley06', snr_min=3, return_figure=True, show_plot=True, use_oi=True, **kwargs)[source]¶ Returns the BPT diagram for this target.
This method produces the BPT diagram for this target using emission line maps and returns a dictionary of classification masks, that can be used to select spaxels that have been classified as belonging to a certain excitation process. It also provides plotting functionalities.
Extensive documentation can be found in BPT Diagrams.
- Parameters
method ({'kewley06'}) – The method used to determine the boundaries between different excitation mechanisms. Currently, the only available method is
'kewley06'
, based on Kewley et al. (2006). Other methods may be added in the future. For a detailed explanation of the implementation of the method check the BPT documentation.snr_min (float or dict) – The signal-to-noise cutoff value for the emission lines used to generate the BPT diagram. If
snr_min
is a single value, that signal-to-noise will be used for all the lines. Alternatively, a dictionary of signal-to-noise values, with the emission line channels as keys, can be used. E.g.,snr_min={'ha': 5, 'nii': 3, 'oi': 1}
. If some values are not provided, they will default toSNR>=3
.return_figure (bool) – If
True
, it also returns the matplotlibFigure
of the BPT diagram plot, which can be used to modify the style of the plot.show_plot (bool) – If
True
, interactively display the BPT plot.use_oi (bool) – If
True
, turns uses the OI diagnostic line in classifying BPT spaxels
- Returns
bpt_return –
get_bpt
always returns a dictionary of classification masks. These classification masks (not to be confused with bitmasks) are boolean arrays with the same shape as theMaps
orCube
(without the spectral dimension) that can be used to select spaxels belonging to a certain excitation process (e.g., star forming). The keys of the dictionary, i.e., the classification categories, may change depending on the selected method. Consult the BPT documentation for more details. Ifreturn_figure=True
,~.Maps.get_bpt
will also return the matplotlibFigure
for the generated plot, and a list of axes for each one of the subplots.
Example
>>> cube = Cube(plateifu='8485-1901') >>> maps = cube.getMaps() >>> bpt_masks, bpt_figure = maps.get_bpt(snr=5, return_figure=True, >>> show_plot=False)
Now we can use the masks to select star forming spaxels from the cube
>>> sf_spaxels = cube.flux[bpt_masks['sf']['global']]
And we can save the figure as a PDF
>>> bpt_figure.savefig('8485_1901_bpt.pdf')
Model Cube¶
-
class
marvin.tools.modelcube.
ModelCube
(input=None, filename=None, mangaid=None, plateifu=None, mode=None, data=None, release=None, drpall=None, download=None, nsa_source='auto', bintype=None, template=None, template_kin=None)[source]¶ Bases:
marvin.tools.core.MarvinToolsClass
,marvin.tools.mixins.nsa.NSAMixIn
,marvin.tools.mixins.dapall.DAPallMixIn
,marvin.tools.mixins.aperture.GetApertureMixIn
A class to interface with MaNGA DAP model cubes.
This class represents a DAP model cube, initialised either from a file, a database, or remotely via the Marvin API. In addition to the parameters and variables defined for
MarvinToolsClass
, the following parameters and attributes are specific toMaps
.- Parameters
bintype (str or None) – The binning type. For MPL-4, one of the following:
'NONE', 'RADIAL', 'STON'
(ifNone
defaults to'NONE'
). For MPL-5, one of,'ALL', 'NRE', 'SPX', 'VOR10'
(defaults to'SPX'
). MPL-6 also accepts the'HYB10'
binning schema.template (str or None) – The stellar template used. For MPL-4, one of
'M11-STELIB-ZSOL', 'MILES-THIN', 'MIUSCAT-THIN'
(ifNone
, defaults to'MIUSCAT-THIN'
). For MPL-5 and successive, the only option in'GAU-MILESHC'
(None
defaults to it).
- Variables
header (
astropy.io.fits.Header
) – The header of the datacube.wcs (
astropy.wcs.WCS
) – The WCS solution for this plate
-
getSpaxel
(x=None, y=None, ra=None, dec=None, cube=False, maps=False, **kwargs)[source]¶ Returns the
Spaxel
matching certain coordinates.The coordinates of the spaxel to return can be input as
x, y
pixels relative to``xyorig`` in the cube, or asra, dec
celestial coordinates.If
spectrum=True
, the returnedSpaxel
will be instantiated with the DRP spectrum of the spaxel for the DRP cube associated with this ModelCube. The same is true forproperties=True
for the DAP properties of the spaxel in the Maps associated with these coordinates.- Parameters
x (int or array) – The spaxel coordinates relative to
xyorig
. Ifx
is an array of coordinates, the size ofx
must much that ofy
.y (int or array) – The spaxel coordinates relative to
xyorig
. Ifx
is an array of coordinates, the size ofx
must much that ofy
.ra (float or array) – The coordinates of the spaxel to return. The closest spaxel to those coordinates will be returned. If
ra
is an array of coordinates, the size ofra
must much that ofdec
.dec (float or array) – The coordinates of the spaxel to return. The closest spaxel to those coordinates will be returned. If
ra
is an array of coordinates, the size ofra
must much that ofdec
.xyorig ({'center', 'lower'}) – The reference point from which
x
andy
are measured. Valid values are'center'
(default), for the centre of the spatial dimensions of the cube, or'lower'
for the lower-left corner. This keyword is ignored ifra
anddec
are defined.cube (bool) – If
True
, theSpaxel
will be initialised with the corresponding DRP cube data.maps (bool) – If
True
, theSpaxel
will be initialised with the corresponding DAP Maps properties for this spaxel.
- Returns
spaxels (list) – The
Spaxel
objects for this cube/maps corresponding to the input coordinates. The length of the list is equal to the number of input coordinates.
-
get_binid
(model=None)[source]¶ Returns the binid map associated with a model.
- Parameters
model (
datamodel.Model
or None) – The model for which the associated binid map will be returned. Ifbinid=None
, the default binid is returned.- Returns
binid (
Map
) – AMap
with the binid associated withmodel
or the default binid.
-
property
binned_flux
¶ Returns the binned flux datacube.
-
property
emline_fit
¶ Returns the emission line fit.
-
property
full_fit
¶ Returns the full fit datacube.
-
property
lsf
¶ Returns the pre-pixelized LSF
-
property
stellarcont_fit
¶ Returns the stellar continuum fit.
Spaxel¶
-
class
marvin.tools.spaxel.
Spaxel
(x, y, cube=True, maps=True, modelcube=True, lazy=False, **kwargs)[source]¶ Bases:
object
A base class that contains information about a spaxel.
This class represents an spaxel with information from the reduced DRP spectrum, the DAP maps properties, and the model spectrum from the DAP logcube. A
SpaxelBase
can be initialised with all or only part of that information, and either from a file, a database, or remotely via the Marvin API.The
Cube
,Maps
, andModelCube
quantities for the spaxel are available incube_quantities
,maps_quantities
, andmodelcube_quantities
, respectively. For convenience, the quantities can also be accessed directly from theSpaxelBase
itself (e.g.,spaxel.emline_gflux_ha_6465
).- Parameters
x (int) – The
x
andy
coordinates of the spaxel in the cube (0-indexed).y (int) – The
x
andy
coordinates of the spaxel in the cube (0-indexed).cube (
Cube
object or path or bool) – Ifcube
is aCube
object, that cube will be used for theSpaxelBase
instantiation. This mode is mostly intended forgetSpaxel
as it significantly improves loading time. Otherwise,cube
can beTrue
(default), in which case a cube will be instantiated using the inputfilename
,mangaid
, orplateifu
. Ifcube=False
, no cube will be used and the cube associated quantities will not be available.cube
can also be the path to the DRP cube to use.maps (
Maps
object or path or bool) – Ascube
but for the DAP measurements corresponding to the spaxel in theMaps
.modelcube (
marvin.tools.modelcube.ModelCube
object or path or bool) – Asmaps
but for the DAP measurements corresponding to the spaxel in theModelCube
.lazy (bool) – If
False
, the spaxel data is loaded on instantiation. Otherwise, only the metadata is created. The associated quantities can be then loaded by callingSpaxelBase.load()
.kwargs (dict) – Arguments to be passed to
Cube
,Maps
, andModelCube
when (and if) they are initialised.
- Variables
cube_quantities (
FuzzyDict
) – A querable dictionary with theSpectrum
quantities derived fromCube
and matchingx, y
.datamodel (object) – An object containing the DRP and DAP datamodels.
maps_quantities (
FuzzyDict
) – A querable dictionary with theAnalysisProperty
quantities derived fromMaps
and matchingx, y
.model_quantities (
FuzzyDict
) – A querable dictionary with theSpectrum
quantities derived fromModelCube
and matchingx, y
.ra,dec (float) – Right ascension and declination of the spaxel. Not available until the spaxel has been
loaded
.
-
load
(force=None)[source]¶ Loads the spaxel data.
Loads the spaxel data for cubes/maps/modelcube. By default attempts to load whatever is specified when spaxels are instantianted from other Marvin Tools. Can manually force load a data type with the force keyword.
- force{cube|maps|modelcube}
Datatype to force load.
-
classmethod
restore
(path, delete=False)[source]¶ Restores a Spaxel object from a pickled file.
If
delete=True
, the pickled file will be removed after it has been unplickled. Note that, for objects withdata_origin='file'
, the original file must exists and be in the same path as when the object was first created.
-
save
(path, overwrite=False)[source]¶ Pickles the spaxel to a file.
- Parameters
path (str) – The path of the file to which the
Spaxel
will be saved. Unlike for other Marvin Tools that derive fromMarvinToolsClass
,path
is mandatory forSpaxel.save
as there is no default path for a given spaxel.overwrite (bool) – If True, and the
path
already exists, overwrites it. Otherwise it will fail.
- Returns
path (str) – The realpath to which the file has been saved.
-
property
quality_flags
¶ Bundle Cube DRP3QUAL and Maps DAPQUAL flags.
BinInfo¶
Provides information about the bin associated with this quantity.
Image¶
-
class
marvin.tools.image.
Image
(input=None, filename=None, mangaid=None, plateifu=None, mode=None, data=None, release=None, download=None)[source]¶ Bases:
marvin.tools.mixins.mma.MMAMixIn
A class to interface with MaNGA images.
This class represents a MaNGA image object initialised either from a file, or remotely via the Marvin API.
TODO: what kinds of images should this handle? optical, maps, nsa preimaging? TODO: should this be subclasses into different kinds of images? DRPImage, MapImage, NSAImage?
- Variables
header (
astropy.io.fits.Header
) – The header of the datacube.ra,dec (float) – Coordinates of the target.
wcs (
astropy.wcs.WCS
) – The WCS solution for this platebundle (object) – A Bundle of fibers associated with the IFU
-
classmethod
by_plate
(plateid, minis=None, release=None)[source]¶ Generate a list of Marvin Images by plate
Class method to generate a list of Marvin Images from a single plateid.
- Parameters
- Returns
a list of Marvin Image objects
Example
>>> from marvin.tools.image import Image >>> images = Image.by_plate(8485)
-
classmethod
from_list
(values, release=None)[source]¶ Generate a list of Marvin Image objects
Class method to generate a list of Marvin Images from an input list of targets
- Parameters
- Returns
a list of Marvin Image objects
Example
>>> from marvin.tools.image import Image >>> targets = ['8485-1901', '7443-1201'] >>> images = Image.from_list(targets)
-
getMaps
(**kwargs)[source]¶ Retrieves the DAP
Maps
for this Image.If called without additional
kwargs
,getMaps()
will initialize theMaps
using theplateifu
of thisImage
. Otherwise, thekwargs
will be passed when initialising theMaps
.
-
get_new_cutout
(width, height, scale=None, **kwargs)[source]¶ Get a new Image Cutout using Skyserver
Replaces the current Image with a new image cutout. The data, header, and wcs attributes are updated accordingly.
-
classmethod
get_random
(num=5, minis=None, release=None)[source]¶ Generate a set of random Marvin Images
Class method to generate a random list of Marvin Images
- Parameters
- Returns
a list of Marvin Image objects
Example
>>> from marvin.tools.image import Image >>> images = Image.get_random(5)
-
overlay_fibers
(ax, diameter=None, skies=None, return_figure=True, **kwargs)[source]¶ Overlay the individual fibers within an IFU on a plot.
- Parameters
ax (Axis) – The matplotlib axis object
diameter (float) – The fiber diameter in arcsec. Default is 2”.
skies (bool) – Set to True to additionally overlay the sky fibers. Default if False
return_figure (bool) – If True, returns the figure axis object. Default is True
kwargs – Any keyword arguments accepted by Matplotlib EllipseCollection
-
overlay_hexagon
(ax, return_figure=True, **kwargs)[source]¶ Overlay the IFU hexagon on a plot
- Parameters
ax (Axis) – The matplotlib axis object
return_figure (bool) – If True, returns the figure axis object. Default is True
kwargs – Any keyword arguments accepted by Matplotlib plot
-
overlay_skies
(ax, diameter=None, return_figure=True, **kwargs)[source]¶ Overlay the sky fibers on a plot
-
plot
(return_figure=True, dpi=100, with_axes=None, fibers=None, skies=None, **kwargs)[source]¶ Creates a Matplotlib plot the image
- Parameters
fibers (bool) – If True, overlays the fiber positions. Default is False.
skies (bool) – If True, overlays the sky fibers if possible. Default is False.
return_figure (bool) – If True, returns the figure axis object. Default is True
dpi (int) – The dots per inch for the matplotlib figure
with_axes (bool) – If True, plots the image with axes
kwargs – Keyword arguments for overlay_fibers and overlay_skies
-
save
(filename, filetype='png', **kwargs)[source]¶ Save the image to a file
This only saves the original image. To save the Matplotlib plot, use the savefig method on the matplotlib.pyplot.figure object
-
property
url
¶
VACs¶
-
class
marvin.tools.vacs.
VACDataClass
(name, description, path, display_name=None, url=None)[source]¶ Bases:
object
A data class for a given VAC
- Parameters
- Variables
Example
>>> from marvin.tools.vacs import VACs >>> vacs = VACs() >>> vacs.galaxyzoo.data >>> vacs.galaxyzoo.get_table(ext=1)
-
get_data
(ext=1)[source]¶ Get the data from a specific extension
Context manager to return the data from a given extension. Useful for large FITS files that you don’t want to load all at once.
-
get_table
(ext=None)[source]¶ Create an Astropy table for a data extension
- Parameters
ext (int|str) – The HDU extension name or number
- Returns
An Astropy table for the given extension
-
has_target
(target: str, lomem: bool = False) → bool[source]¶ Checks if a target is contained within the VAC
Checks if a target mangaid or plateifu is within the first data extension of the VAC. By default, uses the full data loaded into memory. Use the lomem flag to instead load the data using a context manager. This is useful for large FITS files in a low-memory environment, such as a web server.
-
property
data
¶ The VAC FITS data
-
class
marvin.tools.vacs.
VACs
(*args, **kwargs)[source]¶ Bases:
marvin.contrib.vacs.base.VACContainer
A class to interface with the MaNGA VACs
A container class to interact with all MaNGA VACs that have been contributed into Marvin. Currently, this container only works with local VACs. Remote-only access to VACs currently does not exist.
- Variables
Example
>>> from marvin.tools.vacs import VACs >>> vacs = VACs()
-
check_target
(target, lomem=None)[source]¶ check which VACS a MaNGA target is available in
Checks for the target in each VAC and returns a dictionary of VAC names and a boolean indicating if the target is in that VAC
-
match_targets
(targets: list = None, to_df: bool = True)[source]¶ Match a list of mangaid targets across all VACs
Check a list of mangaid targets against all VACs and return a Pandas DataFrame (default) or a dictionary of booleans indicating which mangaids are in which VACs. If no targets are provided, all targets from the DRPall file of the currently set release will be checked.
- Parameters
- Returns
pandas.DataFrame or dict – Booleans indicating which mangaids are in which VACs
- Raises
ValueError – when targets is not a list
ValueError – when the targets are not a mangaid