Here we will write a function that calculates total rainfall for a region for 1 year, and then map() that function over a list of 40 years. Data processing in Earth Engine boils down to a) create a list or collection and b) mapping a function over it and optionally c) reducing the results. Here’s where the map() operation comes handy. Combined with the parallel-processing power of Earth Engine, it enables us to get statistics over long periods of time very easily. The biggest advantage of the CHIRPS dataset is the long and consistent time series it provides. Map.addLayer(totalBangalore, visParams, 'Total Precipitation (Bangalore)') Var totalBangalore = total.clip(bangalore) Clip the image to the city boundary and display Since CHIRPS data has only 1 band named precipitation, the dictionary will have only a single key named precipitation_sum. The result of a reduceRegion() operation is a dictionary which has the stats for each band of the image. CHIRPS spatial resolution is 0.05° – which is approximately 6km. In the code below, we specify 5000m as the scale. For this example, we will compute the total average rainfall within the city of Bengaluru, India. Now that we have computed an Image with the total rainfall for each pixel, we can compute average total rainfall in any given geometry using reduceRegion() function. The region could be anything – a river basin, an administrative area (city/district) or a polygon. Most hydrological applications will require computing the Areal Mean Rainfall (AMR) – which is the average total rainfall in a region. Map.addLayer(total, visParams, 'Total Precipitation') Unless you specifically need daily data, you should use the pentad dataset. Note that CHIRPS is also provided in a daily time-step which is computed by disaggregating the pentad data. Pentads reset at the beginning of each month. There are 6 pentads in a calendar month: Five 5-day pentads and One pentad with the remaining 3 to 6 days of the month. Pentad represents the grouping of 5 days. The primary computing time step for the CHIRP is the pentad.
0 Comments
Leave a Reply. |