Google Earth Engine Tutorial: Map Annual Frost Days with ERA5
Credit: Youtube Channel “Terra Spatial, Tutorial on mapping annual frost days from 1979 to 2020 using ERA5 daily temperature data.”
You can see all the tutorials from here: Techgeo Academy.
Google Earth Engine (GEE) is a powerful platform for geospatial analysis and remote sensing. To map annual frost days using the ERA5 dataset, follow this structured approach:
- Step 1: Initialize and Load ERA5 Dataset
Use the following code to load the ERA5 temperature data. ERA5 provides high-resolution near-surface temperature data (t2m) at 0.25Β° spatial resolution.
var era5 = ee.ImageCollection("ECMWF/ERA5")
.select('t2m')
.filterDate('2010-01-01', '2020-12-31');
- Step 2: Define Frost Day Threshold
Frost days are typically defined as days when the near-surface temperature (t2m) falls below 0Β°C.
var frostThreshold = 273.15; // 0Β°C in Kelvin
- Step 3: Process Monthly Data
Iterate through each month to calculate frost days. For each month, compute the number of days where temperature is below the threshold.
var frostMonths = era5.map(function(image) {
var month = image.date().get('month');
var year = image.date().get('year');
var frostMask = image.select('t2m').lt(frostThreshold);
return frostMask.multiply(1).set('month', month, 'year', year);
});
- Step 4: Aggregate Annual Frost Days
Combine monthly frost days into annual totals using .reduce(ee.Reducer.sum()).
var annualFrost = frostMonths.reduce(ee.Reducer.sum());
- Step 5: Visualize the Map
Add the annual frost days image to the map and define visualization parameters.
Map.addLayer(annualFrost, {min: 0, max: 365, palette: ['white', 'blue']}, 'Annual Frost Days');
- Step 6: Export the Result
Export the map as a GeoTIFF or other format using the Export API.
Export.image.toDrive({
image: annualFrost,
description: 'annual_frost_days',
folder: 'GEE_Exports',
fileNamePrefix: 'era5_frost',
scale: 25000,
region: geometry,
maxPixels: 1e10
});
Frequently Asked Questions (FAQ)
Q: What is ERA5, and why is it suitable for frost day analysis?
ERA5 is the fifth generation of the European Centre for Medium-Range Weather Forecasts (ECMWF) reanalysis dataset. It offers high-resolution temperature data, making it ideal for studying frost patterns at regional or global scales.
Q: How are frost days defined in this tutorial?
Frost days are calculated as days where the near-surface temperature (t2m) is below 0Β°C (273.15 K), using the NASA GISS temperature conversion scale.
Q: Can I customize the date range or spatial extent?
Yes. Replace the date range in .filterDate() and adjust the geometry variable to define the region of interest.
Q: What visualization options are available for frost days?
You can use any palette in GEE, such as colors representing different frost durations (e.g., white for no frost, blue for maximum frost days).
Q: How accurate is ERA5 for frost day mapping?
ERA5 is a reanalysis dataset, combining models and observations. It is generally reliable but should be validated with in situ data for specific regions.







