Skip to content

Processor showcasing how to generate alerts at regional level based on weather and vegetation status

License

Notifications You must be signed in to change notification settings

earthdaily/regional-level-alerts-processor

Repository files navigation


Logo

Regional Level Alerts Processor

Learn how to use <geosys/> platform capabilities in your own business workflow! Build your processor and learn how to run them on your platform.
Who we are

Report Bug · Request Feature

LinkedIn Twitter Youtube Issues MIT License

Table of Contents

About The Project

The aim of this project is to help our customers valuing <geosys/> platform capabilities to build their own analytic of interest.

This directory exposes an example of code that will enable you to get weather or vegetation alerts on a regional entity based on a defined parameter (weather or vegetation) and threshold.

This directory allows you to run this example both through a notebook and as a local application on your machine.

(back to top)

Getting Started

Prerequisite

Use of this project requires valids credentials from the <geosys/> platform . If you need to get trial access, please register here.

To be able to run this example, you will need to have following tools installed:

  1. Install Conda: please install Conda on your computer. You can download and install it by following the instructions provided on the official Conda website

  2. Install Docker Desktop: please install Docker Desktop on your computer. You can download and install it by following the instructions provided on the official Docker Desktop website

  3. Install Jupyter Notebook: please install jupyter Notebook on your computer following the instructions provided on the official Jupyter website

  4. Install Git: please install Github on your computer. You can download and install it by visiting here and following the provided instructions

This package has been tested on Python 3.11.4.

(back to top)

Installation

To set up the project, follow these steps:

  1. Clone the project repository:

    git clone https://github.com/GEOSYS/regional-level-alerts
    
  2. Change the directory:

    cd regional-level-alerts
    
  3. Fill the environment variable (.env)

Ensure that you populate the .env file with your Geosys APIs credentials. If you haven't acquired the credentials yet, please click here to obtain them.

API_CLIENT_ID = <your client id>
API_CLIENT_SECRET = <your client id>
API_USERNAME = <your username>
API_PASSWORD = <your password>

AWS_ACCESS_KEY_ID = <...>
AWS_SECRET_ACCESS_KEY = <...>
AWS_BUCKET_NAME = <...>

AZURE_ACCOUNT_NAME = <...>
AZURE_BLOB_CONTAINER_NAME = <...>
AZURE_SAS_CREDENTIAL = <...>

(back to top)

Usage

Usage with Jupyter Notebook

To use the project with Jupyter Notebook, follow these steps:

  1. Create a Conda environment:

    To create a Conda environment, ensure first you have installed Conda on your computer. You can download and install it by following the instructions provided on the official Conda website.

    conda create -y --name demo_regionallevelalerts
    
  2. Activate the Conda environment:

    conda activate demo_regionallevelalerts
    
    
  3. Install the project dependencies. You can do this by running the following command in your terminal:

    conda install -y pip
    pip install -r requirements.txt
    pip install ipykernel
    
  4. Set up the Jupyter Notebook kernel for the project:

    python -m ipykernel install --user --name demo_regionallevelalerts --display-name regionallevelalerts
    
  5. Open the example notebook (regionallevelalerts.ipynb) by clicking on it.

  6. Select the "Kernel" menu and choose "Change Kernel". Then, select "regionallevelalerts" from the list of available kernels.

  7. Run the notebook cells to execute the code example.

(back to top)

Run the example inside a Docker container

To set up and run the project using Docker, follow these steps:

  1. Build the Docker image locally:

    docker build --tag demo_regionallevelalerts .
    
  2. Run the Docker container:

    docker run -d --name demo_regionallevelalerts_container -p 8083:80 demo_regionallevelalerts
    
  3. Access the API by opening a web browser and navigating to the following URL:

    http://127.0.0.1:8083/docs
    

This URL will open the Swagger UI documentation, click on the "Try it out" button under each POST endpoint and enter the request parameters and body

regional-level-alerts/get_weather_alerts endpoint:

Parameters:

  • Code of the Block, ex: "AMU_NORTH_AMERICA"
  • Weather Parameter, ex: "max-temperature"
  • Operator, ex: ">"

Body Example:

{
  "startDate": "2022-01-01",
  "endDate": "2022-12-31",
  "threshold": 100
}

regional-level-alerts/get_vegetation_alerts endpoint:

Parameters:

  • Code of the Block, ex: "AMU_NORTH_AMERICA"
  • Operator, ex: ">"

Body Example:

{
  "observationDate": "2022-12-31",
  "threshold": 0.55
}

Project Organization

├── README.md         
├── notebooks          
├── requirements.txt    
├── environment.yml   
│
├── setup.py           																								   
├───src                
│   ├───main.py 
│   ├───api
│   │   ├── files
│   │   │   └── favicon.svg
│   │   ├── __init__.py
│   │   └── api.py
│   └───regionallevelalerts
│       ├── __init__.py
│       ├── processor.py
│       └── utils.py      
└── tests  

(back to top)

Resources

The following links will provide access to more information:

(back to top)

Support development

If this project has been useful, that it helped you or your business to save precious time, don't hesitate to give it a star.

(back to top)

License

Distributed under the GPL 3.0 License.

(back to top)

Contact

For any additonal information, please email us.

(back to top)

Copyrights

© 2023 Geosys Holdings ULC, an Antarctica Capital portfolio company | All Rights Reserved.

(back to top)