This example, originates in this GMT Forum post, and computes the relative humidity of the air from grids of temperature and dew-point temperature. Some meteorological models only provide the temperature and dew-point temperature, so if one wants relative humidity, it is necessary to compute it from these two related variables.
usingGMTGMT.resetGMT() # hide# Download air temperature at 2 meters and dew point temperature at 2 metersecmwf(:forecast, vars="2t", filename="2td.grd") # TemperatureT =gmtread("2td.grd");ecmwf(:forecast, vars="2d", filename="2td.grd") # Dew point temperatureTd =gmtread("2td.grd");rm("2td.grd") # Hide remove the temporary file# Function to compute the relative humidityesat(x) =6.0178*exp.(17.27*x ./ (x .+237.3))Grh =100*esat(Td) /esat(T);viz(Grh, proj=:guess, title="Relative humidity", colorbar=true)
[ Info: Downloading 2t and saving to 2td.grd
[ Info: Downloading 2d and saving to 2td.grd
Wind barbs
usingGMTGMT.resetGMT() # hide# Download the ecmwf forcasts for the _u_ and _v_ components of the wind at 10 meters above the surfaceecmwf(:forecast, var="10u", limits="IHO23", filename="u10.grd")ecmwf(:forecast, var="10v", limits="IHO23", filename="v10.grd")windbarbs("u10.grd", "v10.grd", Q="0.25c+s20+w0.15c", I="x10", proj=:guess)rm("u10.grd") # Hiderm("v10.grd") # Hidecoast!(shore=true, show=true)
[ Info: Downloading 10u and saving to u10.grd
[ Info: Downloading 10v and saving to v10.grd