This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# % bash mode | |
# cdo -selvar,mslp zoom_mslp2018.nc pp.nc | |
# % qui seleziono per togliere variabili a bischero. | |
# cdo griddes mslp.nc >oldgrid.txt | |
# % ottengo info sulla grid | |
# % dopo cambio xsize ysize e gridsize nel file txt che ho creato | |
# % Occhio devono essere coerenti.Salvo come newgrid.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(raster) | |
library(sp) | |
library(spatialEco) | |
library(XLConnect) | |
############################################################################### | |
setwd("") | |
ras1<-raster('fileA') | |
ras2<-raster('fileB') | |
############################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Description: Code using deSolve for some simple ecological ODE models | |
#' There are 3 examples, one is a simple LV Pred-Prey example with plots | |
#' The next is a Macarthur-Wilson model with plots of both the species curve and the equlibrium points | |
#' The last plot is a quick crack at putting stochasticity into the model by adding oscillations in I with t. | |
#' LV code is modified from a blog post here: http://assemblingnetwork.wordpress.com/2013/01/31/two-species-predator-prey-systems-with-r/ | |
#' Other additions are my own | |
#' | |
#' Author: Edmund Hart | |
#' Date: 3/28/2013 | |
#' E-mail: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(plantnet) | |
key="" # get keys | |
imageURL=c("https://munapptplants.github.io/plants_2020/plant_orchi_munap1.jpeg", | |
"https://munapptplants.github.io/plants_2020/plant_orchi_munap2.jpeg") | |
classifications <- identify(key, imageURL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages("xts","zoo","growthrates","rio","R0") | |
library(xts) | |
library(zoo) | |
library(growthrates) | |
library(rio) | |
library(R0) | |
############################################################################################################################################################################### | |
# retrieve data | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process_UKCP12km=function(file,res=12000,bandN=1) { | |
require(raster) | |
require(proj4) | |
tmn<-suppressWarnings(raster(file,band=bandN)) | |
lon=unique(coordinates(tmn)[,1]) | |
lat=sort(unique(coordinates(tmn)[,2])) | |
xyGrid<-matrix(c(rep(lon,length(lat)),rep(lat,each=length(lon))),ncol=2) | |
xyGrid.wgs84<-proj4::project(xyGrid,proj="+proj=ob_tran +o_proj=longlat +lon_0=378 +o_lon_p=0 +o_lat_p=39.25 +a=6371229 +b=6371229 +to_meter=0.0174532925199 +wktext",inverse=T) #to project in latlong | |
xyGrid.wgs84<-SpatialPointsDataFrame(coords=xyGrid.wgs84,data=data.frame(z=values(flip(tmn,direction='y'))),proj4string=CRS('+init=epsg:4326')) | |
xyGrid_3035<-spTransform(xyGrid.wgs84,CRS('+init=epsg:3035')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exportXYZ=function(r,nameout="outfile,txt",sep="\t") { | |
require(sp) | |
require(raster) | |
m=data.frame(sp::coordinates(r),z=raster::getValues(r)) | |
write.table(m, file=nameout,sep=sep , col.names = F, row.names = F) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##' Function readDFile | |
##' | |
##' Function readDFile | |
##' @param pathname the pathname of the directory containing the data to import | |
##' @return outData Output is a matrix of ion counts with rows as scantime and | |
##' columns as mass, and the respective values as labels | |
##' @export | |
readDFile<-function(pathname){ | |
filename<-file.path(pathname,'DATA.MS') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
month2season=function(x,mseq="DJF",label=F){ | |
result=x | |
res=list() | |
for ( i in 1:12) { | |
res[[i]]=which(x==i) | |
} | |
labels=c(1,2,3,4) | |
if(label==T) {labels=c("DJF","MAM","JJA","SON")} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export UDUNITS2_XML_PATH=/usr/share/xml/udunits/udunits2.xml > etc/environement |
NewerOlder