Marvin is a package intended to simply the access, exploration, and visualization of the MaNGA dataset for SDSS-IV. It provides a suite of Python tools, a web interface, and a REST-like API, under tools/, web/, and api/, respectively. Core functionality of Marvin stems from Marvin’s Brain.

class marvin.MarvinConfig[source]

Bases: object

Global Marvin Configuration

The global configuration of Marvin. Use the config object to globally set options for your Marvin session.

  • release (str) – The release version of the MaNGA data you want to use. Either MPL or DR.

  • access (str) – The type of access Marvin is allowed. Either public or collab.

  • download (bool) – Set to turn on downloading of objects with sdss_access

  • use_sentry (bool) – Set to turn on/off the Sentry error logging. Default is True.

  • add_github_message (bool) – Set to turn on/off the additional Github Issue message in MarvinErrors. Default is True.

  • drpall (str) – The location to your DRPall file, based on which release you have set.

  • mode (str) – The current mode of Marvin. Either ‘auto’, ‘remote’, or ‘local’. Default is ‘auto’

  • sasurl (str) – The url of the Marvin API on the Utah Science Archive Server (SAS)

  • urlmap (dict) – A dictionary containing the API routing information used by Marvin

  • xyorig (str) – Globally set the origin point for all your spaxel selections. Either ‘center’ or ‘lower’. Default is ‘center’


Force the database to be turned off


Force the database to be reconnected

get_allowed_releases(public=None, min_release=None, web_releases=None)[source]

Get a dictionary of supported MaNGA releases

Set public flag to only include public releases. Set min_release to filer out all releases below this one. Set web_releases to a filter out all releases included in the list.

  • public (bool) – If True, only return public DR releases

  • min_release (str) – Filter out all releases below this version

  • web_releases (list) – A list of all releases for the web/api


dict – the supported MaNGA releases in Marvin


Login with netrc credentials to receive an API token

Copy this token into the “use_token” parameter in your custom marvin.yml file to ensure preserve authentication across iPython user sessions.


refresh (bool) – Set to True to refresh a login to receive a new token

lookUpRelease(drpver, public_only=None)[source]

Retrieve the release version for a given DRP version

  • drpver (str) – The DRP version to use

  • public_only (bool) – If True, uses only DR releases


release (str) – The release version according to the input DRP version


Retrieve the DRP and DAP versions that make up a release version.


release (str or None) – The release version. If None, uses the currently set release value.


drpver, dapver (tuple) – A tuple of strings of the DRP and DAP versions according to the input MPL version


As setRelease() but check that the version is a DR.

setDefaultDrpAll(drpver=None, dapver=None)[source]

Tries to set the default location of drpall.

Sets the drpall attribute to the location of your DRPall file, based on the drpver. If drpver not set, it is extracted from the release attribute. It sets the location based on the MANGA_SPECTRO_REDUX environment variable


drpver (str) – The DRP version to set. Defaults to the version corresponding to config.release.


As setRelease() but check that the version is an MPL.


Set the release version.


version (str) – The MPL/DR version to set, in form of MPL-X or DRXX.


>>> config.setRelease('MPL-4')
>>> config.setRelease('DR13')
static set_custom_path(name, path)[source]

Set a temporary custom environment variable path

Custom define a new environment variable in the current os session. Puts it in your os.environ. To permanently set a custom variable, use your .bashrc or .cshrc file.

  • name (str) – The name of the environment variable

  • path (str) – The file path

switchSasUrl(sasmode='utah', ngrokid=None, port=5000, test=False, base=None, public=None)[source]

Switches the API SAS url config attribute

Easily switch the sasurl configuration variable between utah and local. utah sets it to the real API. Local switches to use localhost.

  • sasmode ({'utah', 'local', 'mirror'}) – the SAS mode to switch to. Default is Utah

  • ngrokid (str) – The ngrok id to use when using a ‘localhost’ sas mode. This assumes localhost server is being broadcast by ngrok

  • port (int) – The port of your localhost server

  • test (bool) – If True, sets the Utah sasurl to the test production, test/marvin

  • base (str) – The name of the marvin base. Gets appended to main url. Defaults to “marvin”

  • public (bool) – If True, sets the API url to the public domain

property access
property compression
property dapall
property drpall
property mode
property release
property sasurl
property session_id
property token
property urlmap

Retrieves the URLMap the first time it is needed.

property xyorig