Tom Roche avatar Tom Roche committed c00029e

tweak: unhardcode sigdigs

Comments (0)

Files changed (2)

GEIA_global_to_AQMEII_netCDF.sh

 # temporally disaggregate multiple plots
 DATE_FORMAT='%Y%m%d_%H%M'
 export PDF_DIR="${WORK_DIR}"
+export OUTPUT_SIGNIFICANT_DIGITS='3' # in, e.g., PDFs
 
 # Raw input data is GEIA marine N2O emissions in native format.
 # For details, see http://geiacenter.org/presentData/geiadfrm.html

global_to_AQMEII.r

 work.dir <- Sys.getenv('WORK_DIR')
 pdf.fp <- Sys.getenv('GEIA_REGRID_PDF_FP')
 pdf.er <- Sys.getenv('PDF_VIEWER')
+sigdigs <- as.numeric(Sys.getenv('OUTPUT_SIGNIFICANT_DIGITS'))
 in.fp <- Sys.getenv('GEIA_REFORMAT_FP')
 in.band <- Sys.getenv('GEIA_REFORMAT_BAND')
 data.var.name <- Sys.getenv('GEIA_REFORMAT_DATAVAR_NAME')
 # make input raster
 
 library(raster)
-in.raster <- raster::raster(in.fp, varname=data.var.name, band=in.band)
+in.raster <- raster::raster(in.fp, varname=data.var.name) #, band=in.band)
 in.raster
 # class       : RasterLayer 
 # dimensions  : 180, 360, 64800  (nrow, ncol, ncell)
 x.centers <- raster.centers.x(out.raster)
 y.centers <- raster.centers.y(out.raster)
 quantiles <- quantile(out.data.vec, probabilities.vec, na.rm=TRUE)
-quantiles.formatted <- format(as.numeric(quantiles), digits=3)
+quantiles.formatted <- format(as.numeric(quantiles), digits=sigdigs)
 
 # repeat for each plot file
 pdf(file=pdf.fp, width=5.5, height=4.25)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.