Marvin General

Config

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.

Parameters:
  • 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’
forceDbOff()[source]

Force the database to be turned off

forceDbOn()[source]

Force the database to be reconnected

login(refresh=None)[source]

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.

Parameters:refresh (bool) – Set to True to refresh a login to receive a new token
lookUpRelease(drpver)[source]

Retrieve the release version for a given DRP version

Parameters:drpver (str) – The DRP version to use
Returns:release (str) – The release version according to the input DRP version
lookUpVersions(release=None)[source]

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

Parameters:release (str or None) – The release version. If None, uses the currently set release value.
Returns:drpver, dapver (tuple) – A tuple of strings of the DRP and DAP versions according to the input MPL version
setDR(drver)[source]

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

setDefaultDrpAll(drpver=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

Parameters:drpver (str) – The DRP version to set. Defaults to the version corresponding to config.release.
setMPL(mplver)[source]

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

setRelease(version=None)[source]

Set the release version.

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

Example

>>> 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.

Parameters:
  • 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.

Parameters:
  • sasmode ({'utah', 'local'}) – 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
access
compression
drpall
mode
release
sasurl
session_id
token
urlmap

Retrieves the URLMap the first time it is needed.

xyorig