metobs_toolkit.connect_to_gee#

connect_to_gee(**kwargs) None[source]#

Set up authentication for the use of the GEE Python API.

For a fresh kernel, without stored credentials, a prompt/browser window will appear with further instructions for the authentication.

Parameters:

**kwargs (dict) – Keyword arguments passed to ee.Authenticate(). Used for resetting the GEE connection.

Return type:

None

Notes

  • This function assumes you have a Google developers account and a project with the Google Earth Engine API enabled.

  • During authentication, you may be asked if you want a read-only scope. A read-only scope is sufficient for small data transfers, but not for extracting large amounts of data (e.g., model data written to Google Drive).

  • If an EEException is thrown, it is likely due to an invalid credential file. You can update your credential file and specify a specific authentication method.

  • Example usage:

    import metobs_toolkit
    
    metobs_toolkit.connect_to_gee(force=True, # create new credentials
                                  auth_mode='notebook', # 'notebook', 'localhost', 'gcloud', or 'colab'
                                  )
    
Raises:

TypeError – If kwargs is not a dict.