USAF station code with leading zeros
Closed this issue · 3 comments
Deleted user commented
Hi
thank you for the great package!
There might be a small bug. The USAF code in dlGsodStations is numeric, but some stations starts with 0, ftp://ftp.ncdc.noaa.gov/pub/data/gsod/2016/ and so cannot be downloaded.
dlGsodStations(usaf=7026, start_year=2014, end_year=2015)
Processing GSOD station 7026 (WXPOD 7026) ...
trying URL 'ftp://ftp.ncdc.noaa.gov/pub/data/gsod/2014/7026-99999-2014.op.gz'
instead of ftp://ftp.ncdc.noaa.gov/pub/data/gsod/2014/007026-99999-2014.op.gz
Thx
Christof
Deleted user commented
the following littel changes in dlGsodStations and gzGsodStations might correct this ;)
dlbase <- paste0(sprintf("%06d", dl_usaf$USAF), "-", dl_usaf$WBAN, "-", year, ".op.gz")
fls <- list.files(dsn, pattern = paste(sprintf("%06d", usaf), ".gz$", sep = ".*"), full.names = TRUE)
fdetsch commented
I'll have a look into it soon. Thanks for reporting the issue!