Commit beecd970 authored by Burkhardt Rockel's avatar Burkhardt Rockel

ncdf4Utils version 0.5-2

-------------------------

*Changed functions:*

@ncdf_times.R@ -- changed default time from CET to UTC
                  changed input format of reference time to %Y-%m-%d %H:%M:%

@plot_colourbar.R@ -- changed label "sea" to "water".
                      Direction of the axis description now depends on which side the
                      axis is plotted.

@plotmap.R@ -- grid labels can be set on and of for each axis separately.
               New parameter grid.lwd for the line width of the grid.
               Missing reading of attribute earth_radius for multiple_rotated_pole transformation added.
               Distinguish for 3D variables whether the third dimension is time or level
parent af311da5
ncdf4Utils version 0.5-2
-------------------------
*Changed functions:*
@ncdf_times.R@ -- changed default time from CET to UTC
changed input format of reference time to %Y-%m-%d %H:%M:%
@plot_colourbar.R@ -- changed label "sea" to "water".
Direction of the axis description now depends on which side the
axis is plotted.
@plotmap.R@ -- grid labels can be set on and of for each axis separately.
New parameter grid.lwd for the line width of the grid.
Missing reading of attribute earth_radius for multiple_rotated_pole transformation added.
Distinguish for 3D variables whether the third dimension is time or level
ncdf4Utils version 0.5-1
-------------------------
......
Package: ncdf4Utils
Type: Package
Title: provides plot functions to use with NetCDF data
Version: 0.5-1
Date: 2011-07-31
Version: 0.5-2
Date: 2014-04-10
Author: Jonas Bhend <jonas.bhend@env.ethz.ch>, with contributions
from Burkhardt Rockel <burkhardt.rockel@hzg.de>
Maintainer: Jonas Bhend <jonas.bhend@env.ethz.ch>
......@@ -15,4 +15,4 @@ Description: This package contains numerous functions to plot
License: GPL
LazyLoad: yes
LazyData: true
Packaged: Mon July 31 15:49:000 2010; rockel
Packaged: Thu April 10 17:49:000 2014; rockel
exportPattern("^[^\\.]")
`ncdf_times` <-
function(nc, as.Rdate=TRUE, force=TRUE, tz="CET") {
function(nc, as.Rdate=TRUE, force=TRUE, tz="UTC") {
# this function converts netcdf times to the
# R date-time format or to the udunits dates
# you can choose to switch to uduints format
......@@ -48,12 +48,15 @@ function(nc, as.Rdate=TRUE, force=TRUE, tz="CET") {
}
times <- vals * mul
if (nchar(ref.txt) == 19){
ref <- as.POSIXct(ref.txt, tz)
} else {
ref <- as.POSIXct(paste(ref.txt, "00", sep=":"), tz)
}
time <- as.Date(ref + times)
# if (nchar(ref.txt) == 19){
# ref <- as.POSIXct(ref.txt, tz)
# } else {
# ref <- as.POSIXct(paste(ref.txt, "00", sep=":"), tz)
# }
# time <- as.Date(ref + times)
ref <- strptime(ref.txt, format = "%Y-%m-%d %H:%M:%S", tz = tz)
time <- ref + times
}
if (charmatch("days since", units, nomatch=0)){
......
......@@ -12,6 +12,8 @@ function(levs, cols, side=1, ylab="", labels=NULL,
# if sea.col is set, the colourbar is prolonged by one
# colour with the uncentered label sea underneath
las<-c(1,3,1,3)
sea.add <- 0
if (!is.null(sea.col)) {
cols <- c(sea.col, cols)
......@@ -46,7 +48,7 @@ function(levs, cols, side=1, ylab="", labels=NULL,
axis(side, at=at.lev-0.5,labels=labels, las=1, cex.axis=cex.axis)
}
if (!is.null(sea.col)){
axis(side, at=1, labels="sea", las=1, tick=F, cex.axis=cex.axis)
axis(side, at=1, labels="water", las=las[side], tick=F, cex.axis=cex.axis)
}
box()
}
......@@ -61,8 +63,9 @@ function(x, incl.units=T, side=1, cex.axis=1, center=F, labels=NULL, ...){
labels <- x$flag_meanings
}
}
plot_colourbar(x$lev, x$col, sea.col=x$sea.col, side=side,
las<-c(1,3,1,3)
plot_colourbar(x$lev, x$col, sea.col=x$sea.col, side=side,
cex.axis=cex.axis, center=center, labels=labels, ...)
# plot unit-string in axis
......@@ -75,7 +78,7 @@ function(x, incl.units=T, side=1, cex.axis=1, center=F, labels=NULL, ...){
}
nlev <- length(x$lev)
axis(side, at=nlev/2, labels=unit.string,
tick=F, las=1, line=2, cex.axis=cex.axis)
tick=F, las=las[side], line=2, cex.axis=cex.axis)
} else {
if (!is.null(x$units)){
axis(side, at=length(x$lev)-0.5, labels=x$units,
......
This diff is collapsed.
......@@ -24,7 +24,7 @@
\section{Warning}{
The forced conversion to output of class "Date" will lead to wrong dates if non-standard calendars are used!
At present, the conversion of times with a reference to time zones other than GMT could be flawed (R objects of class date are not aware of time zones). Please carefully check the times when working with data from different time zones.
At present, the conversion of times with a reference to time zones other than GTC could be flawed (R objects of class date are not aware of time zones). Please carefully check the times when working with data from different time zones.
}
\seealso{\code{\link[ncdf4]{nc_open}},\code{\link{as.Date}}, \code{\link{as.POSIXct}}}
\examples{
......
......@@ -27,7 +27,7 @@ plotmap(file, file.small = NULL, sponge = 8,
\item{sponge}{Number of grid cells to mask out at boundary}
\item{sponge.small}{... for the nest in the large region}
\item{varname}{Variable to plot (defaults to \code{HSURF} for orography or any variable with at least lon and lat dimensions)}
\item{lsm.file}{Additional file containing land-sea mask and/or altitude information in \code{FR\_LAND} and \code{HSURF}}
\item{lsm.file}{Additional file containing land-sea mask and/or altitude information in \code{FR_LAND} and \code{HSURF}}
\item{lsm.file.small}{... for the nest in the large region}
\item{col}{Colours to use}
\item{levels}{Levels to use}
......@@ -41,10 +41,11 @@ plotmap(file, file.small = NULL, sponge = 8,
\item{city.pch}{Symbol for city points}
\item{cex.txt}{Character expansion for city labels}
\item{alt.contour}{Switch for usage of the coastline as in file or lsm.file}
\item{alt.lev}{Level at which to draw coastline (if alt.contour == TRUE) in units of "\code{FR\_LAND}"}
\item{alt.lev}{Level at which to draw coastline (if alt.contour == TRUE) in units of "\code{FR_LAND}"}
\item{grid}{Switch for inclusion of grid lines}
\item{grid.txt}{Switch for inclusion of grid axis labels at the border of the plot}
\item{grid.txt}{Switch for inclusion of grid axis labels at the border of the plot. Can be set for each side separately by using grid.txt=c(T,T,T,T)}
\item{grid.lty}{Line type for grid lines}
\item{grid.lwd}{Line width for grid lines}
\item{i.time}{Time step to plot}
\item{i.lev}{Level to plot}
\item{map.lwd}{Line width for the coastline/ country border}
......@@ -66,7 +67,7 @@ plotmap(file, file.small = NULL, sponge = 8,
\item{polgam}{Rotation angle about the North-South-Pole axis in the rotated system}
For multiple rotated pole grid mapping:
\item{loncent}{center longitude of the transformed system in degrees}
\item{latcent}{center longitude of the transformed system in degrees}
\item{latcent}{center latitude of the transformed system in degrees}
\item{false_easting}{false easting of x, i.e. shift of x-coordinate}
\item{false_northing}{false northing of y, i.e. shift of y-coordinate}
\item{earth_radius}{earth radius in meter}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment