Skip to main content

Visualize GDD data using a Jupyter Notebook

Instructions

In this lesson you gathered GDD data using an IoT sensor. To get good GDD data, you need to gather data for multiple days. To help visualize temperature data and calculate GDD you can use tools like Jupyter Notebooks to analyze the data.

Start by gathering data for a few days. You will need to ensure your server code is running all the time your IoT device is running, either by adjusting your power management settings or running something like this keep system active Python script.

Once you have temperature data, you can use the Jupyter Notebook in this repo to visualize it and calculate GDD. Jupyter notebooks mix code and instructions in blocks called cells, often code in Python. You can read the instructions, then run each block of code, block by block. You can also edit the code. In this notebook for example, you can edit the base temperature used to calculate the GDD for your plant.

  1. Create a folder called gdd-calculation

  2. Download the gdd.ipynb file and copy it into the gdd-calculation folder.

  3. Copy the temperature.csv file created by the MQTT server

  4. Create a new Python virtual environment in the gdd-calculation folder.

  5. Install some pip packages for Jupyter notebooks, along with libraries needed to manage and plot the data:

    pip install --upgrade pip
    pip install pandas
    pip install matplotlib
    pip install jupyter
  6. Run the notebook in Jupyter:

    jupyter notebook gdd.ipynb

    Jupyter will start up and open the notebook in your browser. Work through the instructions in the notebook to visualize the temperatures measured, and calculate the growing degree days.

    The jupyter notebook

Rubric

CriteriaExemplaryAdequateNeeds Improvement
Capture dataCapture at least 2 complete days of dataCapture at least 1 complete day of dataCapture some data
Calculate GDDSuccessfully run the notebook and calculate GDDSuccessfully run the notebookNot able to run the notebook