Get credentials for the different hip-analysis data APIs connection
Some credentials are needed to access data trough hip-analysis and connect to different APIs. Currently, credentials need to be set-up for the Humanitarian Data Cube (HDC), the Planetary Computer (PC), Copernicus Dataspace, and Google Earth Engine (GEE).
HDC STAC API
Note: If you are working in the WFP JupyterHub ecosystem, the credentials are handled automatically and you can skip this section.
To obtain the HDC STAC API token, go to HDC token to generate a key. Then copy the key and open a terminal to create a hdc_stac.tk file in your home folder by running:
- rm ~/hdc_stac.tk
- echo "YOURTOKEN" >> ~/hdc_stac.tk where YOURTOKEN is your copied key.
You are now done with setting up credentials for the HDC data.
Planteray Computer STAC API
Note: credentials are not required for all PC data sources, but you will need them for some, such as Sentinel-1.
First, you will also need to obtain a Microsoft Planetary Computer account. See instructions here. Once this is done, you have to get your Planetary Computer token.
To do so, sign-in to your account in the developer portal and follow those steps:
- Click on Manage Profile
- In the Subscription section, click on "Show" your Primary key
- Copy this primary key
- Open a terminal to create a
pc.tkfile in your home folder by running: rm ~/pc.tkecho "YOURTOKEN" >> ~/pc.tkwhere YOURTOKEN is your copied key.
You are now done with setting up credentials for the Planetary Computer data.
Copernicus Dataspace STAC API
To access data from the Copernicus Dataspace Ecosystem (such as Sentinel-2 Global Mosaics), you need S3 credentials.
First, register for a free account at the Copernicus Data Space Ecosystem. Once you have an account, follow these steps:
- Navigate to the S3 Credentials Manager
- Sign in with your Copernicus account
- Click "Add Credentials" and specify an expiration date
- Confirm the creation
- Important: Copy both the Access Key and Secret Key immediately - the Secret Key will only be displayed once and cannot be recovered
- Open a terminal and create a
copernicus_stac.txtfile in your home folder: rm ~/copernicus_stac.txtecho "AWS_ACCESS_KEY=YOUR_ACCESS_KEY" >> ~/copernicus_stac.txtecho "AWS_SECRET_KEY=YOUR_SECRET_KEY" >> ~/copernicus_stac.txt
For more information about Copernicus S3 access, see the official S3 documentation.
Google Earth Engine API
To set-up credentials for GEE you will need a Google account. To get credentials follow the steps below:
- Run
earthengine authenticate --auth_mode=notebookin a terminal. Make sure you have theearthengine-apiinstalled in your environment (it is available in thehdcenvironment in Jupyter Hub). - It will open a page in a web browser. Sign-in with your Google account and follow the instructions.
- You will be asked to create a Google Cloud Project (as of new GEE policy, you can find more information here). You will also have to state that the data will be used for noncommercial purposes.
- Copy the token finally generated.
- Go back to your terminal, paste your token and press enter.
- Credentials will then be saved and handled automatically by GEE.
You are now done with setting up credentials for the Google Earth Engine data.