Climate Data Tools CDT
is a set of utility functions for meteorological data quality control, homogenization and merging station data with satellite and others proxies such as reanalysis, all functions are available in the GUI mode.
Go to the CRAN website CRAN.
Then click on the link Download R for Windows and base. Download the latest version of R
.
Install the downloaded file (example: R-4.3.0-win.exe). Perform a default installation (Just click on Next).
CDT requires R version 4.0.0 or higher. It is recommend to have the latest version of R.
Go to the CRAN website CRAN.
Then click on the link Download R for Windows and Rtools. Download the recommended version of Rtools
compatible with your R version.
Install the downloaded file. Follow the installation instructions displayed on the page.
Open R
and install devtools
package with:
install.packages("devtools")
Now, you can install the the development version of CDT
from GitHub with:
library(devtools)
install_github("rijaf-iri/CDT")
Type XQuartz
in Apple's search, if you don't find it, that means XQuartz
is not installed yet. It's better to update XQuartz
to the latest version if it is already installed.
Download and install it from https://www.xquartz.org.
Restart your computer.
Check if the Tcl/Tk
libraries are already installed in your computer. Open a terminal and run the following command:
echo 'puts $tcl_library;exit 0' | tclsh
If Tcl/Tk
libraries are installed in your computer, you should get the path to the Tcl library like this: /usr/local/lib/tcl8.6
.
If Tcl/Tk
libraries are not yet installed in your computer, you can install ActiveTcl®. Go directly to the ActiveTcl® installation below.
Check if the package Tktable
is installed. Run the following command from terminal:
echo 'puts [package require Tktable];exit 0' | tclsh
If the package is installed, you should have the version number of the package. If Tktable
is not installed, you can download it from here.
Change to the directory where you downloaded Tktable
archive file.
cd ~/path/to/Tktable/archive
Uncompressed the archive file.
tar -zxvf Tktable2.10.tar.gz
This will create a subdirectory Tktable2.10
with all the files in it. Change to this directory.
cd Tktable2.10
The default installation path of Tktable
is under /usr/local
. If the Tcl Library Path directory is under this directory, you can install Tktable
by default using the following commands:
./configure
make install
If Tcl Library Path directory is anywhere else. Check the auto_path
global variable using the following command
echo 'puts $auto_path;exit 0' | tclsh
You should have a list of directories like this: /usr/local/lib/tcl8.6
/usr/local/lib
. You need to set the --prefix
option of configure
./configure --prefix=/usr/local
make install
Check if the package BWidget is installed. Run the following command from terminal:
echo 'puts [package require BWidget];exit 0' | tclsh
If the package is installed, you should have the version number of the package. If BWidget
is not installed, you can download it from here.
Unzipped the file bwidget-1.9.12.zip
and copy it under the Tcl Library Path directory. Copy the bwidget directory bwidget-1.9.12
under one of the auto_path
global variable directories.
Note If you install
Tktable
andBWidget
anywhere else, remember the path you put the packages, you will need it when you installCDT
.
Download ActiveTcl® from https://www.activestate.com/products/activetcl/downloads/.
ActiveTcl® executables will be installed (wish
, tclsh
and tkcon
) in /usr/local/bin
and the library will be put in /usr/local/lib/tcl8.6
or /usr/local/lib/tcl8.5
depending on the version.
Tktable
will be put in /Library/Tcl/teapot/package/macosx10.5-i386-x86_64/lib/Tktable2.11
and BWidget
in /Library/Tcl/teapot/package/tcl/lib/BWidget1.9.8
.
Download and install GDAL
binaries from http://www.kyngchaos.com/software/frameworks. Install the latest version of GDAL Complete.
GDAL
will be installed in /Library/Frameworks/GDAL.framework
,
GEOS
in /Library/Frameworks/GEOS.framework
and PROJ
in /Library/Frameworks/PROJ.framework
.
The configuration files are located in
GEOS
: /Library/Frameworks/GEOS.framework/unix/bin/geos-config
GDAL
: /Library/Frameworks/GDAL.framework/unix/bin/gdal-config
And PROJ
include
and lib
are located in /Library/Frameworks/PROJ.framework/unix/include
and
/Library/Frameworks/PROJ.framework/unix/lib
respectively.
Remember these paths, you will need them when you install the package rgdal
and rgeos
on R
.
Download and install R
binary for your MacOS X version from https://cran.r-project.org/bin/macosx
CDT requires R version 4.0.0 or higher. We recommend that you have the latest version of R.
Open R
and install devtools
package with:
install.packages("devtools")
Now, you can install the development version of CDT
from GitHub with:
library(devtools)
install_github("rijaf-iri/CDT")
If you get a warning message telling you that Tktable
or BWidget
not found, you need to edit CDT's local configuration for Tcl: ~/Library/Application Support/CDT/config/Tcl_config.json
.
Go to the MacOS configuration and change Tktable.auto
or Bwidget.auto
to false
, then set the full path to Tktable
or BWidget
directory with Tktable.path
or Bwidget.path
, as shown in the following example:
"MacOS": {
"Tktable.auto": false,
"Tktable.path": "/Library/Tcl/teapot/package/macosx10.5-i386-x86_64/lib/Tktable2.11",
"Bwidget.auto": false,
"Bwidget.path": "/Library/Tcl/teapot/package/tcl/lib/BWidget1.9.8"
},
After editing Tcl_config.json
, save it. Open a new R
session and load and start CDT
.
Check if the Tcl/Tk
libraries are already installed in your computer, make sure that the *-dev
packages are installed. If not, you can install it with:
sudo apt-get install tk-dev tcl-dev
Check if the Tcl package Tktable
is installed. If it is not installed, you can download it from here.
Check if the Tcl package BWidget
is installed. If it is not installed, you can download it from here.
Note See MacOS X
Tktable
andBWidget
installation.
Add the PPA
to your sources
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update && sudo apt-get upgrade
Install GDAL
sudo apt-get install gdal-bin libgdal-dev
Verify the installation with
ogrinfo
Get the installation path of gdal-config
and geos-config
. Save these paths somewhere, you will need it later when installing the R
packages rgdal
and rgeos
.
sudo apt-get install netcdf-bin libnetcdf-dev
Install R
if not installed yet.
Add the R
repository to your sources
CDT requires R version 4.0.0 or higher. We recommend that you have the latest version of R, this implies that you have to install R from source.
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -sc)/"
sudo apt-get update
Add GPG key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
Install R
sudo apt-get install r-base r-base-dev
sudo apt-get install r-cran-ncdf4
You can install ncdf4
package with:
## edit the path
nc_config <- '/usr/bin/nc-config'
install.packages('ncdf4', type = "source",
configure.args = paste0('--with-nc-config=', nc_config))
Open R
and install devtools
package with:
install.packages("devtools")
Now, you can install the development version of CDT
from GitHub with:
devtools::install_github("rijaf-iri/CDT")
If you get a warning message telling you that Tktable
or BWidget
not found, you need to edit CDT’s local configuration for Tcl: ~/.local/CDT/config/Tcl_config.json
Go to the Linux configuration and change Tktable.auto
or Bwidget.auto
to false
, then set the full path to Tktable
or BWidget
directory with Tktable.path
or Bwidget.path
.
# Load CDT library
library(CDT)
# Starting CDT
startCDT()
To only update CDT
without updating all dependencies packages, enter the following command on R
console
if(packageVersion("devtools") >= "2.0.0"){
devtools::install_github("rijaf-iri/CDT", dependencies = FALSE,
upgrade = FALSE, force = TRUE)
}else{
devtools::install_github("rijaf-iri/CDT", dependencies = FALSE,
upgrade_dependencies = FALSE, force = TRUE)
}
To update CDT
and all dependencies packages, use
update.packages(ask = FALSE)
devtools::install_github("rijaf-iri/CDT")