# Contributed VACs¶

## Base Classes¶

class marvin.contrib.vacs.base.VACMixIn[source]

MixIn that allows VAC integration in Marvin.

This parent class provides common tools for downloading data using sdss_access or directly from the sandbox. get_vacs returns a container with properties pointing to all the VACs that subclass from VACMixIn. In general, VACs can be added to a class in the following way:

from marvin.contrib.vacs.base import VACMixIn

class Maps(MarvinToolsClass):

def __init__(self, *args, **kwargs):

...

self.vacs = VACMixIn.get_vacs(self)


and then the VACs can be accessed as properties in my_map.vacs.

check_vac(summary_file)[source]

Checks the summary file for existence

download_vac(name=None, path_params={}, verbose=True)[source]

file_exists(path=None, name=None, path_params={})[source]

Check whether a file exists locally

get_ancillary_file(name, path_params={})[source]

Get a path to an ancillary VAC file

get_path(name=None, path_params={})[source]

Returns the local VAC path or False if it does not exist.

get_target(parent_object)[source]

Returns VAC data that matches the parent_object target.

This method must be overridden in each subclass of VACMixIn. Details will depend on the exact implementation and the type of VAC, but in general each version of this method must:

• Check whether the VAC file exists locally.
• If it does not, download it using download_vac.
• Open the file using the appropriate library.
• Retrieve the VAC data matching parent_object. Usually one will use attributes in parent_object such as .mangaid or .plateifu to perform the match.
• Return the VAC data in whatever format is appropriate.
static get_vacs(parent_object)[source]

Returns a container with all the VACs subclassing from VACMixIn.

Because this method loops over VACMixIn.__subclasses__(), all the class that inherit from VACMixIn and that must be included in the container need to have been imported before calling get_vacs.

Parameters: parent_object (object) – The object to which the VACs are being attached. It will be passed to get_target when the subclass of VACMixIn is called. vac_container (object) – An instance of a class that contains just a list of properties, one for to each on of the VACs that subclass from VACMixIn.
set_summary_file(release)[source]

Sets the VAC summary file

This method must be overridden in each subclass of VACMixIn. Details will depend on the exact implementation and the type of VAC, but in general each version of this method must:

• Access the version of your VAC matching the current release
• Define a dictionary of keyword parameters that defines the tree path
• Use get_path to construct the VAC path
• Set that path to the summary_file attribute

Setting a VAC summary file allows the VACs tool to load the full VAC data. If the VAC does not contain a summary file, this method should pass or return None.

update_path_params(params)[source]

Update the path_params dictionary with additional parameters

class marvin.contrib.vacs.base.VACTarget(targetid, vacfile, **kwargs)[source]

Customization Class to allow for returning complex target data

This parent class provides a framework for returning more complex data associated with a given target observation, for example ancillary spectral or image data. In these cases, returning a target row from the main VAC summary file, or a simple dictionary of values may not be sufficient. This class can be subclassed and customized to return any extra functionality or data.

When used, this class provides convenient access to the underlying VAC data as well as a boolean to indicate if the given target is included in the VAC.

Parameters: targetid (str) – The target id, usually plateifu or mangaid. Required. vacfile (str) – The path to the VAC summary file. Required. targetid (str) – The plateifu or mangaid target designation data (row) – The extracted row VAC data for the provided targetid _data (HDU) – the first data HDU of the summary VAC FITS file _indata (bool) – A boolean indicating if the target is included in the VAC

To use, subclass this class, add a new __init__ method. Make sure to call the original class’s __init__ method with super.

from marvin.contrib.vacs.base import VACTarget

class ExampleTarget(VACTarget):

def __init__(self, targetid, vacfile):
super(ExampleTarget, self).__init__(targetid, vacfile)


Further customization can now be done, e.g. adding new parameters in the initializtion of the object, adding new methods or attributes, or overriding existing methods, e.g. to customize the return data attribute.

To access a single HDU from the VAC, use the _get_data() method. If you need to access the entire file, use the _open_file() method.

data

The data row from a VAC for a specific targetid

## Available VACs¶

### Galaxy Zoo¶

class marvin.contrib.vacs.galaxyzoo.GZVAC[source]

VAC name: MaNGA Morphologies from Galaxy Zoo

Description: Returns Galaxy Zoo morphology for MaNGA galaxies. The Galaxy Zoo (GZ) data for SDSS galaxies has been split over several iterations of www.galaxyzoo.org, with the MaNGA target galaxies being spread over five different GZ data sets. In this value added catalog we bring all of these galaxies into one single catalog and re-run the debiasing code (Hart et al. 2016) in a consistent manner across the all the galaxies. This catalog includes data from Galaxy Zoo 2 (previously published in Willett et al. 2013) and newer data from Galaxy Zoo 4 (currently unpublished).

Authors: Coleman Krawczyk, Karen Masters and the rest of the Galaxy Zoo Team.

get_target(parent_object)[source]

Accesses VAC data for a specific target from a Marvin Tool object

set_summary_file(release)[source]

Sets the path to the GalaxyZoo summary file

### HI¶

class marvin.contrib.vacs.hi.HITarget(targetid, vacfile, specfile=None)[source]

A customized target class to also display HI spectra

This class handles data from both the HI summary file and the individual spectral files. Row data from the summary file for the given target is returned via the data property. Spectral data can be displayed via the the plot_spectrum method.

Parameters: targetid (str) – The plateifu or mangaid designation vacfile (str) – The path of the VAC summary file specfile (str) – The path to the HI spectra data – The target row data from the main VAC file targetid (str) – The target identifier
plot_spectrum()[source]

Plot the HI spectrum

class marvin.contrib.vacs.hi.HIVAC[source]

VAC name: HI

Description: Returns HI summary data and spectra

Authors: David Stark and Karen Masters

get_target(parent_object)[source]

Accesses VAC data for a specific target from a Marvin Tool object

set_summary_file(release)[source]

Sets the path to the HI summary file

marvin.contrib.vacs.hi.plot_mass_fraction(vacdata_object)[source]

Plot the HI mass fraction

Computes and plots the HI mass fraction using the NSA elliptical Petrosian stellar mass from the MaNGA DRPall file. Only plots data for subset of targets in both the HI VAC and the DRPall file.

Parameters: vacdata_object (object) – The VACDataClass instance of the HI VAC

Example

>>> from marvin.tools.vacs import VACs
>>> v = VACs()
>>> hi = v.HI
>>> hi.plot_mass_fraction()


### Gema¶

class marvin.contrib.vacs.gema.GEMAVAC[source]

VAC name: GEMA

Description: The GEMA VAC contains many different quantifications of the local and the large-scale environments for MaNGA galaxies. Please visit the DATAMODEL at https://data.sdss.org/datamodel/files/MANGA_GEMA/GEMA_VER to see the description of each table composing the catalogue.

Authors: Maria Argudo-Fernandez, Daniel Goddard, Daniel Thomas, Zheng Zheng, Lihwai Lin, Ting Xiao, Fangting Yuan, Jianhui Lian, et al

get_target(parent_object)[source]

Accesses VAC data for a specific target from a Marvin Tool object

set_summary_file(release)[source]

Sets the path to the GEMA summary file

### Firefly¶

class marvin.contrib.vacs.firefly.FFlyTarget(targetid, vacfile, imagesz=None)[source]

A customized target class to also display Firefly 2-d maps

This class handles data the Firefly summary file. Row data from the summary file for the given target is returned via the data property. Specific Firefly parameters are available via the stellar_pops and stellar_gradients methods, respectively. 2-d maps from the Firefly data can be produced via the plot_map method.

TODO: fix e(b-v) and signal_noise in plot_maps

Parameters: targetid (str) – The plateifu or mangaid designation vacfile (str) – The path of the VAC summary file imagesz (int) – The original array shape of the target cube data – The target row data from the main VAC file targetid (str) – The target identifier
list_parameters()[source]

List the parameters available for plotting

plot_map(parameter=None, mask=None)[source]

Plot map of stellar population properties

Plots a 2d map of the specified FIREFLY stellar population parameter using Matplotlib. Optionally mask the data when plotting using Numpy’s Masked Array. Default is to mask map values < -10.

Parameters: parameter (str) – The named of the VORONOI stellar pop. parameter mask (nd-array) – A Numpy array of masked values to apply to the map The matplotlib axis image object
stellar_gradients(parameter=None)[source]

Returns the gradient of stellar population properties

Returns the gradient of the stellar population property for a given stellar population parameter. If no parameter specified, returns the entire row.

Parameters: parameter (str) – The stellar population parameter to retrieve. Can be one of [‘lw_age’, ‘mw_age’, ‘lw_z’, ‘mw_z’]. The data from the FIREFLY summary file for the target galaxy
stellar_pops(parameter=None)[source]

Returns the global stellar population properties

Returns the global stellar population property within 1 Re for a given stellar population parameter. If no parameter specified, returns the entire row.

Parameters: parameter (str) – The stellar population parameter to retrieve. Can be one of [‘lw_age’, ‘mw_age’, ‘lw_z’, ‘mw_z’]. The data from the FIREFLY summary file for the target galaxy
class marvin.contrib.vacs.firefly.FIREFLYVAC[source]

VAC name: FIREFLY

Description: Returns integrated and resolved stellar population parameters fitted by FIREFLY

Authors: Jianhui Lian, Daniel Thomas, Claudia Maraston, and Lewis Hill

get_target(parent_object)[source]

Accesses VAC data for a specific target from a Marvin Tool object

set_summary_file(release)[source]

Sets the path to the Firefly summary file