-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]: How to download met data for use in back trajectories #367
Comments
I can't seem to recreate your issue on my end, everything seems to install successfully. Perhaps there was a temporary issue with NOAA, is it still failing now? getMet <- function(year = 2018:2023, month = 1:12, path_met = 'TrajData/')
{
for (i in seq_along(year))
{
for (j in seq_along(month))
{
download.file(url=paste0('ftp://arlftp.arlhq.noaa.gov/pub/archives/reanalysis/RP',
year[i],sprintf('%02d',month[j]),'.gbl'),
destfile=paste0(path_met,'RP',year[i],sprintf('%02d',month[j]),'.gbl'),
mode='wb')
}
}
}
getMet(year = 2018,
month = 2:12,
path_met = 'temp/')
fs::dir_ls("temp")
#> temp/RP201802.gbl temp/RP201803.gbl temp/RP201804.gbl temp/RP201805.gbl
#> temp/RP201806.gbl temp/RP201807.gbl temp/RP201808.gbl temp/RP201809.gbl
#> temp/RP201810.gbl temp/RP201811.gbl temp/RP201812.gbl Created on 2023-09-18 with reprex v2.0.2 |
Yes, |
Ah - if your WiFi is poor, or if the NOAA servers are being slow, it is likely that R's in-built "timeout" time is being reached. You can increase it as in this SO thread: https://stackoverflow.com/questions/35282928/how-do-i-set-a-timeout-for-utilsdownload-file-in-r getOption('timeout')
# [1] 60
options(timeout=100) |
Ok i downloaded this file from another sources but not when i am trying to make the .gbl file in .Rdate using this code Code if (month==0) Add first linewrite.table(paste('echo',met,' >>CONTROL'), procTraj <- function(lat=25.8154,lon=79.9187, year= 2021,name='IGP_CARE', lapply(c('openair','plyr','reshape2'),require,character.only=TRUE) setwd(paste0(hy.path,'/working/')) Remove existing 'tdump' files//path.files <- paste0(hy.path,'/working/') start <- paste(year,'-01-01',sep='') for (i in 1:length(dates))
} file.name <- paste(out,name,Year,'.RData',sep='') read.files <- function(hours = 120, hy.path) files <- Sys.glob('tdump*') for (i in files) { traj_NS <- read.table(paste0(hy.path,'working/Rcombined.txt'),header=FALSE) traj_NS <- rename(traj_NS, c(V1='receptor',V3='year',V4='month',V5='day', year <- traj_NS$year[1] traj_NS$date2 <- with(traj_NS, ISOdatetime(year,month,day,hour,min=0,sec=0,tz="Asia/Calcutta")) traj_NS$date <- traj_NS$date - 3600 * traj_NS$hour.inc for(i in 2020){ load("~/TrajProc/IGP_CARE2021.Rdata") I am getting this error |
I am trying to download the back trajectory data but its not make 23mb the .gbl file which is not completed
The text was updated successfully, but these errors were encountered: