Chapter 3 Data transformation
3.1 Data for patterns of climate change
For the data that illustrate the patterns of climate change, we mainly preprocess the data by aggregate the data to month and up to year level so that we can have a clearer view of the pattern over the past two centuries. For the HadCRUT data, We mask out the months with zero coverage to keep the format consistent. We also filter out the data at year level, as we only use this dataset to investigate climate pattern at monthly level. We aggregate the GISTEMP v4 data to yearly level to support analysis on the cause part. Finally, we preprocess the NACR data to the Raster or “gridded” data formatted in pixels to represent an area on the Earth’s surface.
## class : RasterLayer
## dimensions : 4320, 8640, 37324800 (nrow, ncol, ncell)
## resolution : 0.04166184, 0.04165702 (x, y)
## extent : -179.9792, 179.9792, -89.97917, 89.97917 (xmin, xmax, ymin, ymax)
## crs : NA
## source : 1960_tmax.grd
## names : layer
## values : -46.28, 41.71 (min, max)
## class : RasterLayer
## dimensions : 4320, 8640, 37324800 (nrow, ncol, ncell)
## resolution : 0.04166184, 0.04165702 (x, y)
## extent : -179.9792, 179.9792, -89.97917, 89.97917 (xmin, xmax, ymin, ymax)
## crs : NA
## source : 1990_tmax.grd
## names : layer
## values : -42.58, 40.16 (min, max)
## class : RasterLayer
## dimensions : 4320, 8640, 37324800 (nrow, ncol, ncell)
## resolution : 0.04166184, 0.04165702 (x, y)
## extent : -179.9792, 179.9792, -89.97917, 89.97917 (xmin, xmax, ymin, ymax)
## crs : NA
## source : 2020_tmax.grd
## names : layer
## values : -54.7, 43 (min, max)
3.2 Data for causes of climate change
In this part, except the temperature data, we use the data about Earth’s orbit and solar irradiation, and the data about greenhouse gas. For the Milankovitch orbital data, we choose to download the data from 2800s BC to now on the website, and select the variables that is helpful for us to solve problems. The data of four greenhouse gases are separated, so we write functions to read mole fraction data and growth rate data, and combine the data of four gases into one table. For the convenience of following table combination and plotting, the time variables in the tables are transformed to the same format.
3.3 Data for effects of climate change
In this part, the data sets about ice sheet mass in Antarctic, ice sheet mass in Greenland and Global sea level change are in txt. files, so we just simply read the table.
## V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12
## 1 0 11 1993.012 452600 327401.3 -38.61 89.88 -38.78 -38.61 89.88 -38.78 -38.56
## 2 0 12 1993.039 447591 324498.4 -42.01 90.93 -39.80 -42.00 90.93 -39.80 -39.09
## 3 0 13 1993.066 459462 333018.2 -41.97 87.31 -39.65 -41.96 87.31 -39.64 -38.56
## 4 0 14 1993.093 410064 297483.2 -42.71 90.79 -39.69 -42.69 90.79 -39.67 -38.32
## 5 0 15 1993.120 446813 321635.8 -37.88 90.29 -38.78 -37.85 90.29 -38.75 -37.20
## 6 0 16 1993.147 405085 291945.9 -36.10 89.99 -37.73 -36.07 89.99 -37.70 -35.98
Another data set about the extreme events we use is from NOAA database. Since every year’s data is gathered in one csv. file and we wants to use data from 2000 to 2021, we download the 22 csv. files into one folder and then try to compile all the data into one csv. file.