Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Get a list of sds names
- sds <- get_subdatasets('C:\Users\Thomas\Desktop\NASA Sat Data\Cloud Layer Data\CAL_LID_L2_333mCLay-ValStage1-V3-01.2011-08-16T03-02-01ZN.hdf')
- # Isolate name of subdataset and convert
- name <- sds[25]
- filename <- 'Cloud_Top_Height_Test.tif'
- gdal_translate(name, dst_dataset = filename)
- # Load the Geotiff created into R
- r <- raster(filename)
- # fix extent, projection and negative values
- e <- extent(-80.016243, 64.831413, -179.183868, -1.711731)
- r <- setExtent(r, e)
- values(r)[values(r) < 0] = 0 # replace -9999 with NA
- crs(r) <- '+proj=utm +zone=28 +ellps=WGS84 +datum=WGS84 +units=m +no_defs'
Add Comment
Please, Sign In to add comment