Skip to content

Getting Data with Google Colab

Google Colab is an online platform where you can run Python code and check results without any local setup.

Google Colab overview

Set Up Google Colab Environment

Upload data to Google Drive

Google Colab requires a Google account and Google Drive for data access.

  1. Download the sample data and extract it — it contains a je-sample directory.

    je-sample.zip

  2. In Google Drive, create a work folder and drag-and-drop the je-sample folder into it.

Upload to Google Drive

Load the notebook

  1. Go to Google Colab.
  2. Import the je.ipynb file from your Google Drive — the code set will be displayed.

Load notebook

Mount Google Drive

Run the Mount Google Drive code cell. A connection and access authorization to your Google account is required. Once launched, the browser panel on the left side shows the je-sample folder.

Mount Google Drive

Set the directory path

  1. On the browser panel, right-click the je-sample folder and copy its path.
  2. Paste the path into the gdpath variable and run the cell.

Set directory path

Install JAXA Earth API for Python

In the je-sample folder, the API package (jaxa-earth-0.1.3.zip) is provided.

Run the first three code cells:

  1. First cell — installs the zip file
  2. Second cell — imports libraries including the just-installed JAXA Earth library
  3. Third cell — defines a helper function to get data from JAXA Earth

Install API

The Google Colab environment is now ready.

Get Precipitation Rate (Daily)

Data can be retrieved using the following parameters:

Parameter Description
ppu Image resolution
bbox Area of interest
collection Target dataset ID
sdate Start date
edate End date

Dataset details: https://data.earth.jaxa.jp/en/datasets/#/id/JAXA.EORC_GSMaP_standard.Gauge.00Z-23Z.v6_daily

Run the get-data code cell. The output data is stored as the rain variable.

Get precipitation data

To visualize the result, run the visualization code cell.

Visualize precipitation

Since the color range may be difficult to see, you can adjust the clim range values (e.g., -6 to 2).

Adjusted color range

Get Shortwave Radiation (Daily)

Shortwave radiation can be retrieved with the same code — only change the collection variable to the dataset ID.

Dataset details: https://data.earth.jaxa.jp/en/datasets/#/id/JAXA.JASMES_Aqua.MODIS_swr.v811_global_daily

  • Extent and resolution can be changed by editing the ppu and bbox variables.

Get shortwave radiation

  • To visualize, reuse the precipitation visualization code with the radiation variable.

Visualize shortwave radiation