File:Maya area drought index pdsi yearv 1418 1.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 473 × 576 pixels, file size: 1.3 MB)

Captions

Captions

Maya-area drought index PDSI on year 1418

Summary[edit]

Description
English: Maya-area drought index PDSI on year 1418
Date
Source Own work
Author Merikanto

This plot is based on Mexican drought atlas

David W. Stahle, Edward R. Cook, Dorian J. Burnette, Jose Villanueva, Julian Cerano, Jordan N. Burns, Daniel Griffin, Benjamin I. Cook, Rodolfo Acuna, Max C.A. Torbenson, Paul Sjezner, Ian M. Howard. 2016. The Mexican Drought Atlas: Tree-ring reconstructions of the soil moisture balance during the late pre-Hispanic, colonial, and modern eras. Quaternary Science Reviews, 149, 34-60. doi: 10.1016/j.quascirev.2016.06.018

https://www.ncei.noaa.gov/access/paleo-search/study/20353

Homegape of Mexican drought atlas, 2014

http://drought.memphis.edu/MXDA/

R script to process pre-processed data

Separators to semicolon ;

    1. mexico drought hisrtorical pdsi data

library(raster) library(ncdf4) library(terra) library(pals) ##palettes

library(RColorBrewer)

    1. year to map plot
  1. year1=1418
  2. year1=1946
    1. year1=2004

year1=1418

    1. coordinates where from take data
    1. tikal
  1. pox1=-89.622778
  2. poy1=17.221944
    1. uxmal

pox1=-89.771389 poy1=20.359444


gp0<-read.csv("./northdata1/mex/mxda-grid-points_1.csv",

               header = F, sep = ";")
               
  1. print(head(gp0))

lons1<-as.vector(gp0$V2) lats1<-as.vector(gp0$V3)

  1. print(lons1)
  2. print(lats1)


  1. quit(-1)


data0 <- read.csv("./northdata1/mex/mxda-recon-jja-scpdsi-1400-2012_2.csv",

               header = F, sep = ";")
    
  1. print(head(data0))

d0<-as.matrix(data0)

  1. print(d0)
  1. print (dim(d0))
  1. stop(-1)
  1. Periods of frequent drought centered at the years 1483, 1533, 1571, 1601, 1650, 1691, 1730, 1783, 1818, and 1860 have been identified.

n1=year1-1400

d10<-as.numeric(d0[n1,])

  1. print(d10)

d1<-d10[-1]

  1. print(d1)

len1=length(d1)

  1. print(len1)
  1. print (length(lons1))

df1<-data.frame(cbind(lons1, lats1, d1))

names(df1)<-c("x","y","pdsi")

  1. print (head(df1))

r1 <- rasterFromXYZ(df1)


sr1<-rast(df1)

  1. plot(sr1)

col1<-colFromX(sr1, pox1) row1<-rowFromY(sr1, poy1)

x1<-xFromCol(sr1, col1)

y1<-yFromRow(sr1, row1)

  1. print(x1)
  2. print(y1)

idxe1 <- match(df1$x, x1) idxe2 <- match(df1$y, y1)

  1. print(idx1)

idxe3<-idxe1*idxe2

  1. print(idxe3)

idx1<-which(idxe3==1)

years1<-data0[,1] pdsis1<-data0[,1+idx1]

pd1<-data.frame(cbind(years1, pdsis1)) names(pd1)<-c("year", "pdsi")

print (head(pd1, 32))

print("idx year pdsi") print(idx1) print(years1[idx1]) print(pdsis1[idx1])

print(pd1$year[1+idx1])

  1. lowestyears1<-pd1[pd1$pdsi<-1,]
  2. print(lowestyears1)
  1. lowest1<-pd1[as.numeric(pd1$pdsi) <-3.0]
  1. print(lowest1)
  1. quit(-1)

minidx1<-which.min(pdsis1)

  1. print(minidx1)

minyear1<-minidx1+1400

print(minyear1)

  1. print(years1)
  1. plot(r1)

pal <- colorRampPalette(c("brown","yellow","green","blue"))

plot(years1, pdsis1, type="l")

  1. lines

plot(r1,

col=pal(256),

main="Maya area annual P/PET percent",

       xlab="longitude",
       ylab="latitude")
       #sub="Aridity P/PET %")

contour(r1, add=T, alpha=50)

points( c(-89.622778), c(17.221944), col = "red",pch=2, cex=2, lwd=1, add=T)
points( c(-89.771389), c(20.359444), col = "red",pch=2, cex=2, lwd=1, add=T)


text(c(-89.622778 ),c(17.221944 ), labels=c("Tikal"), cex= 1, pos=3) text(c(-89.771389), c(20.359444), labels=c("Uxmal"), cex= 1, pos=3)

dev.off()

  1. system("pdf2svg Rplots.pdf maya_area_pdsi.svg")

crs(r1)<-"lonlat"

writeRaster(r1 , filename="mexico_pdsi.nc", bandorder='BSQ',format="NetCDF", overwrite=TRUE)


GMT6 bash unix plotting script

    1. mexico drought hisrtorical pdsi data

library(raster) library(ncdf4) library(terra) library(pals) ##palettes

library(RColorBrewer)

    1. year to map plot
  1. year1=1418
  2. year1=1946
    1. year1=2004

year1=1418

    1. coordinates where from take data
    1. tikal
  1. pox1=-89.622778
  2. poy1=17.221944
    1. uxmal

pox1=-89.771389 poy1=20.359444


gp0<-read.csv("./northdata1/mex/mxda-grid-points_1.csv",

               header = F, sep = ";")
               
  1. print(head(gp0))

lons1<-as.vector(gp0$V2) lats1<-as.vector(gp0$V3)

  1. print(lons1)
  2. print(lats1)


  1. quit(-1)


data0 <- read.csv("./northdata1/mex/mxda-recon-jja-scpdsi-1400-2012_2.csv",

               header = F, sep = ";")
    
  1. print(head(data0))

d0<-as.matrix(data0)

  1. print(d0)
  1. print (dim(d0))
  1. stop(-1)
  1. Periods of frequent drought centered at the years 1483, 1533, 1571, 1601, 1650, 1691, 1730, 1783, 1818, and 1860 have been identified.

n1=year1-1400

d10<-as.numeric(d0[n1,])

  1. print(d10)

d1<-d10[-1]

  1. print(d1)

len1=length(d1)

  1. print(len1)
  1. print (length(lons1))

df1<-data.frame(cbind(lons1, lats1, d1))

names(df1)<-c("x","y","pdsi")

  1. print (head(df1))

r1 <- rasterFromXYZ(df1)


sr1<-rast(df1)

  1. plot(sr1)

col1<-colFromX(sr1, pox1) row1<-rowFromY(sr1, poy1)

x1<-xFromCol(sr1, col1)

y1<-yFromRow(sr1, row1)

  1. print(x1)
  2. print(y1)

idxe1 <- match(df1$x, x1) idxe2 <- match(df1$y, y1)

  1. print(idx1)

idxe3<-idxe1*idxe2

  1. print(idxe3)

idx1<-which(idxe3==1)

years1<-data0[,1] pdsis1<-data0[,1+idx1]

pd1<-data.frame(cbind(years1, pdsis1)) names(pd1)<-c("year", "pdsi")

print (head(pd1, 32))

print("idx year pdsi") print(idx1) print(years1[idx1]) print(pdsis1[idx1])

print(pd1$year[1+idx1])

  1. lowestyears1<-pd1[pd1$pdsi<-1,]
  2. print(lowestyears1)
  1. lowest1<-pd1[as.numeric(pd1$pdsi) <-3.0]
  1. print(lowest1)
  1. quit(-1)

minidx1<-which.min(pdsis1)

  1. print(minidx1)

minyear1<-minidx1+1400

print(minyear1)

  1. print(years1)
  1. plot(r1)

pal <- colorRampPalette(c("brown","yellow","green","blue"))

plot(years1, pdsis1, type="l")

  1. lines

plot(r1,

col=pal(256),

main="Maya area annual P/PET percent",

       xlab="longitude",
       ylab="latitude")
       #sub="Aridity P/PET %")

contour(r1, add=T, alpha=50)

points( c(-89.622778), c(17.221944), col = "red",pch=2, cex=2, lwd=1, add=T)
points( c(-89.771389), c(20.359444), col = "red",pch=2, cex=2, lwd=1, add=T)


text(c(-89.622778 ),c(17.221944 ), labels=c("Tikal"), cex= 1, pos=3) text(c(-89.771389), c(20.359444), labels=c("Uxmal"), cex= 1, pos=3)

dev.off()

  1. system("pdf2svg Rplots.pdf maya_area_pdsi.svg")

crs(r1)<-"lonlat"

writeRaster(r1 , filename="mexico_pdsi.nc", bandorder='BSQ',format="NetCDF", overwrite=TRUE)


Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current09:49, 9 January 2024Thumbnail for version as of 09:49, 9 January 2024473 × 576 (1.3 MB)Merikanto (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

Metadata