Section author: Alice Jacques <alice.jacques@noirlab.edu>, Robert Nikutta <robert.nikutta@noirlab.edu>

Version: 20220215

1.11.1. Upload External Data to Data Lab

You may often find yourself wanting to analyze some data that you have together with large datasets that are available at Data Lab. It is then useful to upload your data file(s) to your Data Lab account. This can be achieved in various ways.

Note that in order to use the datalab command line client, you must install it first with:

pip install --ignore-installed --no-cache-dir astro-datalab

1.11.1.1. Upload into your VOSpace

1.11.1.1.1. Using the datalab command line client (DCLC)

For a file foo.csv locally stored on your computer, you can upload it to your VOSpace storage with the datalab put function:

> datalab put fr="./foo.csv" to="vos://foo.csv"

1.11.1.2. Upload into your notebooks space

1.11.1.2.1. Using the Jupyter dashboard

To upload your data to a Jupyter notebook, simply select the Upload button in the upper left corner (circled in red in the screenshot below) and choose your file.

In a Jupyter notebook, registered users can import their local file to VOSpace using the storeClient.put function:

> from dl import authClient as ac, queryClient as qc, storeClient as sc
> sc.put('./foo.csv','vos://foo')
(1 / 1) ./foo.csv -> vos://foo
['OK']

Similarly, registered users can import their local table to MyDB using the queryClient.mydb_import function:

> qc.mydb_import('foo','./foo.csv')
'OK'

1.11.1.3. Upload into your personal MyDB database

1.11.1.3.1. Using the datalab command line client & ingest capability

For a table foo.csv locally stored on your computer, you can upload it to your MyDB database with the datalab mydb_import function:

> datalab mydb_import table="foo" data="./foo.csv"

For more datalab command line functions, see our page The datalab Command.