File:Chaco precipitation 0 2000 ad 1.svg

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

Original file(SVG file, nominally 2,160 × 720 pixels, file size: 198 KB)

Captions

Captions

Chaco Canyon precipitation 0 - 2000 AD

Summary

[edit]
Description
English: Chaco Canyon precipitation 0 - 2000 AD
Date
Source Own work
Author Merikanto

This plt is based on "Southwestern USA Growing Degree Days and Precipitation Reconstructions"

R. Kyle Bocinsky, Johnathan Rush, Keith W. Kintigh and Timothy A. Kohler. 2016. Exploration and exploitation in the macrohistory of the pre-Hispanic Pueblo Southwest. Science Advances, 2(4), e1501532. doi: 10.1126/sciadv.1501532 NOAA Study Page: https://www.ncei.noaa.gov/access/paleo-search/study/19783 JSON Metadata: https://www.ncei.noaa.gov/access/paleo-search/study/search.json?xmlId=17591 DIF Metadata: http://www1.ncdc.noaa.gov/pub/data/metadata/published/paleo/dif/xml/noaa-recon-19783.xml ISO Metadata: http://www1.ncdc.noaa.gov/pub/data/metadata/published/paleo/iso/xml/noaa-recon-19783.xml DOI: https://doi.org/10.25921/8ctk-8v26

R code to download data and plot curve. In Linux, uses pdf2svg.


                                                                                        1. 3
    1. southwest usa 2000 years data temperature, precipitation curve
    2. "R"
    1. 15.01.2024 v 0000.002

library(raster) library(ncdf4) library(terra) library(pals)


download_data=1

    1. mesa verde
  1. sitename1<-"Mesa Verde"
  2. plat1<- 37.183889
  3. plon1<- -108.488611
    1. chaco

sitename1="Chaco Canyon" plat1=36.058333 plon1 =-107.958889

yeara=1 yearb=2000


title1<-paste0(sitename1, " annual precipitation ",as.character(yeara)," - ",as.character(yearb)," AD") konvo1<-paste0("pdf2svg out.pdf ",gsub(" ","_",tolower(sitename1)),"_precipitation_",as.character(yeara),"_",as.character(yearb),"_1.svg")


slat1=as.character(as.integer(plat1)) slon1=as.character(as.integer(abs(plon1))+1)


print(slat1) print(slon1)

nametrunc1=paste0(slon1, "W", slat1, "N")

iname1<-paste0(nametrunc1, "_GDD.nc4") iname2<-paste0(nametrunc1, "_PPT.nc4")


print(iname1) print(iname2)


urlbase1<-"https://www.ncei.noaa.gov/pub/data/paleo/treering/reconstructions/northamerica/usa/bocinsky2016/" url1<-paste0(urlbase1, iname1) url2<-paste0(urlbase1, iname2)


if(download_data==1) { download.file(url = url1,destfile = iname1) download.file(url = url2,destfile = iname2) }


  1. quit(-1)


ncin1<- nc_open(iname1)


lon <- ncvar_get(ncin1, "longitude") lat <- ncvar_get(ncin1, "latitude") t <- ncvar_get(ncin1, "Year")

  1. print(t)


  1. stop(-1)
  1. pdsi0 <- ncvar_get(ncin1, "SPI")


gbrick1<-brick(iname1) pbrick2<-brick(iname2)



  1. plot(gbrick1)
  2. plot(pbrick2)


temp_series <- extract(gbrick1, SpatialPoints(cbind(plon1,plat1)), method='simple') precip_series <- extract(pbrick2, SpatialPoints(cbind(plon1,plat1)), method='simple')

  1. print(temp_series)
  1. plot(temp_series)
  1. y<-temp_series

y0<-precip_series

x0<-1:length(y0)

  1. x2<-x0
  2. y2<-y0

print(x0)

idx1<-which(x0==yeara, arr.ind=T) idx2<-which(x0==yearb , arr.ind=T )

print(idx1) print(idx2)

x<-x0[idx1:idx2] y<-y0[idx1:idx2]

  1. stop(-1)


df2<-data.frame(cbind(x,y)) names(df2)<-c("x", "y")

ymean2<-mean(y)


fit1 <- smooth.spline(x, y, all.knots=F, nknots=501)


pdf(file = paste0("out.pdf"), width = 24, height = 8, colormodel = "rgb")

plot(x,y, type="l", lwd=2,

  1. col="#af7070",

col="#7070af",

lty=1, main=title1,

       xlab="Year AD",
       ylab="precipitation mm",
       cex.lab=2, cex.axis=1.5, cex.main=2, cex.sub=1.5
       ,xaxt="n"
       )


axis(1, at = seq(0, 2000, by = 100), cex.axis=1.5)

  grid(nx = NULL, ny = NULL,
    lty = 2,      # Grid line type
    col = "gray", # Grid line color
    
    lwd = 1)  
  
  1. lines(x,y , col="#af7070", lwd=2,add=T)
lines(x,y , col="#7070af", lwd=2,add=T)   
abline(h=ymean2,  col="#007f00", lwd=3,add=T )
  1. lines(x,y , col="#3f0000", lwd=5,add=T)


  1. Add the smooth curve to the plot
  2. lines(fit1, col = "#7f0000", lwd = 4)

lines(fit1, col = "#00007f", lwd = 4)

  1. lines(valu2, col = "blue", lwd = 2 )
  1. axis(1, xaxp=c(700, 1800, 19), las=2)


  1. lines(x,y,col = "red",lwd = 4, add=T)


dev.off()


system(konvo1)

print(".") quit("yes")

  1. dev.off()


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
current11:40, 15 January 2024Thumbnail for version as of 11:40, 15 January 20242,160 × 720 (198 KB)Merikanto (talk | contribs)code update
18:39, 10 January 2024Thumbnail for version as of 18:39, 10 January 20242,160 × 720 (194 KB)Merikanto (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

Metadata