Difference between revisions of "Modelling Air Mass Time Over Water with Hysplit, SAGA GIS, and Python"

From CUOSGwiki
Jump to navigationJump to search
(fixed heading code)
(added section on data)
Line 38: Line 38:
 
=== Python ===
 
=== Python ===
   
Python can be installed= from this link: https://www.python.org/downloads/
+
Python can be installed from this link: https://www.python.org/downloads/
  +
  +
=== Data ===
  +
  +
==== Air Mass Modelling ====
  +
  +
To use Hysplit, you will need information on atmospheric conditions to successfully generate a backtrajectory. Some example data is included in Hysplit. If you’d like to run your own analysis, you can download monthly data from NOAA’s ARL FTP server ftp://arlftp.arlhq.noaa.gov/pub/archives/narr/. This can be done with most web browsers or an FTP client. The files are named NARRYYYYMM, so for our tutorial let’s download the December 2019 file (NARR201912).
  +
  +
==== Surface Raster Data ====
  +
There are a number of sources that can be used for surface water data. Here, we’ll use the General Bathymetric Chart of the Oceans (GEBCO) gridded bathymetric data. It provides depths or elevations throughout the world and is completely open to the public. https://www.gebco.net/data_and_products/historical_data_sets/
  +
  +
Download the GEBCO 2014 grid (or use the updated 2020 grid if you’d like but it is much larger). It will come as a NetCDF file, one of our first tasks will be to convert it to a format suitable for SAGA GIS.

Revision as of 11:56, 3 December 2020

Introduction

In this tutorial, we will explore how to combine a vector line with raster surface information to extract quantitative information about the conditions underneath the line. There are numerous possible applications for this: we can look at an air mass moving over different land cover types, the impact of pollutants on river currents, or the habitats an animal prefers to travel through. Here, we will focus on one particular application, that of how long an air mass spends over water. However, the techniques can be applied to many different problems.

For our purposes, the line will represent the trajectory of an air mass, with each segment representing a certain amount of time. We are interested in how long the air mass spent over water. This is of interest since air masses that spend a long time over water tend to have higher humidity which can affect how much evaporation occurs at further points.

Given a raster grid that determines whether a cell is water or not, we can evaluate this by the following general process:

  1. Split the line into segments based on the raster grid
  2. Determine whether or not the segment is over water and how much time it represents
  3. Sum the length of time represented by segments that are over water.

Here, I will briefly demonstrate how to use a National Oceanic and Atmospheric Administration (NOAA) tool called Hysplit to determine the backtrajectory of an air mass from a point in time and space over a week. I will then show how Python can be used to extract that data and, using SAGA GIS, calculate the amount of time spent over water for the trajectory. The process can be adapted with minimal changes to use other trajectories and raster data.

Prerequisites

Thorough comfort with Python and command line tools would be greatly beneficial. You might find [tutorial on SAGA and Python] useful to start learning with. Comfort with your operating system is recommended. The optional Hysplit component requires some comfort with FTP servers. This tutorial is focused on the Windows environment, but all the software described should also work in a Unix environment with suitable modifications.

Setup

Demonstration Files

You can download these demonstration files which contain the code and some sample files to run it with.

Hysplit

I have provided an example Hysplit data file in the demonstration files if you’d rather not follow these steps. However, if you are interested in air mass trajectory analysis, you may find these useful.

  1. Visit https://www.ready.noaa.gov/HYSPLIT_util.php and install the Tcl/Tk graphical user interface and the Ghostscript / Ghostview postscript viewer. Make sure you install Ghostscript and GSview to their default directories to avoid complications.
  2. You can then download and install Hysplit https://www.ready.noaa.gov/HYSPLIT_hytrial.php
  3. To run Hysplit on Windows, you’ll need to edit the shortcut to tell it to run the Hysplit Tcl code with the Tcl interpreter. Right click on the shortcut to Hysplit on your desktop or start menu and click Properties. Edit the “Target” field to have the path to the Tcl executable called wish86t.exe. On other platforms, you may have to take similar steps.
  4. You can then test that you can launch Hysplit.

SAGA GIS

SAGA GIS can be installed from this link: https://sourceforge.net/projects/saga-gis/

Python

Python can be installed from this link: https://www.python.org/downloads/

Data

Air Mass Modelling

To use Hysplit, you will need information on atmospheric conditions to successfully generate a backtrajectory. Some example data is included in Hysplit. If you’d like to run your own analysis, you can download monthly data from NOAA’s ARL FTP server ftp://arlftp.arlhq.noaa.gov/pub/archives/narr/. This can be done with most web browsers or an FTP client. The files are named NARRYYYYMM, so for our tutorial let’s download the December 2019 file (NARR201912).

Surface Raster Data

There are a number of sources that can be used for surface water data. Here, we’ll use the General Bathymetric Chart of the Oceans (GEBCO) gridded bathymetric data. It provides depths or elevations throughout the world and is completely open to the public. https://www.gebco.net/data_and_products/historical_data_sets/

Download the GEBCO 2014 grid (or use the updated 2020 grid if you’d like but it is much larger). It will come as a NetCDF file, one of our first tasks will be to convert it to a format suitable for SAGA GIS.