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’
- 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.
- 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, public_only=None)[source]¶
Retrieve the release version for a given 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 setrelease
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, 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
- 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.
- 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', '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/marvinbase (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¶