Extracting a location from a NetCDF file - Do you get the point?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello and welcome back to climate unboxed today i want to show you how to extract a time series of information for a particular latitude longitude point from a gridded data set so you might have a gridded data set for a large region maybe it's a global data set possibly on a latitude longitude grid like the one illustrated behind me and you may want to extract the information for this specific location within one of these grid cells where you may have a city of interest or maybe you have a filled site of interest and i'm going to show you how to do that quickly and easy using climate data operators so we've seen what the problem is that we're addressing we have a location in where we have maybe a weather station and we want to extract the series of climate information for that point now how do we do that now the first thing to realize is that this essentially is a mapping or re-gridding problem now we've already covered remapping in an earlier video and you can actually view that by clicking on the pop-up banner right above my head now that side no this side i've always wanted to do that and you can see about the various remapping techniques now in that video i cover the full range of techniques remember one of them was the nearest neighbor where we could just pull out the value from the nearest grid cell another was bilinear interpolation so we're going to see it's actually very simple to extract the information for a point using cdo and that's because in addition to the other grid specification methods for remapping from one grid to another cdo actually has a built-in functionality to enable you to extract information for a grid point and the form is this we say remap method and then we expressify the location using longitude equals x latitude equals y and then we simply have the input file and the output file in the same way that we've seen previously we can have nearest neighbor remapping for example and then we have a longitude latitude specified here's another example with bilinear interpolation it's important to emphasize that the separation between the latitude and longitude specification is a forward slash it's not a comma i used to always forget that because this is actually quite unusual in cdo commands it's a forward slash and also to recall again that we have no spaces it's actually i need to duck down it's right above my head is blocking it but we have no spaces between the remap command the longitude and latitude it all has to be together so let's see this in action shall we in this directory i have one file t2m if i open it with nc view let's make this a touch bigger we can animate it and we can see that it's a function of time so we'll quit that we can also look at the dates in fact using cdo show date and then the name of the file and here we have a printout of the dates the data set starts on 1979 january and it runs through until the end of year 2000 with monthly increments so now we want to simply extract a point so we use cdo remap and we need to choose the kind of interpolation so for this example i'm going to use my linear interpolation and we need to specify the longitude point first and then the forward slash and the latitude point so i'm using 90 degrees west and 30 degrees south for my example point t2m and then the output file name and i'm calling it underscore point.nc it's calculating the bilinear weights and it's mapping us the information says to a longitude latitude grid of just one by one point so it's a point extraction and now if we open the output file there we have it we have a time series of the evolution of the temperature at the location 90 west 30 south derived by by linear interpolation from the four surrounding points of the original data set so there we have it we've seen how given a rigid data set for a large region we can pick out a time series of information for a specific location using either nearest neighbor or by linear or by cubic interpolation using the information from the surrounding grid cells i do hope you've seen the point of the video sorry for the bad joke and i look forward to seeing you soon on climate unboxed yes
Info
Channel: Climate Unboxed
Views: 564
Rating: undefined out of 5
Keywords: cdo, dataset, climate, weather, location, weather station, extraction, interpolation, timeseries, grib, netCDF
Id: YdFo8YAbLTw
Channel Id: undefined
Length: 5min 46sec (346 seconds)
Published: Fri Apr 16 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.