Skip to contents

Parse NOAA ISD/ISH csv data files

Usage

isd_parse_csv(path)

Arguments

path

(character) file path. required

Value

A tibble (data.frame)

Details

Note that the `rem` (remarks) and `eqd` columns are not parsed, just as with [isd_parse()].

Column information

- USAF MASTER and NCEI WBAN station identifiers are combined into an 11 character code with the column `station` - Date and Time have been combined to the column `date` - Call letter is synonymous with `call_sign` column - WIND-OBSERVATION is abbreviated as column `wnd` - SKY-CONDITION-OBSERVATION is abbreviated as column `cig` - VISIBILITY-OBSERVATION is abbreviated as column `vis` - AIR-TEMPERATURE-OBSERVATION air temperature is abbreviated as the column header `tmp` - AIR-TEMPERATURE-OBSERVATION dew point is abbreviated as the column `dew` - AIR-PRESSURE-OBSERVATION sea level pressure is abbreviated as the column `slp`

References

https://www.ncei.noaa.gov/data/global-hourly/access/ https://www.ncei.noaa.gov/data/global-hourly/doc/CSV_HELP.pdf https://www.ncei.noaa.gov/data/global-hourly/doc/isd-format-document.pdf

Examples

path <- system.file('extdata/00702699999.csv', package = "isdparser")
(res <- isd_parse_csv(path))
#> <path>/usr/lib/R/site-library/isdparser/extdata/00702699999.csv
#> # A tibble: 6,843 × 68
#>      station date                source latitude longitude elevation name       
#>        <int> <dttm>               <int>    <dbl>     <dbl>     <dbl> <chr>      
#>  1 702699999 2017-02-10 14:04:00      4        0         0      7026 WXPOD 7026…
#>  2 702699999 2017-02-10 14:14:00      4        0         0      7026 WXPOD 7026…
#>  3 702699999 2017-02-10 14:19:00      4        0         0      7026 WXPOD 7026…
#>  4 702699999 2017-02-10 14:24:00      4        0         0      7026 WXPOD 7026…
#>  5 702699999 2017-02-10 14:29:00      4        0         0      7026 WXPOD 7026…
#>  6 702699999 2017-02-10 14:34:00      4        0         0      7026 WXPOD 7026…
#>  7 702699999 2017-02-10 14:39:00      4        0         0      7026 WXPOD 7026…
#>  8 702699999 2017-02-10 14:44:00      4        0         0      7026 WXPOD 7026…
#>  9 702699999 2017-02-10 14:49:00      4        0         0      7026 WXPOD 7026…
#> 10 702699999 2017-02-10 14:54:00      4        0         0      7026 WXPOD 7026…
#> # … with 6,833 more rows, and 61 more variables: report_type <chr>,
#> #   call_sign <int>, quality_control <chr>, wnd <chr>, cig <chr>, vis <chr>,
#> #   tmp <chr>, dew <chr>, slp <chr>, wind_direction <chr>,
#> #   wind_direction_quality <chr>, wind_code <chr>, wind_speed <chr>,
#> #   wind_speed_quality <chr>, ceiling_height <chr>,
#> #   ceiling_height_quality <chr>, ceiling_height_determination <chr>,
#> #   ceiling_height_cavok <chr>, visibility_distance <chr>, …

# isd_parse_csv compared to isd_parse
if (interactive()) {
x="https://www.ncei.noaa.gov/data/global-hourly/access/2017/00702699999.csv"
download.file(x, (f_csv=file.path(tempdir(), "00702699999.csv")))
y="ftp://ftp.ncdc.noaa.gov/pub/data/noaa/2017/007026-99999-2017.gz"
download.file(y, (f_gz=file.path(tempdir(), "007026-99999-2017.gz")))
from_csv <- isd_parse_csv(f_csv)
from_gz <- isd_parse(f_gz, parallel = TRUE)

x="https://www.ncei.noaa.gov/data/global-hourly/access/1913/02982099999.csv"
download.file(x, (f=file.path(tempdir(), "02982099999.csv")))
isd_parse_csv(f)

x="https://www.ncei.noaa.gov/data/global-hourly/access/1923/02970099999.csv"
download.file(x, (f=file.path(tempdir(), "02970099999.csv")))
isd_parse_csv(f)

x="https://www.ncei.noaa.gov/data/global-hourly/access/1945/04390099999.csv"
download.file(x, (f=file.path(tempdir(), "04390099999.csv")))
isd_parse_csv(f)

x="https://www.ncei.noaa.gov/data/global-hourly/access/1976/02836099999.csv"
download.file(x, (f=file.path(tempdir(), "02836099999.csv")))
isd_parse_csv(f)
}