GithubHelp home page GithubHelp logo

mathworks / noaa Goto Github PK

View Code? Open in Web Editor NEW
9.0 5.0 0.0 13 KB

Access National Oceanic and Atmospheric Administration (NOAA) Data from MATLAB

License: Other

MATLAB 100.00%
matlab noaa noaa-data climate noaa-weather

noaa's Introduction

Getting Started with National Oceanic and Atmospheric Administration (NOAA) Data in MATLAB®

Description

This interface allows users to access NOAA data directly from MATLAB. Quantative and climate risk analysts can use the available data to make investment decisions based on climate data and weather patterns.

Open in MATLAB Online

System Requirements

Features

Users can retrieve NOAA data directly from MATLAB. NOAA documentation for Datasets, Data Categories, Data Types, Location Categories, Locations, Stations and Data can be found here:

https://www.ncdc.noaa.gov/cdo-web/webservices/v2

A valid NOAA connection is required for all requests. Users can retrieve information required to make subsequent data requests.

Create a NOAA connection.

n = noaa("myNOAAToken");

Retrieve datasets information

Get all available datasets information or information for a specific dataset

d = datasets(n);
d = datasets(n,"GSOY");

Get data category information

d = datacategories(n);
d = datacategories(n,"ANNAGR");
d = datacategories(n,[],"location","CITY:US390029","locationid","FIPS:37","limit",100);

Get data types information

d = datatypes(n);
d = datatypes(n,"ACMH");
d = datatypes(n,[],"datacategoryid","TEMP","limit",10);
d = datatypes(n,[],"stationid","COOP:310090");

Get location category information

d = locationcategories(n);
d = locationcategories(n,"CLIM_REG");
d = locationcategories(n,[],"startdate","1970-01-01");

Get location information

d = locations(n);
d = locations(n,"FIPS:37");
d = locations(n,[],"datasetid","GHCND");
d = locations(n,[],"locationcategoryid","ST","limit",52);
d = locations(n,[],"locationcategoryid","CITY","sortfield","name","sortorder","desc");

Get station information

d = stations(n)
d = stations(n,"COOP:010008")
d = stations(n,[],"locationid","FIPS:37")
d = stations(n,[],"datatypeid","EMNT","datatypeid","EMXT","datatypeid","HTMN")

Get daily summary data for a given date range and location id

d = getdata(n,"GHCND",datetime("2010-05-01"),datetime("2010-05-10"),"locationid","ZIP:28801")

Aggregate daily temperature data into a timetable

annualTemperatureData = [];
for y = 2015:2022
  annualTemperatureData = [annualTemperatureData;getdata(n,"GHCND", ...
                            datetime(strcat(num2str(y),"-01-01")), ... 
                            datetime(strcat(num2str(y),"-12-31")), ...
                            stationid  = "GHCND:SPE00119783", ...
                            datatypeid = "TAVG", ...
                            locationid = "FIPS:SP", ...
                            limit      = 1000, ...
                            units      = "metric")]; 
end

Temperature = annualTemperatureData.value;
Date = datetime(annualTemperatureData.date);
T = timetable(Date, Temperature);
head(T)

License

The license is available in the LICENSE.TXT file in this GitHub repository.

Community Support

MATLAB Central

Copyright 2022 The MathWorks, Inc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.