How To Plot NetCDF Files in Panoply

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi there welcome back so today i'm going to show you how to plot net cdf file right you need to download net cd file first and then if you want to process your net cd files so what you have to do at first you have to plot what right what are the variables and how it looks like so that's why you need to plot but it is very difficult to read near city file without any uh programming code or any specific command right so that's why i'm gonna show you how to plot it first and you'll be amazed that if i plot it after plotting if you want to plot wind data if you want to plot precipitation data that is basically spatially distributed data set right and it will also plot the time series as well so whatever the uh distribution of the file or the variables it is not a problem we can plot and the plot will look like a kind of a professional plot so it'll be amazed okay so let me just quickly show you how to plot this type of net cdf file irrespective irrespective of the variables you will be able to plot it and i think yeah it will be very helpful this time so what you have to do i'm going to show you the plots in panoply first right and then i'll show you also how to plot this nesidda file in gis and also i'll show how to plot neat cdf file using python code in three different tutorial series okay since the length of the video will be longer so i'm gonna split it into three or four different segment or parts so let's see if you just type here in the google panoply okay panoply then it is basically from nasa so it will show you this window and you can go for that fanoply download if you just use that panel free download then definitely it will show you some directory where you can download cdc panoply data viewer downloads nasa giss okay or you can click there as well as well so the benefit of using this panoply before using any uh nc command that we did in linux machine we don't need that you will automatically see the variable names here and the dimensions and everything and based on that information you can write your code to extract right before writing any code or processing or data we need to know the dimension and the name of the variables and and other properties right the coordinate system that is very important as well so if you just open this one and it will show you this window you have this version for mac operating system and you also have the version for windows right so and you're gonna see that is the most recent one august 28 right and then we also have the version for linux as well so most of the student you can use this windows so i'm gonna click there it will just download one g file that's it nothing else so i'm just putting it there and maybe it's gonna take a while because it is only 33.2 megabit megabyte and today my internet speed it looks pretty slow okay that's it so okay once you have that download ready then you'll be able to install it or there will be one executable you can double click on it and then definitely it will open and then you can import your uh net cdf file obviously because or even if you have agreed grb.grp file so that is the binary file net serial file is also a different type of network common data format file so if you want to even import binary file you can do that sometimes what we do is basically what i do once i have the grb files so i convert it to net cdf files right so i have another code and i'll show you the processes it is a different history you have to install a different programming language right from you card it is called ncl so we'll do it later on and i find it very useful by the way so i'll use that code and based on that language i i've written a code and that will convert all the files right and then you can process your net cdf file if you just if you write your code only based on net cdf then it's also necessary so i'm just opening what i have i have this one if i just extract that that okay here if i extract that files what let's see i what i have inside that folder so it's nothing else basically it's kind of javascript script and if you just click on that panoply and it's gonna open maybe it's testing but you may have to yeah it's opening on the other monitor so it's done see when it's open it is asking where you have your net cdf file okay so let me show you my net serial file from ace warp okay ace warp this is the wind and pressure let's see what we have inside that so that is the file name and these are the variables we have latitude if i click on latitude you can see on the right side it is the latitude okay and we have the description we have the values twenty seven hundred and sixty one and what is the long name it is latitude and what is the unit it is of degree north we know that not received degree north right by the way and then we have that lat scalar and the series because these are the kind of studies data and it is basically scalar not the vector it doesn't have any direction right that's what is scalar and same for the longitude but the number is different right it's 3241 because it is very high resolution data and then we have the main variables we need it is basically the pressure reduced to mean sea levels so we have the time 38 times step it is three dimensional data this p variable is three dimension it has time and based on each time segment we have this latitude and longitude the same number of latitude and longitude that we just saw and the unit is pascal it is also a scalar and then the pressure reduced to mean sea level that is the description right and if there is any missing value so it will use that big number so if you later on use any code or if you use even panoply it will understand okay that is my missing value and it is kind of integer okay you can you can write in a cd file i have a code that can write an hd file if you want to subset right i'll show you later on how to subset a new studio file from this one it will cover the entire usa so out of this big region if i want to focus this file is pretty big right since it is high resolution it's pretty big but if you wanna subset it for your specific local area you have to make a subset of the bigger one so how can you do that you have to cut it right you have to cut it and you have to extract the small piece you have to use the process of writing net cdf file so i have written a code that can do that and yeah in future tutorial probably yeah i'm not sure probably yeah i'll show that as well and here we have the time description see it is a julian day and we have 38 times tape and the unit is basically since 1990 and first of january and it is also a scalar and you can see that conventions relative julian days with decimal part because this time we'll see the variables how it looks like and it is not like okay today the date is like this no we have the reference date and then it will give us a number so you have to calculate based on that number that yeah and that will give you a starting time of your data set here not from 1990 definitely it is from starting from 1990 and you have a big number if you add those number in terms of days or whatever since it mentioned that number will be based on days if we have 0.25 that means it is six hour right we have to convert it we'll see that and then the time it is x is time axis and then we have eastward wind see well because the direction is already there there is no direction dimension so that's why it is scalar and if you specify time it is the same dimension as pressure and the v win is the northward wind as well so if i plot pressure because the plotting for pressure and wind is different pressure it has only one variable right it will show you that if it is for any storm it will show you the peak or the i or any distribution it will look like a storm but for wind speed we have to plot x and y component all together and you have to calculate the resultant right means v squared plus u squared and whole squared right and square root of this two and then you will get the resultant of these two and once you have the resultant of these two and then it will look like of vertex like a storm okay let me just quickly show once you select any variable you want to plot then you can click there create plot or you can select the because if you click create plot it will plot only the standard size if you want to increase your plot size you can click there right and you can even change everything there okay we'll see that at first and what you can do even you can right click here and here you can select whether your plot side is very small or your plot side will be standard or large or extra large or jumbo size whatever you need right and there is another one super jumbo size as well so i'm gonna just uh plot as standard plot i'm creating create a plot and see georeferenced and if you select it is latitude and longitude that means it will plot the spatial distribution right along the x-axis it will plot longitude and along y-axis it will plot the latitude values and you will see that and we if you want to plot zonal average it will calculate the journal average right and then if you want to plot x-axis along x-axis that is your longitude and any time series variable it will do that for you but for this case since we want to plot the spatial distribution right we want to see from the bar side view so that's why i'm plotting the latitude and longitude of that variable pressure first let's see if i click on create it is plotting yeah it's plotting and you can see that it's covering and we can see up eye right eye of the storm basically it is a storm called florence you can see it is located in the north atlantic ocean right it is within the atlantic ocean and is coming to usa and hitting the north carolina so you can see that it's covering but it is covering the entire with basically the half of the atlantic ocean and almost right half of usa so it's pretty big area and it's very high resolution so processing this data set is yeah it will take time so what you have to do you have to subset so we'll do that later on but for the time being i'm just plotting and if you just uh press ctrl and your scroll right and if you select it will zoom in okay till zoom in and you can select and you can zoom in and now we have to see now it is like kind of stressed so what do you have to do you have to fix it right if you click on that scale and if you just click on feed data or you can specify your lower limit and upper limit then your color will be different right and then i'm clicking on the grid you can even change different type of grid it is now it is that equirectangular regional grid and you can overlay any i'm showing later on i'm showing that one not a problem and then you can do all these things first we can go to there and okay let me quickly show you that okay so here is our array and it means you can change the time because we have 38 time it is trying only the first time step we have and if you select the strum will move you can see it is moving see it is moving to the shore right and here you can see because for the first one we have only one variable if we have x y wind then we have to select here so we have only one array and we can see the area one on the upper left corner you can see the values as table and then i'm gonna fix the plot as well not a problem since it is pretty big data so it is taking a while see i clicked on that every one and see now it's there these are the values of the pressure right you can see that we have y axis latitude these are the latitude values if you go this way and these are the longitude values it is in between that range minus 98 to minus 50 and we also have the average values as well okay so i'm clicking on plot again and i need to fix that okay so fitting fitting that feed data it is fitting and dimension where is the map i should have one map here but it is not swing where where is the map that is the level that is the grid and fix proportion if we click on that grid and fix proportions then it will yeah it will fix that and if you need further zoom in you can click ctrl and press ctrl and it will activate the plus sign and you can select and this portion right and then you can click fixed proportion that is one way to okay for the time being um here and if you need to even change the ratio in between the height and the width of the plot you can do that here you can play with that one right now it is large size is 140 that is the plot size and the ratio right we have the width if the width is 100 then what is the height height is 50 it is like 0.5 right and then 1 is to 2 time if i increase the height it will increase the height but for the time being i don't need that okay i can even cover my bit okay it's okay we can go with that whatever we have you can play with that one but the thing we need i need to even the c you can't even identify the shore lines that's why what i did i downloaded the show lines and i'm just replacing that one so that's why overlays you have to click on overlays and now see we have the option earth dot cno that's why it is kind of not perfect if i click there you can add three different you can even you can add the shape file of your study area right that is also possible i have that i can i can show you that one as well okay okay i can add the watershed maybe it's their see i have one watershed there it is in texas and if you have any watershed there you can also add that as well right so what i'm gonna do i have the high resolution show line so i'm replacing that one so at the same time you can show this show lines and your watershed map see that is the show line right it is the north carolina and news river we have here and that is the map and what you have to do so you can even change the header right this pressure reduced to mean sea level you don't need that you can change it and here the variable these are the automatic you can see the color bar and you can make it horizontal or vertical whatever you want and you can do that and you can use contour we are not using anything solid we can use that as one and see we can even modify that horizontal this grid as well so we can do that here the grid now it is 15 degree by 15 degree i'm gonna change it to a one degree let's see one degree by one degree it is just giving us many lines that is the grid and it looks pretty congested right so i'm just changing it to 2 degree or 5 degrees enough i think for the bigger area if it is very small area then you can use that one by one and just change it to 2.5 maybe that will be okay and the size you can't even read right there is no number so what you have to do if you want to show the number right so then the labels these are none right now you have to use every grid line or every alternate grid grid line whatever you want you can just select it um yeah selecting every grid line so it will show you the values of the coordinate the latitude and the longitude right it's showing but we can't even read it right it's pretty small so what we have we have to change the size here the size we have up to 10 point we can even we can't increase after that i think that is 10 is enough to yeah let's see so that's it right and you can change the color as well here you can change the color you have the option the black is okay so what next here scale you can select that okay this one scale selection means if you select custom then we can change that value pressure reduce to mean sea level whatever you want you can do that after selecting that scale okay you can just remove that by backspace since it is refreshing it is taking a while but it's okay okay that's why you have to have passions it is taking a while that's why what i need what i do i just uh make a substitute at first and then i just do all these processes so for the time being yeah you can write anything you want for the time being i can put it as a default value that is not a problem because this default one is perfect right default one is perfect it is representing the variable we need a pressure reduced to mean sea level okay you can write that and it will change i'm going to show you other options i need so i change it to default then it will show you again that pressure reduced to mean sea level and it already yeah has that unit okay it is refreshing so the plot is that okay it is still taking a while so that's why i just uh like to plot everything using code programming code right so here what you can do you can't even make an animation using that one yeah because this is for any time and stuff you have to select the time step one by one then you can see it is moving so if we have any code in any programming language that will plot every time step loop through the net cdf file and then it will plot and it will save the image right for each time stave and later on i have another code that will make the gif file and that is the animation you can see so it is just yeah the default value now what do we need i need to even change the level okay the header pressure reduced to mean sea level here you can change it you can change okay see level four i'm writing three is taking still taking time i'm just okay for hurricane okay for hurricane florence see i already finished the writing here but it's just showing after a while so that is the thing you have to consider if you want to use this software it is pretty slow kind of thing even though this software is written by very smart guys from nasa but sometimes if your data is not that high resolution you can do that so this version is taking a while but when i use the previous version and that it was not that oh yeah slow it was pretty fast whenever i was writing anything it was doing the job for us okay so once you have this so how can you export it that is the most important thing because if you wanna use that plot right for your report or for your publication or for anything what you need you need to export it as either a different format right png is the best one i suggest other people may use uh jpeg so you can use whatever you want you have the options right you can select out of these options as well and after this one pressure plot the main uh yeah the important one is the wind speed because we have two variables and out of these two variables you have to do some processing here then it will show you that uh vertex of the wind and that will show you the eye otherwise if you just import this together and it won't show you any kind of a strong so that's why we need some processing and this is pretty simple we have one variable and we are just plotting it that's it otherwise that's why i'm going to show you how to plot a wind speed the x and y variable if you already have that variable in terms of x and y so that's why i'm now eagerly just uh interested to do things in programming when i yeah you can what you can do you can create that you can even calculate that resultant velocity while subsetting your data set you have x and y you can calculate and while writing this net cdf you can directly use that right the square root of this summation of the 2a square now wind speed so that this is how you can write the resultant value and you can import it directly you can plot like pressure value it will give you the circle okay so everything is possible it is a combination of your programming so it's done if i wanna save it so go to file and save the image and save the image as right since we are gonna change the extension save as then we can select any any location okay i'm gonna select download and the name is that by default is png because previously i selected that one and you can change it to gif image you can change it to jpeg and pdf right and even t file as well whatever you need that will be a raster file right so i'm gonna save as png and you can change also the name i'm not changing the name by the time being okay saving and let's see what we have okay i think it's already saved everything there so that's it which one is that it is still maybe saving okay it's done there if i click on that so that is the image and you can use this image right it's pretty pretty good right you can zoom in and then you can cover the left and right blank space that is possible so that's it and if i want to plot after that wind speed you can minimize that one that's okay you can use the main window and you can select the wind and create plot quickly and create right that's it and then you can click on v wind and right click okay and you can also right click and create plot then it will ask you if you want to add it to the previous plot or not right okay create plot that's it is it okay so since we have i'm just showing the problem we have here right we have v wind we have x wind so these are in two different plot right so what i have to do i have to merge them together how can i do that right so definitely we have options here and out of these options we have to select that one and then only you can do that right so that is possible see we are not we are interpreting the values separately let me just uh figure it out so here are the options here we have see if i select two time it is changing the time for each of them but at first i have to integrate these two i'm closing this one and once i have that if i okay we have the option here plot the file and import data script here here so here combine plot okay so i already have you wind that is the u means the right is toward wind and if i click on that so this combined plot that option is now activated if i click on that it is asking because i already have that right the previous one pressure plot i don't need that so i'm gonna select only you wind so if i select that if i select combine now these are combined but you can't see which one is our storm or which one is different we can't even differentiate because it is a kind of different time and different shape so what i'm gonna do i'm gonna fix that fixed proportion first i'm just zooming in more i'm zooming in more this area and fixing the proportion if you want okay so let's see the errors so now i have two different areas right here on the left side it is 16 right out of 38 and if i select the same thing here it will be the same date so now i have the same time see i have the same time but these are diff not the resultant that's why you can't even see we have two different color right so what i have to do here right what it is doing it is area one minus array two it is just uh different shading it is plotting the difference between these two arrays but we don't need that we need the resultant value if you click on that it will see the option you can select even area one you can even select the array two only but what we need we need this one right we need if you can yeah you can select the average as well you can select this calculations summation everything but what we need vector magnitude if i click on vector magnitude so it is showing you the resultant vector because these are the options we can easily use and now see it's pretty quickly right showing the vortex or the wind direction so that is the normal situation but what we have to do if you want to increase this intensity or the vector size and thickness we can do that how can we do that so we have our option okay and that is the vector that is the arrow okay we can even use dot we can use this arrow and the spacing you can use this b that is and you can use the color as well you can change the color for the time being okay i can change the color to blue the black is okay you can even change it to red because the background is red so i'm gonna use black okay and here this time i'm feeding this data so now it changed right and then you can even change the label and vector to red that is also possible and it will be visible right this is still not visible so what i'm gonna do i can change it to perfect red maybe this time but i think black is okay right black is okay and you can change the width and it is 100 and then you can change the spacing as well spacing is now this one if i reduce the spacing like 75 let's see you have to just play with all of them right now it's the dense one it's showing okay i have the i and i have that vector velocity vector now it looks pretty good right and but see in the color bar you can see it is showing the square root of this is 20 squared plus not being squared i don't need that right i have to change it that's why i was mentioning this one custom custom so what i can do that is the wind speed now you can use that is the wind speed okay that is windy speed in what meter per second you can use even that so we have the wind speed in meter per second and then see the header it is showing the eastward wind because the basic right the previous overlay was the stored wind we can change that right the level here we can see the wind speed plot or the wind speed uh wind speed map or wind speed or a special distribution of wind speed you can write anything right special distribution of wind speed of hurricane florence okay hurricane or you can florence you can write that florence that's it okay when you have that now you can save it and you can use that plot right even you can manipulate everything and greet for the grid you can do the same thing for overlay you can do the same thing right the for overlay you can use the other one that i used previously to perfectly locate the or or perfectly show the stroller lines right so that's it and if you want to change that everything is possible overlay greed as before we can select this time five and this time we can select labels as well yeah i selected the five degree by five degree and every grid line is gonna show you that labels yeah and the size i'm gonna increase it to 10 as well [Music] why it still is taking a while because it's calculating and trying to yeah it's there yeah it's selected but this time it is not even showing anything let me just wait a while yeah i can hear the speed of my machine it is just it's taking it's processing everything so you can do that you can use this kind of panoply to plot the nature of data or even if it is grieve right you can read the variables you can have the size of your uh variable the dimension you will know that and based on that information you can write the code and you can process your data so this is the way we can even preview if you don't have access to any linux machine if you don't have any access to any other machine right so that is the way to see before processing otherwise you can even plot precipitation data right you can plot anything you can plot any distribution you can plot the temperature you can plot the sea surface temperature you can plot pressure like the way i plot it right you can plot anything any variable you can plot even you can plot the time series as well so once it's done we can save we can save it as before and we can use that see it's still taking i changed the size and it is maybe calculating that's why i prefer to use code once i have the code i don't need to click every time okay so i can save it maybe still it is just changing because i already changed to 9.5 so why it's taking too much time yeah yeah it's done okay so even got changed here it's time you have to click i just change it to every grid line maybe unintentionally i even selected that non value still maybe it is changing let's see that is the merit and demerit you can select right okay so i prefer to use code but i also prefer to use this one as well because for the beginners you need to plot this way you can't even plot this color right and if you want to change the color you have the options as well you can you can do that yeah if you click on the contour you can click on the shading you can just play with all of them right it's not a no the interface is not that complex it is pretty simple but the tool is effective sometimes for plotting purpose it is pretty effective i can say that maybe it is waiting for task nine task is oh okay so that's it i don't wanna wait for long time here okay so i can save it as as before and i can do that i'm not gonna repeat everything so that's it okay so thank you very much for watching this video and you can try by yourself so if you just watch it okay it's working for any other people it may not work for you right i already have demonstrated how to download different types of net cdf files then you can download i hope that you can do and once you have the file you can try and if you practice you will be able to do that right and if you have any problem or any query then you can just let me know if i get time definitely i'll get back to you but you can i think you are the smart people you can find it out by yourself as well so thank you very much for watching and stay safe see you in the next tutorial okay bye
Info
Channel: Md Arifur Rahmahn
Views: 351
Rating: undefined out of 5
Keywords: Python programming, listing directory, for loop, read csv file, multiple directories, time series conversion, time series interpolation, read nercdf file, mrms, nldas, ghcn, panoply, nercdf plot, grib data plot
Id: EGmuHBS09Go
Channel Id: undefined
Length: 36min 46sec (2206 seconds)
Published: Fri Sep 03 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.