Tom Roche avatar Tom Roche committed c00029e

tweak: unhardcode sigdigs

Comments (0)

Files changed (2)

 # temporally disaggregate multiple plots
 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


 work.dir <- Sys.getenv('WORK_DIR')
 pdf.fp <- Sys.getenv('GEIA_REGRID_PDF_FP') <- Sys.getenv('PDF_VIEWER')
+sigdigs <- as.numeric(Sys.getenv('OUTPUT_SIGNIFICANT_DIGITS'))
 in.fp <- Sys.getenv('GEIA_REFORMAT_FP') <- Sys.getenv('GEIA_REFORMAT_BAND') <- Sys.getenv('GEIA_REFORMAT_DATAVAR_NAME')
 # make input raster
-in.raster <- raster::raster(in.fp,,
+in.raster <- raster::raster(in.fp, #,
 # 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(, 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
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.