COSMOS | ExoLabs
ExoLabs Website
Deutsch
Deutsch
  • Willkommen
  • Einleitung
  • Schneebedeckung
  • Schneetiefe
  • Schneewasser
  • Schneevorhersage
  • Neuschnee
  • Services
  • Service Authentication
  • Service Listing
  • Web Map Services
  • Request values at point(s)
  • Massive request along multiple paths
  • Raw Data Access
  • Raw Data Access
  • Raw Data Listing
  • Showcases
  • ExoLabs | Company Website
  • ExoLabs | Medium Blog
  • ExoSnow | Android App
  • ExoSnow | iOS App
  • MountaiNow
  • SAC Tourenportal
  • Skitourenguru
  • Swisstopo
Powered by GitBook
On this page
  • Authentication
  • Browser Access
  • Programmatic Access
  • AWS CLI
  • AWS BOTO3

Was this helpful?

Raw Data Access

COSMOS raw data is stored on AWS S3 in Frankfurt

The authentication system for raw data access on AWS S3 is independent of the COSMOS service authentication!

Authentication

The authentication system for raw data access on AWS S3 is independent of the COSMOS service authentication! The download of raw data can be done from within a browser or programmatically. Only folders a respective user has granted access to can be accessed.

The AWS S3 credentials contain a selection of:

  • Username

  • Password

  • Access key ID

  • Secret access key

  • Account ID

Browser Access

To access data in a browser, the specific folder link a respective user has granted access to needs to be provided by ExoLabs. To successfully login, the IAM User Account ID, IAM Username and the password are needed.

Programmatic Access

AWS provides tools for S3 access, mainly boto3 for Python and the AWS Command Line Interface (CLI). AWS CLI needs to be configured before usage.

AWS CLI

❯ aws configure
AWS Access Key ID [None]: 
AWS Secret Access Key [None]: 
Default region name [None]: eu-central-1
Default output format [None]: 
aws s3 sync s3://exolabs-swiss-project/alps Downloads/ --exclude "*" --include "2023-02-08*" --dryrun

AWS BOTO3

import boto3
from os import path as op
from datetime import datetime

#   AWS Credentials
access_key = 'foo'
secret = 'bar'

#   Configuration
bucket = 'exolabs-swiss-project'
roi = 'alps'
product_type = 'SWE'
timestamp = '000'
doi = '8. February 2024'

# Convert Date
doi = datetime.strptime(doi, '%d. %B %Y').strftime('%Y-%m-%d')

# Download
selection = op.join(roi, doi, f'{doi}+{timestamp}_{roi}_{product_type}_product.tif')
download_to = op.basename(selection)
if not op.isfile(download_to):
    session = boto3.Session(
        aws_access_key_id=access_key,
        aws_secret_access_key=secret,
        region_name='eu-central-1'
    )
    s3 = session.client('s3')
    s3.download_file(bucket, selection, download_to)
    print(download_to)

Descriptions for the available data can be found here:

PreviousMassive request along multiple pathsNextRaw Data Listing

Last updated 1 year ago

Was this helpful?

Raw Data Listing
LogoConfiguration basics - AWS Command Line InterfaceAWS Command Line Interface