Walkthrough
- Set Up
After installing the package one can call it in a new session as any other package. A good practice is to define the cdo_token
one intends to use for that session.
using NCEI
const cdo_token = ENV["cdo_token"]
# A token has form: r"[A-Za-z]{32}"
- Datasets
One should first inspect the datasets available to select the ones the appropriate ones. Good information about a dataset is its ID which one needs to query data from that dataset, the temporal coverage, and documentation that can be accessed through the uid. For example, the daily summaries dataset (GHCND) has uid: C00861. The information for this dataset can be accessed at: https://data.nodc.noaa.gov/cgi-bin/iso?id=gov.noaa.ncdc:C00861.
# Fetch all available datasets
cdo_datasets(cdo_token)
11 rows × 6 columns
uid | mindate | maxdate | name | datacoverage | id | |
---|---|---|---|---|---|---|
String | Date | Date | String | Float64 | String | |
1 | gov.noaa.ncdc:C00861 | 1763-01-01 | 2019-02-11 | Daily Summaries | 1.0 | GHCND |
2 | gov.noaa.ncdc:C00946 | 1763-01-01 | 2019-01-01 | Global Summary of the Month | 1.0 | GSOM |
3 | gov.noaa.ncdc:C00947 | 1763-01-01 | 2018-01-01 | Global Summary of the Year | 1.0 | GSOY |
4 | gov.noaa.ncdc:C00345 | 1991-06-05 | 2019-02-10 | Weather Radar (Level II) | 0.95 | NEXRAD2 |
5 | gov.noaa.ncdc:C00708 | 1994-05-20 | 2019-02-08 | Weather Radar (Level III) | 0.95 | NEXRAD3 |
6 | gov.noaa.ncdc:C00821 | 2010-01-01 | 2010-01-01 | Normals Annual/Seasonal | 1.0 | NORMAL_ANN |
7 | gov.noaa.ncdc:C00823 | 2010-01-01 | 2010-12-31 | Normals Daily | 1.0 | NORMAL_DLY |
8 | gov.noaa.ncdc:C00824 | 2010-01-01 | 2010-12-31 | Normals Hourly | 1.0 | NORMAL_HLY |
9 | gov.noaa.ncdc:C00822 | 2010-01-01 | 2010-12-01 | Normals Monthly | 1.0 | NORMAL_MLY |
10 | gov.noaa.ncdc:C00505 | 1970-05-12 | 2014-01-01 | Precipitation 15 Minute | 0.25 | PRECIP_15 |
11 | gov.noaa.ncdc:C00313 | 1900-01-01 | 2014-01-01 | Precipitation Hourly | 1.0 | PRECIP_HLY |
# Fetch all information about the GSOY dataset specifically
cdo_datasets(cdo_token, "GSOY")
1 rows × 5 columns
mindate | maxdate | name | datacoverage | id | |
---|---|---|---|---|---|
Date | Date | String | Float64 | String | |
1 | 1763-01-01 | 2018-01-01 | Global Summary of the Year | 1.0 | GSOY |
# Fetch all available datasets with the Temperature at the time of observation (TOBS) data type
cdo_datasets(cdo_token, datatypes = "TOBS")
1 rows × 6 columns
uid | mindate | maxdate | name | datacoverage | id | |
---|---|---|---|---|---|---|
String | Date | Date | String | Float64 | String | |
1 | gov.noaa.ncdc:C00861 | 1763-01-01 | 2019-02-11 | Daily Summaries | 1.0 | GHCND |
# Fetch all available datasets with data for a given set of stations
cdo_datasets(cdo_token, stations = "GHCND:USC00010008")
6 rows × 6 columns
uid | mindate | maxdate | name | datacoverage | id | |
---|---|---|---|---|---|---|
String | Date | Date | String | Float64 | String | |
1 | gov.noaa.ncdc:C00861 | 1763-01-01 | 2019-02-11 | Daily Summaries | 1.0 | GHCND |
2 | gov.noaa.ncdc:C00946 | 1763-01-01 | 2019-01-01 | Global Summary of the Month | 1.0 | GSOM |
3 | gov.noaa.ncdc:C00947 | 1763-01-01 | 2018-01-01 | Global Summary of the Year | 1.0 | GSOY |
4 | gov.noaa.ncdc:C00821 | 2010-01-01 | 2010-01-01 | Normals Annual/Seasonal | 1.0 | NORMAL_ANN |
5 | gov.noaa.ncdc:C00823 | 2010-01-01 | 2010-12-31 | Normals Daily | 1.0 | NORMAL_DLY |
6 | gov.noaa.ncdc:C00822 | 2010-01-01 | 2010-12-01 | Normals Monthly | 1.0 | NORMAL_MLY |
- Data Categories
The next step is to find the data categories one might need (e.g., temperature vs precipitation).
# Fetch all available data categories
cdo_datacategories(cdo_token)
42 rows × 2 columns
name | id | |
---|---|---|
String | String | |
1 | Annual Agricultural | ANNAGR |
2 | Annual Degree Days | ANNDD |
3 | Annual Precipitation | ANNPRCP |
4 | Annual Temperature | ANNTEMP |
5 | Autumn Agricultural | AUAGR |
6 | Autumn Degree Days | AUDD |
7 | Autumn Precipitation | AUPRCP |
8 | Autumn Temperature | AUTEMP |
9 | Computed | COMP |
10 | Computed Agricultural | COMPAGR |
11 | Degree Days | DD |
12 | Dual-Pol Moments | DUALPOLMOMENT |
13 | Echo Tops | ECHOTOP |
14 | Evaporation | EVAP |
15 | Hydrometeor Type | HYDROMETEOR |
16 | Land | LAND |
17 | Miscellany | MISC |
18 | Other | OTHER |
19 | Overlay | OVERLAY |
20 | Precipitation | PRCP |
21 | Pressure | PRES |
22 | Reflectivity | REFLECTIVITY |
23 | Sky cover & clouds | SKY |
24 | Spring Agricultural | SPAGR |
⋮ | ⋮ | ⋮ |
# Fetch all information about the Annual Agricultural dataset specifically
cdo_datacategories(cdo_token, "ANNAGR")
1 rows × 2 columns
name | id | |
---|---|---|
String | String | |
1 | Annual Agricultural | ANNAGR |
# Fetch data categories for a given set of locations
cdo_datacategories(cdo_token, locations = ["FIPS:37", "CITY:US390029"])
42 rows × 2 columns
name | id | |
---|---|---|
String | String | |
1 | Annual Agricultural | ANNAGR |
2 | Annual Degree Days | ANNDD |
3 | Annual Precipitation | ANNPRCP |
4 | Annual Temperature | ANNTEMP |
5 | Autumn Agricultural | AUAGR |
6 | Autumn Degree Days | AUDD |
7 | Autumn Precipitation | AUPRCP |
8 | Autumn Temperature | AUTEMP |
9 | Computed | COMP |
10 | Computed Agricultural | COMPAGR |
11 | Degree Days | DD |
12 | Dual-Pol Moments | DUALPOLMOMENT |
13 | Echo Tops | ECHOTOP |
14 | Evaporation | EVAP |
15 | Hydrometeor Type | HYDROMETEOR |
16 | Land | LAND |
17 | Miscellany | MISC |
18 | Other | OTHER |
19 | Overlay | OVERLAY |
20 | Precipitation | PRCP |
21 | Pressure | PRES |
22 | Reflectivity | REFLECTIVITY |
23 | Sky cover & clouds | SKY |
24 | Spring Agricultural | SPAGR |
⋮ | ⋮ | ⋮ |
- Data Types
Now we can inspect which variables we want to query from what data set.
# Fetch available data types
cdo_datatypes(cdo_token)
1,527 rows × 5 columns
mindate | maxdate | name | datacoverage | id | |
---|---|---|---|---|---|
Date | Date | String | Float64⍰ | String | |
1 | 1994-03-19 | 1996-05-28 | Average cloudiness midnight to midnight from 30-second ceilometer data | 1.0 | ACMC |
2 | 1965-01-01 | 2005-12-31 | Average cloudiness midnight to midnight from manual observations | 1.0 | ACMH |
3 | 1994-02-01 | 1996-05-28 | Average cloudiness sunrise to sunset from 30-second ceilometer data | 1.0 | ACSC |
4 | 1965-01-01 | 2005-12-31 | Average cloudiness sunrise to sunset from manual observations | 1.0 | ACSH |
5 | 1991-06-05 | 2019-02-10 | Base Data | 0.95 | ALL |
6 | 2010-01-01 | 2010-01-01 | Long-term averages of annual cooling degree days with base 45F | 1.0 | ANN-CLDD-BASE45 |
7 | 2010-01-01 | 2010-01-01 | Long-term averages of annual cooling degree days with base 50F | 1.0 | ANN-CLDD-BASE50 |
8 | 2010-01-01 | 2010-01-01 | Long-term averages of annual cooling degree days with base 55F | 1.0 | ANN-CLDD-BASE55 |
9 | 2010-01-01 | 2010-01-01 | Long-term averages of annual cooling degree days with base 57F | 1.0 | ANN-CLDD-BASE57 |
10 | 2010-01-01 | 2010-01-01 | Long-term averages of annual cooling degree days with base 60F | 1.0 | ANN-CLDD-BASE60 |
11 | 2010-01-01 | 2010-01-01 | Long-term averages of annual cooling degree days with base 70F | 1.0 | ANN-CLDD-BASE70 |
12 | 2010-01-01 | 2010-01-01 | Long-term averages of annual cooling degree days with base 72F | 1.0 | ANN-CLDD-BASE72 |
13 | 2010-01-01 | 2010-01-01 | Long-term averages of annual cooling degree days with base 65F | 1.0 | ANN-CLDD-NORMAL |
14 | 2010-01-01 | 2010-01-01 | Long-term averages of annual diurnal temperature range | 1.0 | ANN-DUTR-NORMAL |
15 | 2010-01-01 | 2010-01-01 | Long-term averages of annual growing degree days with base 40F | 1.0 | ANN-GRDD-BASE40 |
16 | 2010-01-01 | 2010-01-01 | Long-term averages of annual growing degree days with base 45F | 1.0 | ANN-GRDD-BASE45 |
17 | 2010-01-01 | 2010-01-01 | Long-term averages of annual growing degree days with base 50F | 1.0 | ANN-GRDD-BASE50 |
18 | 2010-01-01 | 2010-01-01 | Long-term averages of annual growing degree days with base 55F | 1.0 | ANN-GRDD-BASE55 |
19 | 2010-01-01 | 2010-01-01 | Long-term averages of annual growing degree days with base 57F | 1.0 | ANN-GRDD-BASE57 |
20 | 2010-01-01 | 2010-01-01 | Long-term averages of annual growing degree days with base 60F | 1.0 | ANN-GRDD-BASE60 |
21 | 2010-01-01 | 2010-01-01 | Long-term averages of annual growing degree days with base 65F | 1.0 | ANN-GRDD-BASE65 |
22 | 2010-01-01 | 2010-01-01 | Long-term averages of annual growing degree days with base 70F | 1.0 | ANN-GRDD-BASE70 |
23 | 2010-01-01 | 2010-01-01 | Long-term averages of annual growing degree days with base 72F | 1.0 | ANN-GRDD-BASE72 |
24 | 2010-01-01 | 2010-01-01 | Long-term averages of annual growing degree days with truncated bases 48F and 86F | 1.0 | ANN-GRDD-TB4886 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
# Fetch more information about the ACMH data type id
cdo_datatypes(cdo_token, "ACMH")
1 rows × 4 columns
mindate | maxdate | datacoverage | id | |
---|---|---|---|---|
Date | Date | Float64 | String | |
1 | 1965-01-01 | 2005-12-31 | 1.0 | ACMH |
# Fetch data types with the air temperature data category
cdo_datatypes(cdo_token, datacategories = "TEMP")
59 rows × 5 columns
mindate | maxdate | name | datacoverage | id | |
---|---|---|---|---|---|
Date | Date | String | Float64⍰ | String | |
1 | 1763-01-01 | 2019-01-01 | Cooling Degree Days Season to Date | 1.0 | CDSD |
2 | 1863-05-04 | 2019-01-30 | Number of days included in the multiday minimum temperature (MDTN) | 1.0 | DATN |
3 | 1863-05-04 | 2019-01-29 | Number of days included in the multiday maximum temperature (MDTX) | 1.0 | DATX |
4 | 2010-01-01 | 2010-12-31 | Long-term averages of daily diurnal temperature range | 1.0 | DLY-DUTR-NORMAL |
5 | 2010-01-01 | 2010-12-31 | Long-term standard deviations of daily diurnal temperature range | 1.0 | DLY-DUTR-STDDEV |
6 | 2010-01-01 | 2010-12-31 | Long-term averages of daily average temperature | 1.0 | DLY-TAVG-NORMAL |
7 | 2010-01-01 | 2010-12-31 | Long-term standard deviations of daily average temperature | 1.0 | DLY-TAVG-STDDEV |
8 | 2010-01-01 | 2010-12-31 | Long-term averages of daily maximum temperature | 1.0 | DLY-TMAX-NORMAL |
9 | 2010-01-01 | 2010-12-31 | Long-term standard deviations of daily maximum temperature | 1.0 | DLY-TMAX-STDDEV |
10 | 2010-01-01 | 2010-12-31 | Long-term averages of daily minimum temperature | 1.0 | DLY-TMIN-NORMAL |
11 | 2010-01-01 | 2010-12-31 | Long-term standard deviations of daily minimum temperature | 1.0 | DLY-TMIN-STDDEV |
12 | 1763-01-01 | 2019-01-01 | Extreme minimum temperature for the period. | 1.0 | EMNT |
13 | 1763-01-01 | 2019-01-01 | Extreme maximum temperature for the period. | 1.0 | EMXT |
14 | 1763-07-01 | 2019-01-01 | Heating Degree Days Season to Date | 1.0 | HDSD |
15 | 2010-01-01 | 2010-12-31 | Dew point 10th percentile | 1.0 | HLY-DEWP-10PCTL |
16 | 2010-01-01 | 2010-12-31 | Dew point 90th percentile | 1.0 | HLY-DEWP-90PCTL |
17 | 2010-01-01 | 2010-12-31 | Dew point mean | 1.0 | HLY-DEWP-NORMAL |
18 | 2010-01-01 | 2010-12-31 | Heat index mean | 1.0 | HLY-HIDX-NORMAL |
19 | 2010-01-01 | 2010-12-31 | Temperature 10th percentile | 1.0 | HLY-TEMP-10PCTL |
20 | 2010-01-01 | 2010-12-31 | Temperature 90th percentile | 1.0 | HLY-TEMP-90PCTL |
21 | 2010-01-01 | 2010-12-31 | Temperature mean | 1.0 | HLY-TEMP-NORMAL |
22 | 2010-01-01 | 2010-12-31 | Wind chill mean | 1.0 | HLY-WCHL-NORMAL |
23 | 1763-01-01 | 2019-02-08 | Highest minimum temperature | missing | HTMN |
24 | 1763-01-01 | 2019-02-08 | Highest maximum temperature | missing | HTMX |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
# Fetch data types that support a given set of stations
cdo_datatypes(cdo_token, stations = ["COOP:310090", "COOP:310184", "COOP:310212"])
21 rows × 5 columns
mindate | maxdate | name | datacoverage | id | |
---|---|---|---|---|---|
Date | Date | String | Float64⍰ | String | |
1 | 1763-01-01 | 2019-01-01 | Cooling Degree Days | 1.0 | CLDD |
2 | 1781-01-01 | 2019-01-01 | Number of days with greater than or equal to 0.1 inch of precipitation | 1.0 | DP01 |
3 | 1781-01-01 | 2017-05-01 | Number of days with greater than or equal to 0.5 inch of precipitation | 1.0 | DP05 |
4 | 1781-01-01 | 2019-01-01 | Number of days with greater than or equal to 1.0 inch of precipitation | 1.0 | DP10 |
5 | 1888-12-01 | 2015-11-01 | Departure from normal monthly precipitation. | 1.0 | DPNP |
6 | 1888-06-01 | 2015-11-01 | Departure from normal monthly temperature. | 1.0 | DPNT |
7 | 1840-05-01 | 2019-01-01 | Number days with snow depth > 1 inch. | 1.0 | DSNW |
8 | 1763-01-01 | 2019-01-01 | Number days with minimum temperature less than or equal to 0.0 F | 1.0 | DT00 |
9 | 1763-01-01 | 2019-01-01 | Number days with minimum temperature less than or equal to 32.0 F | 1.0 | DT32 |
10 | 1763-01-01 | 2016-03-01 | Number days with maximum temperature greater than or equal 90.0 F | 1.0 | DT90 |
11 | 1763-01-01 | 2019-01-01 | Number days with maximum temperature < 32 F. | 1.0 | DX32 |
12 | 1763-01-01 | 2019-01-01 | Extreme minimum temperature for the period. | 1.0 | EMNT |
13 | 1781-01-01 | 2019-01-01 | Extreme maximum precipitation for the period. | 1.0 | EMXP |
14 | 1763-01-01 | 2019-01-01 | Extreme maximum temperature for the period. | 1.0 | EMXT |
15 | 1763-01-01 | 2019-01-01 | Heating degree days | 1.0 | HTDD |
16 | 1763-01-01 | 2016-03-01 | Monthly Mean minimum temperature | 1.0 | MMNT |
17 | 1763-01-01 | 2016-03-01 | Monthly Mean maximum temperature | 1.0 | MMXT |
18 | 1763-01-01 | 2016-03-01 | Monthly mean temperature | 1.0 | MNTM |
19 | 1857-01-01 | 2016-03-01 | Maximum snow depth | 1.0 | MXSD |
20 | 1781-01-01 | 2016-03-01 | Total precipitation | 1.0 | TPCP |
21 | 1840-05-01 | 2016-03-01 | Total snow fall | 1.0 | TSNW |
- Location Categories
We must identify the spatial constraints of the search and that can be accomplished at various levels (e.g., State vs Zip code).
# Fetch all available location categories
cdo_locationcategories(cdo_token)
12 rows × 2 columns
name | id | |
---|---|---|
String | String | |
1 | City | CITY |
2 | Climate Division | CLIM_DIV |
3 | Climate Region | CLIM_REG |
4 | Country | CNTRY |
5 | County | CNTY |
6 | Hydrologic Accounting Unit | HYD_ACC |
7 | Hydrologic Cataloging Unit | HYD_CAT |
8 | Hydrologic Region | HYD_REG |
9 | Hydrologic Subregion | HYD_SUB |
10 | State | ST |
11 | US Territory | US_TERR |
12 | Zip Code | ZIP |
# Fetch more information about the climate region location category
cdo_locationcategories(cdo_token, "CLIM_REG")
1 rows × 2 columns
name | id | |
---|---|---|
String | String | |
1 | Climate Region | CLIM_REG |
# Fetch available location categories that have data after 1970
cdo_locationcategories(cdo_token, startdate = Date(1970, 1, 1))
12 rows × 2 columns
name | id | |
---|---|---|
String | String | |
1 | City | CITY |
2 | Climate Division | CLIM_DIV |
3 | Climate Region | CLIM_REG |
4 | Country | CNTRY |
5 | County | CNTY |
6 | Hydrologic Accounting Unit | HYD_ACC |
7 | Hydrologic Cataloging Unit | HYD_CAT |
8 | Hydrologic Region | HYD_REG |
9 | Hydrologic Subregion | HYD_SUB |
10 | State | ST |
11 | US Territory | US_TERR |
12 | Zip Code | ZIP |
- Locations
Now select which locations are of interest.
# Fetch available locations
cdo_locations(cdo_token)
38,859 rows × 5 columns
mindate | maxdate | name | datacoverage | id | |
---|---|---|---|---|---|
Date | Date | String | Float64 | String | |
1 | 1983-01-01 | 2019-01-30 | Abu Dhabi, AE | 1.0 | CITY:AE000001 |
2 | 1944-03-01 | 2019-01-30 | Ajman, AE | 0.9991 | CITY:AE000002 |
3 | 1944-03-01 | 2019-01-30 | Dubai, AE | 0.9991 | CITY:AE000003 |
4 | 1944-03-01 | 2019-01-30 | Sharjah, AE | 0.9991 | CITY:AE000006 |
5 | 1966-03-02 | 2019-01-30 | Kabul, AF | 0.9969 | CITY:AF000007 |
6 | 1973-01-02 | 2019-01-30 | Kandahar, AF | 0.9819 | CITY:AF000008 |
7 | 1877-04-01 | 2019-01-30 | Algiers, AG | 1.0 | CITY:AG000001 |
8 | 1909-11-01 | 2019-01-30 | Annaba, AG | 1.0 | CITY:AG000002 |
9 | 1973-04-01 | 2019-02-05 | Batna, AG | 0.9993 | CITY:AG000003 |
10 | 1957-01-01 | 2019-02-05 | Bechar, AG | 1.0 | CITY:AG000004 |
11 | 1909-11-01 | 2019-02-05 | Bejaia, AG | 1.0 | CITY:AG000005 |
12 | 1880-05-01 | 2019-02-05 | Constantine, AG | 1.0 | CITY:AG000006 |
13 | 1995-10-01 | 2019-02-05 | Guelma, AG | 1.0 | CITY:AG000007 |
14 | 1888-01-01 | 2019-01-30 | Laghouat, AG | 1.0 | CITY:AG000008 |
15 | 1995-10-01 | 2019-02-05 | Medea, AG | 0.9993 | CITY:AG000009 |
16 | 1976-04-01 | 2019-02-05 | Mostaganem, AG | 0.9995 | CITY:AG000010 |
17 | 1957-01-01 | 2019-02-05 | Oran, AG | 1.0 | CITY:AG000011 |
18 | 1985-02-01 | 2019-02-05 | Oum el Bouaghi, AG | 1.0 | CITY:AG000012 |
19 | 1981-01-01 | 2019-02-05 | Saida, AG | 0.9973 | CITY:AG000013 |
20 | 1995-10-01 | 2019-02-05 | Sidi-Bel-Abbes, AG | 1.0 | CITY:AG000014 |
21 | 1957-12-31 | 2019-02-05 | Skikda, AG | 1.0 | CITY:AG000015 |
22 | 1940-01-01 | 2014-02-01 | Tamanrasset, AG | 0.9973 | CITY:AG000016 |
23 | 1981-01-01 | 2019-02-05 | Tlemcen, AG | 1.0 | CITY:AG000017 |
24 | 1881-07-01 | 1992-01-31 | Baku, AJ | 0.991 | CITY:AJ000001 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
# Fetch more information about location id FIPS:37
cdo_locations(cdo_token, "FIPS:37")
1 rows × 5 columns
mindate | maxdate | name | datacoverage | id | |
---|---|---|---|---|---|
Date | Date | String | Float64 | String | |
1 | 1869-03-01 | 2019-02-10 | North Carolina | 1.0 | FIPS:37 |
# Fetch available locations for the GHCND (Daily Summaries) dataset
cdo_locations(cdo_token, datasets = "GHCND")
28,450 rows × 5 columns
mindate | maxdate | name | datacoverage | id | |
---|---|---|---|---|---|
Date | Date | String | Float64 | String | |
1 | 1983-01-02 | 2019-01-30 | Abu Dhabi, AE | 0.9959 | CITY:AE000001 |
2 | 1944-03-20 | 2019-01-30 | Ajman, AE | 0.9973 | CITY:AE000002 |
3 | 1944-03-20 | 2019-01-30 | Dubai, AE | 0.9973 | CITY:AE000003 |
4 | 1944-03-20 | 2019-01-30 | Sharjah, AE | 0.9973 | CITY:AE000006 |
5 | 1966-03-02 | 2019-01-30 | Kabul, AF | 0.5559 | CITY:AF000007 |
6 | 1973-01-02 | 2019-01-30 | Kandahar, AF | 0.4529 | CITY:AF000008 |
7 | 1877-04-07 | 2019-01-30 | Algiers, AG | 1.0 | CITY:AG000001 |
8 | 1909-11-23 | 2019-01-30 | Annaba, AG | 0.9252 | CITY:AG000002 |
9 | 1973-04-03 | 2019-02-05 | Batna, AG | 0.8649 | CITY:AG000003 |
10 | 1957-01-09 | 2019-02-05 | Bechar, AG | 1.0 | CITY:AG000004 |
11 | 1909-11-23 | 2019-02-05 | Bejaia, AG | 1.0 | CITY:AG000005 |
12 | 1880-05-18 | 2019-02-05 | Constantine, AG | 0.7634 | CITY:AG000006 |
13 | 1995-10-25 | 2019-02-05 | Guelma, AG | 1.0 | CITY:AG000007 |
14 | 1888-01-01 | 2019-01-30 | Laghouat, AG | 0.4328 | CITY:AG000008 |
15 | 1995-10-25 | 2019-02-05 | Medea, AG | 0.739 | CITY:AG000009 |
16 | 1976-04-28 | 2019-02-05 | Mostaganem, AG | 0.5775 | CITY:AG000010 |
17 | 1957-01-01 | 2019-02-05 | Oran, AG | 1.0 | CITY:AG000011 |
18 | 1985-02-07 | 2019-02-05 | Oum el Bouaghi, AG | 0.637 | CITY:AG000012 |
19 | 1981-01-01 | 2019-02-05 | Saida, AG | 0.5947 | CITY:AG000013 |
20 | 1995-10-25 | 2019-02-05 | Sidi-Bel-Abbes, AG | 0.7411 | CITY:AG000014 |
21 | 1957-12-31 | 2019-02-05 | Skikda, AG | 0.6945 | CITY:AG000015 |
22 | 1940-01-01 | 2008-12-31 | Tamanrasset, AG | 0.9404 | CITY:AG000016 |
23 | 1981-01-01 | 2019-02-05 | Tlemcen, AG | 1.0 | CITY:AG000017 |
24 | 1881-07-17 | 1992-01-31 | Baku, AJ | 0.9797 | CITY:AJ000001 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
# Fetch all U.S. States
cdo_locations(cdo_token, locationcategories = "ST")
51 rows × 5 columns
mindate | maxdate | name | datacoverage | id | |
---|---|---|---|---|---|
Date | Date | String | Float64 | String | |
1 | 1888-02-01 | 2019-02-10 | Alabama | 1.0 | FIPS:01 |
2 | 1893-09-01 | 2019-02-10 | Alaska | 1.0 | FIPS:02 |
3 | 1867-08-01 | 2019-02-10 | Arizona | 1.0 | FIPS:04 |
4 | 1871-07-01 | 2019-02-10 | Arkansas | 1.0 | FIPS:05 |
5 | 1850-10-01 | 2019-02-10 | California | 1.0 | FIPS:06 |
6 | 1852-10-01 | 2019-02-10 | Colorado | 1.0 | FIPS:08 |
7 | 1884-11-01 | 2019-02-10 | Connecticut | 1.0 | FIPS:09 |
8 | 1893-01-01 | 2019-02-10 | Delaware | 1.0 | FIPS:10 |
9 | 1872-01-01 | 2019-02-10 | District of Columbia | 1.0 | FIPS:11 |
10 | 1871-10-01 | 2019-02-10 | Florida | 1.0 | FIPS:12 |
11 | 1849-01-01 | 2019-02-10 | Georgia | 1.0 | FIPS:13 |
12 | 1905-01-01 | 2019-02-10 | Hawaii | 1.0 | FIPS:15 |
13 | 1892-06-01 | 2019-02-10 | Idaho | 1.0 | FIPS:16 |
14 | 1870-10-15 | 2019-02-10 | Illinois | 1.0 | FIPS:17 |
15 | 1886-02-01 | 2019-02-10 | Indiana | 1.0 | FIPS:18 |
16 | 1888-06-01 | 2019-02-10 | Iowa | 1.0 | FIPS:19 |
17 | 1857-04-01 | 2019-02-10 | Kansas | 1.0 | FIPS:20 |
18 | 1872-10-01 | 2019-02-10 | Kentucky | 1.0 | FIPS:21 |
19 | 1882-07-01 | 2019-02-10 | Louisiana | 1.0 | FIPS:22 |
20 | 1885-06-01 | 2019-02-10 | Maine | 1.0 | FIPS:23 |
21 | 1880-01-01 | 2019-02-10 | Maryland | 1.0 | FIPS:24 |
22 | 1831-02-01 | 2019-02-10 | Massachusetts | 1.0 | FIPS:25 |
23 | 1887-06-01 | 2019-02-10 | Michigan | 1.0 | FIPS:26 |
24 | 1886-01-01 | 2019-02-10 | Minnesota | 1.0 | FIPS:27 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
- Stations
Lastly, one can obtain the relevant stations and verify their spatial information, temporal coverage, and data quality. To select from feasible weather stations one can use packages such as Distances.jl
to obtain the nearest acceptable weather station to the desired location.
# Fetch a list of stations that support a given set of data types
cdo_stations(cdo_token, datatypes = ["EMNT", "EMXT", "HTMN"])
12,832 rows × 9 columns
elevation | mindate | maxdate | latitude | name | datacoverage | id | elevationUnit | longitude | |
---|---|---|---|---|---|---|---|---|---|
Float64⍰ | Date | Date | Float64 | String | Float64 | String | String⍰ | Float64 | |
1 | 34.0 | 1944-03-01 | 2019-01-30 | 25.333 | SHARJAH INTER. AIRP, AE | 0.7247 | GHCND:AE000041196 | METERS | 55.517 |
2 | 10.4 | 1983-01-01 | 2019-01-30 | 25.255 | DUBAI INTERNATIONAL, AE | 0.9973 | GHCND:AEM00041194 | METERS | 55.364 |
3 | 26.8 | 1983-01-01 | 2019-01-30 | 24.433 | ABU DHABI INTERNATIONAL, AE | 1.0 | GHCND:AEM00041217 | METERS | 54.651 |
4 | 24.0 | 1940-01-01 | 2019-01-30 | 36.7167 | ALGER DAR EL BEIDA, AG | 1.0 | GHCND:AG000060390 | METERS | 3.25 |
5 | 397.0 | 1892-01-01 | 2019-02-05 | 30.5667 | EL GOLEA, AG | 0.7834 | GHCND:AG000060590 | METERS | 2.8667 |
6 | 561.0 | 1958-10-01 | 2019-02-05 | 28.05 | IN AMENAS, AG | 1.0 | GHCND:AG000060611 | METERS | 9.6331 |
7 | 1362.0 | 1940-01-01 | 2014-02-01 | 22.8 | TAMANRASSET, AG | 0.9911 | GHCND:AG000060680 | METERS | 5.4331 |
8 | 50.0 | 1852-01-01 | 1966-12-31 | 35.7297 | ORAN HOPITAL MILITAIRE, AG | 0.6507 | GHCND:AGE00135039 | METERS | 0.65 |
9 | 59.0 | 1877-04-01 | 1938-12-29 | 36.78 | ALGIERS VILLE UNIVERSITE | 0.9784 | GHCND:AGE00147705 | METERS | 3.07 |
10 | 222.0 | 1879-01-01 | 2019-02-05 | 36.72 | TIZI OUZOU, AG | 0.5094 | GHCND:AGE00147708 | METERS | 4.05 |
11 | 942.0 | 1879-01-01 | 1938-12-29 | 36.63 | FORT NATIONAL, AG | 0.932 | GHCND:AGE00147709 | METERS | 4.2 |
12 | 660.0 | 1880-05-01 | 1938-12-30 | 36.3697 | CONSTANTINE, AG | 0.8736 | GHCND:AGE00147711 | METERS | 6.62 |
13 | 112.0 | 1879-01-01 | 1938-12-28 | 36.17 | ORLEANSVILLE CHLEF, AG | 0.9084 | GHCND:AGE00147712 | METERS | 1.34 |
14 | 1081.0 | 1878-01-01 | 1938-12-29 | 36.18 | SETIF, AG | 0.7132 | GHCND:AGE00147713 | METERS | 5.4 |
15 | 863.0 | 1879-01-01 | 1938-12-29 | 35.42 | TEBESSA, AG | 0.6473 | GHCND:AGE00147715 | METERS | 8.1197 |
16 | 83.0 | 1878-01-01 | 2019-02-05 | 35.1 | NEMOURS GHAZAOUET, AG | 0.5214 | GHCND:AGE00147716 | METERS | -1.85 |
17 | 476.0 | 1880-01-01 | 1938-12-27 | 35.2 | SIDI BEL ABBES, AG | 0.791 | GHCND:AGE00147717 | METERS | 0.63 |
18 | 125.0 | 1880-01-01 | 2019-02-05 | 34.85 | BISKRA, AG | 0.7064 | GHCND:AGE00147718 | METERS | 5.72 |
19 | 767.0 | 1888-01-01 | 2019-01-30 | 33.7997 | LAGHOUAT, AG | 0.5047 | GHCND:AGE00147719 | METERS | 2.89 |
20 | 1320.0 | 1888-01-01 | 1938-12-28 | 33.68 | GERYVILLE EL BAYADH, AG | 0.8432 | GHCND:AGE00147720 | METERS | 1.0 |
21 | 11.0 | 1981-11-01 | 2019-02-05 | 36.795 | JIJEL, AG | 0.9928 | GHCND:AGM00060351 | METERS | 5.874 |
22 | 7.0 | 1957-12-31 | 2019-02-05 | 36.933 | SKIKDA | 0.7656 | GHCND:AGM00060355 | METERS | 6.95 |
23 | 4.9 | 1945-06-09 | 2019-01-30 | 36.822 | ANNABA, AG | 0.8749 | GHCND:AGM00060360 | METERS | 7.809 |
24 | 6.1 | 1973-01-01 | 2019-02-05 | 36.712 | SOUMMAM, AG | 0.9885 | GHCND:AGM00060402 | METERS | 5.07 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
# Fetch all information about the Abbeville AL station specifically
cdo_stations(cdo_token, "COOP:010008")
1 rows × 9 columns
elevation | mindate | maxdate | latitude | name | datacoverage | id | elevationUnit | longitude | |
---|---|---|---|---|---|---|---|---|---|
Float64 | Date | Date | Float64 | String | Float64 | String | String | Float64 | |
1 | 139.0 | 1948-01-01 | 2014-01-01 | 31.5702 | ABBEVILLE, AL US | 0.8813 | COOP:010008 | METERS | -85.2482 |
# Fetch all the stations in North Carolina, US (FIPS:37)
cdo_stations(cdo_token, locations = "FIPS:37")
2,596 rows × 9 columns
elevation | mindate | maxdate | latitude | name | datacoverage | id | elevationUnit | longitude | |
---|---|---|---|---|---|---|---|---|---|
Float64⍰ | Date | Date | Float64 | String | Float64 | String | String⍰ | Float64 | |
1 | 185.9 | 1931-01-01 | 2015-11-01 | 35.3992 | ALBEMARLE, NC US | 0.9647 | COOP:310090 | METERS | -80.1994 |
2 | 841.9 | 1931-01-01 | 1962-03-01 | 35.9 | ALTAPASS, NC US | 0.9308 | COOP:310160 | METERS | -82.0167 |
3 | 533.1 | 1931-01-01 | 2005-09-01 | 35.2014 | ANDREWS, NC US | 0.9811 | COOP:310184 | METERS | -83.8386 |
4 | 519.1 | 1949-01-01 | 1962-03-01 | 35.0667 | ANDREWS DAM, NC US | 1.0 | COOP:310192 | METERS | -83.9167 |
5 | 137.2 | 1993-07-01 | 2015-11-01 | 35.7426 | APEX, NC US | 0.9739 | COOP:310212 | METERS | -78.8369 |
6 | 100.6 | 1931-01-01 | 2015-11-01 | 36.2911 | ARCOLA, NC US | 0.8881 | COOP:310241 | METERS | -77.9822 |
7 | 265.2 | 1931-01-01 | 2015-11-01 | 35.7044 | ASHEBORO 2 W, NC US | 0.9941 | COOP:310286 | METERS | -79.8378 |
8 | 637.9 | 1946-02-01 | 1958-06-01 | 35.4333 | ASHEVILLE HENDERSONVILLE AIRPORT, NC US | 0.9468 | COOP:310296 | METERS | -82.4833 |
9 | 645.3 | 1964-09-01 | 2015-11-01 | 35.4319 | ASHEVILLE AIRPORT, NC US | 1.0 | COOP:310300 | METERS | -82.5375 |
10 | 682.1 | 1902-08-01 | 2015-11-01 | 35.5954 | ASHEVILLE, NC US | 1.0 | COOP:310301 | METERS | -82.5568 |
11 | 571.5 | 1948-01-01 | 2014-01-01 | 35.8922 | ASHFORD, NC US | 1.0 | COOP:310312 | METERS | -81.9352 |
12 | 604.1 | 1973-09-01 | 1980-11-27 | 35.9 | ASHFORD 2 N, NC US | 0.0429 | COOP:310314 | METERS | -81.95 |
13 | 1.2 | 2004-07-01 | 2015-11-01 | 34.6997 | ATLANTIC BEACH WATER PLANT, NC US | 1.0 | COOP:310356 | METERS | -76.7381 |
14 | 6.1 | 1973-01-01 | 2015-11-01 | 35.3872 | AURORA 6 N, NC US | 0.9845 | COOP:310375 | METERS | -76.7763 |
15 | 182.9 | 1931-01-01 | 2014-01-01 | 35.4591 | BADIN, NC US | 0.9318 | COOP:310438 | METERS | -80.1827 |
16 | 755.9 | 1949-01-01 | 1962-03-01 | 36.0167 | BAKERSVILLE, NC US | 1.0 | COOP:310466 | METERS | -82.1667 |
17 | 1066.8 | 1949-01-01 | 1995-05-01 | 35.4167 | BALSAM, NC US | 0.3142 | COOP:310490 | METERS | -83.0833 |
18 | 1149.1 | 1931-01-01 | 2015-11-01 | 36.1616 | BANNER ELK, NC US | 0.9804 | COOP:310506 | METERS | -81.8741 |
19 | 707.1 | 1949-01-01 | 1962-03-01 | 35.76 | BARNARDSVILLE 2 SE, NC US | 1.0 | COOP:310530 | METERS | -82.4325 |
20 | 707.1 | 2011-01-01 | 2015-11-01 | 35.76 | BARNARDSVILLE 2 SE, NC US | 0.9835 | COOP:310531 | METERS | -82.4325 |
21 | 3.0 | 1954-07-01 | 1967-06-01 | 35.45 | BATH 2 WSW, NC US | 0.9359 | COOP:310562 | METERS | -76.8333 |
22 | 1.5 | 1968-07-01 | 2015-11-01 | 35.1311 | BAYBORO 3 SW, NC US | 0.9613 | COOP:310576 | METERS | -76.816 |
23 | 641.0 | 1949-01-01 | 1951-03-01 | 35.2333 | BEAVERDAM CREEK, NC US | 1.0 | COOP:310634 | METERS | -84.0833 |
24 | 573.0 | 1951-04-01 | 1962-03-01 | 35.2167 | BEAVERDAM CREEK, NC US | 0.9999 | COOP:310635 | METERS | -84.1 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
- Data
The final step is to obtain the raw data itself. A few transformations are recommended before proceeding with the analysis of the data (e.g., transforming the dataframe from long to short and filling the missing records with missing values for those observations). Read the documentation to interpret the various flags under the attributes column.
# Fetch data from the GHCND dataset (Daily Summaries) for zip code 28801, May 1st of 2010
cdo_data(cdo_token, "GHCND", Date(2010, 5, 1), Date(2010, 5, 1), locations = "ZIP:28801")
8 rows × 5 columns
date | datatype | station | attributes | value | |
---|---|---|---|---|---|
DateTime | String | String | String⍰ | Float64 | |
1 | 2010-05-01T00:00:00 | PRCP | GHCND:US1NCBC0005 | ,,N, | 0.0 |
2 | 2010-05-01T00:00:00 | SNOW | GHCND:US1NCBC0005 | ,,N, | 0.0 |
3 | 2010-05-01T00:00:00 | PRCP | GHCND:USW00013872 | ,,0,2400 | 0.3 |
4 | 2010-05-01T00:00:00 | SNOW | GHCND:USW00013872 | ,,0, | 0.0 |
5 | 2010-05-01T00:00:00 | SNWD | GHCND:USW00013872 | ,,0, | 0.0 |
6 | 2010-05-01T00:00:00 | TMAX | GHCND:USW00013872 | ,,0,2400 | 26.7 |
7 | 2010-05-01T00:00:00 | TMIN | GHCND:USW00013872 | ,,0,2400 | 13.9 |
8 | 2010-05-01T00:00:00 | TOBS | GHCND:USW00013872 | ,,0,2400 | 20.6 |
# Fetch data from the PRECIP_15 dataset (Precipitation 15 Minute) for COOP station 010008, for May of 2010 with metric units
cdo_data(cdo_token, "PRECIP_15", Date(2010, 5, 1), Date(2010, 5, 31), stations = "COOP:010008")
63 rows × 5 columns
date | datatype | station | attributes | value | |
---|---|---|---|---|---|
DateTime | String | String | String⍰ | Float64 | |
1 | 2010-05-01T00:15:00 | QGAG | COOP:010008 | g,,HT | 0.0 |
2 | 2010-05-01T00:15:00 | QPCP | COOP:010008 | g,,HT | 0.0 |
3 | 2010-05-03T14:00:00 | QGAG | COOP:010008 | ,,HT | 109.73 |
4 | 2010-05-03T14:15:00 | QGAG | COOP:010008 | ,,HT | 110.74 |
5 | 2010-05-03T14:15:00 | QPCP | COOP:010008 | ,,HT | 10.16 |
6 | 2010-05-03T14:30:00 | QGAG | COOP:010008 | ,,HT | 111.51 |
7 | 2010-05-03T14:30:00 | QPCP | COOP:010008 | ,,HT | 7.62 |
8 | 2010-05-03T14:45:00 | QGAG | COOP:010008 | ,,HT | 112.01 |
9 | 2010-05-03T14:45:00 | QPCP | COOP:010008 | ,,HT | 5.08 |
10 | 2010-05-03T15:00:00 | QGAG | COOP:010008 | ,,HT | 112.27 |
11 | 2010-05-03T15:00:00 | QPCP | COOP:010008 | ,,HT | 2.54 |
12 | 2010-05-03T15:15:00 | QGAG | COOP:010008 | ,,HT | 113.03 |
13 | 2010-05-03T15:15:00 | QPCP | COOP:010008 | ,,HT | 7.62 |
14 | 2010-05-03T15:30:00 | QGAG | COOP:010008 | ,,HT | 113.54 |
15 | 2010-05-03T15:30:00 | QPCP | COOP:010008 | ,,HT | 5.08 |
16 | 2010-05-03T16:00:00 | QGAG | COOP:010008 | ,,HT | 113.79 |
17 | 2010-05-03T16:00:00 | QPCP | COOP:010008 | ,,HT | 2.54 |
18 | 2010-05-03T17:00:00 | QGAG | COOP:010008 | ,,HT | 114.05 |
19 | 2010-05-03T17:00:00 | QPCP | COOP:010008 | ,,HT | 2.54 |
20 | 2010-05-03T17:15:00 | QGAG | COOP:010008 | ,,HT | 114.3 |
21 | 2010-05-03T17:15:00 | QPCP | COOP:010008 | ,,HT | 2.54 |
22 | 2010-05-03T17:30:00 | QGAG | COOP:010008 | ,,HT | 114.55 |
23 | 2010-05-03T17:30:00 | QPCP | COOP:010008 | ,,HT | 2.54 |
24 | 2010-05-03T17:45:00 | QGAG | COOP:010008 | ,,HT | 114.81 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
# Fetch data from the GSOM dataset (Global Summary of the Month) for GHCND station USC00010008, for May of 2010 with standard units
cdo_data(cdo_token, "GSOM", Date(2010, 5, 1), Date(2010, 5, 31),
stations = "GHCND:USC00010008", metric = false)
10 rows × 5 columns
date | datatype | station | attributes | value | |
---|---|---|---|---|---|
DateTime | String | String | String⍰ | Float64 | |
1 | 2010-05-01T00:00:00 | DP01 | GHCND:USC00010008 | ,0 | 4.0 |
2 | 2010-05-01T00:00:00 | DP10 | GHCND:USC00010008 | ,0 | 4.0 |
3 | 2010-05-01T00:00:00 | DP1X | GHCND:USC00010008 | ,0 | 2.0 |
4 | 2010-05-01T00:00:00 | DSND | GHCND:USC00010008 | ,0 | 0.0 |
5 | 2010-05-01T00:00:00 | DSNW | GHCND:USC00010008 | ,0 | 0.0 |
6 | 2010-05-01T00:00:00 | EMSD | GHCND:USC00010008 | ,,0,31,+ | 0.0 |
7 | 2010-05-01T00:00:00 | EMSN | GHCND:USC00010008 | ,,0,31,+ | 0.0 |
8 | 2010-05-01T00:00:00 | EMXP | GHCND:USC00010008 | ,,0,04, | 4.0 |
9 | 2010-05-01T00:00:00 | PRCP | GHCND:USC00010008 | ,,,0 | 6.6 |
10 | 2010-05-01T00:00:00 | SNOW | GHCND:USC00010008 | ,,,0 | 0.0 |