Skip to content
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

hysplit_trajectory for February 2015 #42

Open
noraini0210 opened this issue Oct 14, 2019 · 2 comments
Open

hysplit_trajectory for February 2015 #42

noraini0210 opened this issue Oct 14, 2019 · 2 comments

Comments

@noraini0210
Copy link

Hi

I am having difficulty with the hysplit trajectory and create_traj_model for February 2015.

library(SplitR)
library(lubridate)

trajectory <-
hysplit_trajectory(
traj_name = "traj",
lat = 6.0086,
lon = 102.4259,
height = 30,
duration = 120,
run_period = c("2015-02-01","2015-02-28"),
daily_hours = c(0, 6, 12, 18),
direction = "backward",
met_dir = "C:/GDAS/",
met_type = "gdas1",
exec_dir= "c:/hysplit4/working.559",
return_traj_df = TRUE)

Error in download.file(url, ...) :
cannot open URL 'ftp://arlftp.arlhq.noaa.gov/archives/gdas1/gdas1.feb15.w5'
In addition: Warning message:
In download.file(url, ...) : InternetOpenUrl failed: ''

I also try to use create_traj_model as suggested previously in August 2019 as followed:
traj_model <-
create_traj_model() %>%
add_grid(lat = 6.0086,lon = 102.4259,range = c(0.8, 0.8),division = c(0.2, 0.2)) %>%
add_params(
height = 30,
duration = 120,
run_period = c("2015-02-01","2015-02-28"),
daily_hours = c(0, 6, 12, 18),
direction = "backward",
met_type = "gdas1",
met_dir = "C:/GDAS/",
exec_dir = "c:/hysplit4/working.559"
) %>%
run_model()

However, I am still encountered the same error:
Error in download.file(url, ...) :
cannot open URL 'ftp://arlftp.arlhq.noaa.gov/archives/gdas1/gdas1.feb15.w5'
In addition: Warning message:
In download.file(url, ...) : InternetOpenUrl failed: ''

@maia2004
Copy link

I have the same problem:

library(splitr)
library(magrittr)

trajectory <-

  • hysplit_trajectory(
  • lat = 40,
    
  • lon = 13,
    
  • height = 500,
    
  • duration = 48,
    
  • days = "2012-07-15",
    
  • daily_hours = c(0,6,12,18),
    
  • direction = "backward",
    
  • met_type = "gdas1",
    
  • extended_met = TRUE,
    
  • traj_name = "prova",
    
  • met_dir = "C:/gdas/", 
    
  • clean_up = FALSE
    
  • )
    trying URL 'ftp://arlftp.arlhq.noaa.gov/archives/gdas1/gdas1.lug12.w1'
    Error in download.file(url, ...) :
    cannot open URL 'ftp://arlftp.arlhq.noaa.gov/archives/gdas1/gdas1.lug12.w1'
    In addition: Warning message:
    In download.file(url, ...) : InternetOpenUrl failed: ''

@rfiorella
Copy link
Contributor

I've been unable to replicate the issue mentioned by @noraini0210 - code seems to run for the most recent code. (Is this code still unable to run for you @noraini0210?)

As for the example @maia2004 posted - this seems to be an issue with the locale argument of lubridate::month within the get_month_* functions? Since arlftp server has data months are all English, I suggest setting locale in lubridate::month to US as a fix.

rfiorella added a commit to rfiorella/splitr that referenced this issue Apr 19, 2020
Default to lubridate::month determines month names based on system locale, can cause an error for non-US users where non-English month names are (rich-iannone#42).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants