How to convert the magnitudes cointained in a nc file and then cut the data according to the data in a shp file with R

18 Views Asked by At

`I have a nc file “no2.nc” with data from reanalysis of cams with concentration values (kg kg ^^-1) with a periodicity of 3 hours between data (8 data per day) for the period 2003-2022. The nc file has one variable (no2) with three dimensions (longitude, latitude and time). I would like to:

  1. Convert these data in ppb, then
  2. Calculate the mean value for all teh period
  3. Calculate daily mean values
  4. Calculate monthly mean values
  5. Calculate seasonal mean values
  6. Represent data from steps (2-5) according to the shp file (NUT map of the Iberian Peninsula). That is I would need to cut the data from nc file according to the shape file. I tried to run the following code but it does not work (I am a begginer user in R):

The code and the files used are available in this link: https://drive.google.com/drive/folders/1icRA51ipsWD2wCmVaSnYJ9fnJEEKinfr?usp=sharing

I did not know how to convert the units of NO2 to ppb neither to calculate the daily, monthly and seasonal data before representing them in a map. Then I could not also cut the data according to the borders of the Iberian Peninsula (shape file containing the NUT map).

0

There are 0 best solutions below