Downloading Objects

Marvin allows you to download objects in several ways, when acting in LOCAL mode. Marvin downloads all objectsusing the SDSS Python package sdss_access. When downloading files, Marvin places the files in your local SAS hierarchy as specified by the $SAS_BASE_DIR environment variable.

  • Via Config:

    Setting the Marvin attribute to True.

  • Via Tools:

    Initializing Marvin objects with the download=True flag.

  • Via Query Results:

    Calling the download method from a set of query Results.

  • Via Explicit Call:

    Calling the downloadList() utility function.

Download Authentication

Downloading with sdss_access requires authentication to the SAS, using a .netrc file placed in your local home directory.

# create a .netrc file if you do not already have one
cd ~/
touch .netrc

# using a text editor, place the following text inside your .netrc file.
    login sdss
    password replace_with_sdss_password

Note: For API Authentication, please go to API Authentication

Via Config

from marvin import config
from import Cube

# set config attributes and turn on global downloads
config.mode = 'local' = True

# instantiate Cube objects
cc = Cube(plateifu='8485-1901')
cc = Cube(mangaid='12-98126')

Both cubes will be downloaded and placed in


Via Tools

from marvin import config
from import Cube
config.mode = 'local'

# instantiate Cube objects
cc = Cube(plateifu='8485-1901', download=True)
cc = Cube(mangaid='12-98126')

The cube for 8485-1901 will be explicitly downloaded but the cube for 12-98126 will not be.

Via Query Results

from import Query

# Make a query
search_filter = 'nsa.z < 0.2'
q = Query(search_filter=search_filter)

# Run the query and retrieve the results
r =

# Download the results

All cubes from the query results will be downloaded and placed in their respective locations in your local SAS.

Via Explicit Call

downloadList() lets you download the files for cubes, images, maps, rss, mastar cubes, or the entire plate directory.

# Import the downloadList utility function
from marvin import config
from marvin.utils.general import downloadList

# Make a list of plate-IFUs
gallist = ['8485-1901', '7443-12701']

# Download cubes for the objects in your list
downloadList(gallist, dltype='cube')

All cubes from your list will be downloaded and placed in their respective locations in your local SAS.

Tip: if you want to download all of the MaNGA Main Sample galaxies, check out the Sample Selection Tutorial.