Skip to content

Instantly share code, notes, and snippets.

@practice
Created November 2, 2018 07:21
Show Gist options
  • Save practice/b590633b53bce67d30bac6943f172bfa to your computer and use it in GitHub Desktop.
Save practice/b590633b53bce67d30bac6943f172bfa to your computer and use it in GitHub Desktop.
Reading hdf5, hdf4, netcdf with R
@practice
Copy link
Author

practice commented Nov 6, 2018

Reading NetCDF4

netcdf 유틸리티 설치

$ apt-get install libnetcdf-dev netcdf-bin

R에서

install.packages("ncdf4")
library(ncdf4)
ncfile <- nc_open("S5P_RPRO_L2__NO2____20180301T021947_20180301T040315_01968_01_010001_20180522T003757.nc")

? nc_open

str(ncfile)
no2 <- ncvar_get(ncfile, "QA_STATISTICS/nitrogendioxide_total_column_pdf_axis")
no2

aero <- read.csv("19930101_20181027_XiangHe.lev20", skip = 6, header = TRUE)
head(aero[c(1,2,19)])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment