(Network Common Data Form)

Slides:



Advertisements
Similar presentations
WP1.2: Developing gridded datasets based on long-term remote sensing data (DWD) MOHC (results to be used in WP3): max and min surface air temperature products.
Advertisements

Reading NetCDF Files in Matlab and analyzing the data.
Let’s try Oracle. Accessing Oracle The Oracle system, like the SQL Server system, is client / server. For SQL Server, –the client is the Query Analyser.
Outline of Talk Introduction Toolbox functionality Results Conclusions and future development.
NetCDF An Effective Way to Store and Retrieve Scientific Datasets Jianwei Li 02/11/2002.
Активное распределенное хранилище для многомерных массивов Дмитрий Медведев ИКИ РАН.
Introduction to Array The fundamental unit of data in any MATLAB program is the array. 1. An array is a collection of data values organized into rows and.
Status of netCDF-3, netCDF-4, and CF Conventions Russ Rew Community Standards for Unstructured Grids Workshop, Boulder
Dr Mark Cresswell Model Assimilation 69EG6517 – Impacts & Models of Climate Change.
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
Details for Today: DATE:18 th November 2004 BY:Mark Cresswell FOLLOWED BY:Literature exercise Model Assimilation 69EG3137 – Impacts & Models of Climate.
Introduction to SPSS Edward A. Greenberg, PhD
Multidimensional Data and GIS Steve Kopp Nawajish Noman ESRI.
Scientific Computing Division A tutorial Introduction to Fortran Siddhartha Ghosh Consulting Services Group.
The netCDF-4 data model and format Russ Rew, UCAR Unidata NetCDF Workshop 25 October 2012.
11 3 / 12 CHAPTER Databases MIS105 Lec15 Irfan Ahmed Ilyas.
Deutscher Wetterdienst
Project 4 : SciDAC All Hands Meeting, September 11-13, 2002 A. Choudhary, W. LiaoW. Gropp, R. Ross, R. Thakur Northwestern UniversityArgonne National Lab.
Global Observing System Simulation Experiments (Global OSSEs) How It Works Nature Run 13-month uninterrupted forecast produces alternative atmosphere.
Climate Data Formats Deniz Bozkurt
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Alternative Architecture for Information in Digital Libraries Onno W. Purbo
The HDF Group Introduction to netCDF-4 Elena Pourmal The HDF Group 110/17/2015.
Monitoring and Modeling Climate Change Are oceans getting warmer? Are sea levels rising? To answer questions such as these, scientists need to collect.
00/XXXX 1 Data Processing in PRISM Introduction. COCO (CDMS Overloaded for CF Objects) What is it. Why is COCO written in Python. Implementation Data Operations.
SCD Research Data Archives; Availability Through the CDP About 500 distinct datasets, 12 TB Diverse in type, size, and format Serving 900 different investigators.
One-year re-forecast ensembles with CCSM3.0 using initial states for 1 January and 1 July in Model: CCSM3 is a coupled climate model with state-of-the-art.
Computer Literacy BASICS: A Comprehensive Guide to IC 3, 5 th Edition Lesson 3 Windows File Management 1 Morrison / Wells / Ruffolo.
UC 2006 Tech Session 1 NetCDF in ArcGIS 9.2. UC 2006 Tech Session2 Overview Introduction to Multidimensional DataIntroduction to Multidimensional Data.
Global Change Master Directory (GCMD) Mission “To assist the scientific community in the discovery of Earth science data, related services, and ancillary.
NetCDF Operators 1 netCDF Operators [NCO]
5-7 May 2003 SCD Exec_Retr 1 Research Data, May Archive Content New Archive Developments Archive Access and Provision.
8 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects.
GHRSST Users Symposium 2009 Working with the GHRSST Data Format Experiences of the GCOS SST/SI Intercomparison Working Group Tess Brandon, NOAA National.
NetCDF Data Model Details Russ Rew, UCAR Unidata NetCDF 2009 Workshop
Other Projects Relevant (and Not So Relevant) to the SODA Ideal: NetCDF, HDF, OLE/COM/DCOM, OpenDoc, Zope Sheila Denn INLS April 16, 2001.
MATLAB The name of MATLAB stands for matrix laboratory. Starting a MATLAB Session -On Microsoft® Windows® platforms, start the MATLAB program by double-clicking.
DHTML.
UNIDART Uniform Data Request Interface
Python data visualization
Andrew White, Brian Freitag, Udaysankar Nair, and Arastoo Pour Biazar
SRNWP Interoperability Workshop
Downloading Weather Observations
SQL and SQL*Plus Interaction
Intro to CMIP, the WHOI CMIP5 community server, and planning for CMIP6
Lecture: MATLAB Chapter 1 Introduction
IMPORTING AND EXPORTING DATA
MATLAB, netCDF, and OPeNDAP
The cf-python software library
MATLAB: Structures and File I/O
Multidimensional Data and GIS
ECONOMETRICS ii – spring 2018
SDMX Information Model
CdmCL, a Specific Textual Constraint Language for Common Data Model
Introduction to Cascading Style Sheets (CSS)
Comparing NetCDF and a multidimensional array database on managing and querying large hydrologic datasets: a case study of SciDB– P5 Haicheng Liu.
Classes and Objects.
8 6 MySQL Special Topics A Guide to MySQL.
Research Data Archives at NCAR
COMP60621 Designing for Parallelism
Using SQL*Plus.
HDF-EOS Workshop XXI / The 2018 ESIP Summer Meeting
HyperText Markup Language
Sokna Sek – MOH/DPHI Leng Ing – MOH/DPHI Sat Chap – MOH/DPHI
NCL variable based on a netCDF variable model
Comeaux and Worley, NSF/NCAR/SCD
Classes and Objects Systems Programming.
Comeaux and Worley, NSF/NCAR/SCD
7. Introduction to the main SDMX objects for metadata exchange
ECMWF usage, governance and perspectives
Presentation transcript:

(Network Common Data Form) LAB 3 : Data Resources netCDF (Network Common Data Form) What is netCDF? NetCDF (network Common Data Form) is an interface for array- oriented data access and a library that provides an implementation of the interface. The NetCDF library also defines a machine- independent format for representing scientific data. Together, the interface, library, and format support the creation, access, and sharing of scientific data. NetCDF maintains a collection of reanalysis datasets for use in climate diagnostics and attribution.

Data Resources netCDF LAB 3 : Reanalysis datasets are created by assimilating ("inputting") climate observations using the same climate model throughout the entire reanalysis period in order to reduce the affects of modeling changes on climate statistics. Observations are from many different sources including ships, satellites, ground stations, RAOBS, and radar. Currently, PSD makes available these reanalysis datasets to the public in our standard NetCDF format. PSD is Physical Sciences Division in ESRL Earth System Research Laboratory of NOAA NATIONAL OCEANIC AND ATMOSPHERIC ADMINISTRATION

LAB 3 : NetCDF Data Model NetCDF (Network Common Data Form) Topics Covered: 1. The ncdisp command : Open NetCDF File 2. The ncinfo command : Get Information About NetCDF File 3. The ncread command : Read Data from NetCDF File

LAB 3 : NetCDF Data Model A quick guide on how to use Matlab netCDF functions A netCDF file contains two parts: A "header" that describes the names, dimensions, etc., of the variables stored in the file. And the main body that contains the real data. To process a netCDF file, we need to first extract the information in the header and determine what portion/segment of the data we want to use. This is usually done by using a set of stand-alone tools. we will discuss in Part (A). Once the content of a netCDF file is known, it is rather straight forward to read the data as will be discussed in Part (B).

LAB 3 : NetCDF Data Model Part (A) Inspect the content of a netCDF file We will use the netCDF data file, pressure_9.nc, as an example to explain how the Matlab functions work. This file, extracted and downloaded from the NOAA ESRL-PSD web portal (www.esrl.noaa.gov/psd), contains the Atmospheric model CMAP gridded data for the long-term Mean sea level pressure for the global domain on a regular longitude latitude grid for the climatological means for January, February, ..., December. OR use this link for retrieve data from The European Centre for Medium-Range Weather Forecasts (ECMWF) http://apps.ecmwf.int/datasets/data/interim-full-daily http://apps.ecmwf.int/datasets/data/macc-reanalysis/levtype=sfc/

LAB 3 : Data Resources netCDF

Part(A) NetCDF Data Model(Header) LAB 3 : Part(A) NetCDF Data Model(Header) 1.The ncdisp command Display contents of NetCDF data source in Command Window Syntax 1- ncdisp(source) Displays as text in the Command Window ,all the group ,dimensions, variable definitions, and all attributes in the NetCDF data source 2- ncdisp(source,location) Displays information about the variable or group specified by location in source. 3- ncdisp(source,location,modestr) Displays the contents of the location in source according to the value of modestr.

Part(A) NetCDF Data Model(Header) LAB 3 : Part(A) NetCDF Data Model(Header) Step 0: Display/check the header of the netCDF file It is strongly recommended that the information in the header be examined before one uses the data in a netCDF file. 1- ncdisp(source) 1- ncdisp(source) Displays all the groups, dimensions, variable definitions, and all attributes in the NetCDF data source, as text in the Command Window. Example: >>ncdisp(‘PRESSURE_9.nc') source — Name of NetCDF file

Part(A) NetCDF Data Model(Header) LAB 3 : Part(A) NetCDF Data Model(Header) Step 0: Display/check the header of the netCDF file 1- ncdisp(source) >>ncdisp(‘PRESSURE_9.nc') Global Attributes: history = '2016-01-06 14:10:43 GMT by grib_to_netcdf-1.14.3: Dimensions: longitude = 16 latitude = 16 time = 120 (UNLIMITED)

Part(A) NetCDF Data Model(Header) LAB 3 : Part(A) NetCDF Data Model(Header) Step 0: Display/check the header of the netCDF file 1- ncdisp(source) >>ncdisp(‘PRESSURE_9.nc') Variables: longitude Size: 16x1 Dimensions: longitude Datatype: single Attributes: units = 'degrees_east' long_name = 'longitude'

Part(A) NetCDF Data Model(Header) LAB 3 : Part(A) NetCDF Data Model(Header) Step 0: Display/check the header of the netCDF file 1- ncdisp(source) >>ncdisp(‘PRESSURE_9.nc') latitude Size: 16x1 Dimensions: latitude Datatype: single Attributes: units = 'degrees_north' long_name = 'latitude'

Part(A) NetCDF Data Model(Header) LAB 3 : Part(A) NetCDF Data Model(Header) Step 0: Display/check the header of the netCDF file 1- ncdisp(source) >>ncdisp(‘PRESSURE_9.nc') time Size: 120x1 Dimensions: time Datatype: int32 Attributes: units = 'hours since 1900-01-01 00:00:0.0' long_name = 'time'

Part(A) NetCDF Data Model(Header) LAB 3 : Part(A) NetCDF Data Model(Header) Step 0: Display/check the header of the netCDF file 1- ncdisp(source) >>ncdisp(‘PRESSURE_9.nc') msl Size: 16x16x120 Dimensions: longitude,latitude,time Datatype: int16 Attributes: units = 'Pa' long_name = 'Mean sea level pressure' standard_name = 'air_pressure_at_sea_level'

2- ncdisp(source,location) LAB 3 : Part(A) NetCDF Data Model(Header) Step 0: Display/check the header of the netCDF file 2- ncdisp(source,location) >>ncdisp(‘PRESSURE_9.nc‘,’longitude’) Dimensions: longitude = 16 Variables: longitude Size: 16x1 Dimensions: longitude Datatype: single Attributes: units = 'degrees_east' long_name = 'longitude'

2- ncdisp(source,location) LAB 3 : Part(A) NetCDF Data Model(Header) Step 0: Display/check the header of the netCDF file 2- ncdisp(source,location) >>ncdisp(‘PRESSURE_9.nc‘,’latitude’) Dimensions: latitude = 16 Variables: latitude Size: 16x1 Dimensions: latitude Datatype: single Attributes: units = 'degrees_north' long_name = 'latitude'

2- ncdisp(source,location) LAB 3 : Part(A) NetCDF Data Model(Header) Step 0: Display/check the header of the netCDF file 2- ncdisp(source,location) >>ncdisp(‘PRESSURE_9.nc‘,’time’) Dimensions: time = 120 Variables: time Size: 120x1 Dimensions: time Datatype: int32 Attributes: units = 'hours since 1900-01-01 00:00:0.0' long_name = 'time'

2- ncdisp(source,location) LAB 3 : Part(A) NetCDF Data Model(Header) Step 0: Display/check the header of the netCDF file 2- ncdisp(source,location) >>ncdisp(‘PRESSURE_9.nc‘,’msl’) Dimensions: longitude = 16 latitude = 16 time = 120 (UNLIMITED) Variables: msl Size: 16x16x120 Dimensions: longitude,latitude,time Datatype: int16

2- ncdisp(source,location) LAB 3 : Part(A) NetCDF Data Model(Header) Step 0: Display/check the header of the netCDF file 2- ncdisp(source,location) >>ncdisp(‘PRESSURE_9.nc‘,’msl’) Attributes: units = 'Pa' long_name = 'Mean sea level pressure' standard_name = 'air_pressure_at_sea_level'

3- ncdisp(source,location,modestr) LAB 3 : Part(A) NetCDF Data Model(Header) Step 0: Display/check the header of the netCDF file 3- ncdisp(source,location,modestr) source Text string specifying the name of the NetCDF file location Text string specifying the location of the variable or group in the NetCDF file . Set location to / (forward slash) to display the entire contents of the file. Default: / modestr specifies the type of display . ‘min‘ Display group hierarchy and variables definitions. ‘full’ Display group hierarchy with dimensions, attributes, and variable definitions. Default :full

3- ncdisp(source,location,modestr) LAB 3 : Part(A) NetCDF Data Model(Header) 3- ncdisp(source,location,modestr) >> ncdisp('PRESSURE_9.nc', '/‘ , 'min') Source: D:\MATLAB\PRESSURE_9.nc Format: 64bit Variables: longitude Size: 16x1 Dimensions: longitude Datatype: single latitude Dimensions: latitude time Size: 120x1 Dimensions: time Datatype: int32 msl Size: 16x16x120 Dimensions: longitude,latitude,time Datatype: int16

3- ncdisp(source,location,modestr) LAB 3 : Part(A) NetCDF Data Model(Header) 3- ncdisp(source,location,modestr) >> ncdisp('PRESSURE_9.nc', '/‘ , ‘full') Is the same command >>ncdisp('PRESSURE_9.nc') >>ncdisp(‘PRESSURE_9.nc’, ’msl’ , ’min’) Source: D:\MATLAB\PRESSURE_9.nc Format: 64bit Variables: msl Size: 16x16x120 Dimensions: longitude,latitude,time Datatype: int16

Part(A) NetCDF Data Model(Header) LAB 3 : Part(A) NetCDF Data Model(Header) 2.The ncinfo command Return information about NetCDF data source Syntax finfo = ncinfo(source) vinfo = ncinfo(source,varname) ginfo = ncinfo(source,groupname) finfo = Filename: 'D:\MATLAB\PRESSURE9.nc' Name: '/' Dimensions: [1x3 struct] Variables: [1x4 struct] Attributes: [1x2 struct] Groups: [] Format: '64bit' >> finfo=ncinfo('PRESSURE9.nc') >> finfo_msl=ncinfo('PRESSURE9.nc','msl')

Part(B) NetCDF Data Model(Contains) LAB 3 : Part(B) NetCDF Data Model(Contains) 1.The ncread command A NetCDF dataset contains : Height Time Dimensions Variables Attributes Variables(long , lat ,time) Variables Dimensions Longitude Latitude Time long Latitude Longitude 10 11 12 13 For each location one value so for this ex. we have four locations . lat

Part(B) NetCDF Data Model(Contains) LAB 3 : Part(B) NetCDF Data Model(Contains) A NetCDF dataset contains : Dimensions Variables Attributes long Dimensions Longitude Latitude Time Variables(long , lat ,time) 9 9.1 Variables long 10 11 12 13 lat 42 41.9 lat

Part(B) NetCDF Data Model(Contains) LAB 3 : Part(B) NetCDF Data Model(Contains) A NetCDF dataset contains : Dimensions Variables Attributes long Dimensions Longitude Latitude Time Variables(long , lat ,time) 9 9.1 Variables long 9 9.1 42 41.9   lat 42 41.9 lat

Part(B) NetCDF Data Model(Contains) LAB 3 : Part(B) NetCDF Data Model(Contains) A NetCDF dataset contains : Dimensions Variables Attributes long Dimensions Longitude Latitude Time Variables(long , lat ,time) 9 9.1 Variables long 10 11 12 13 lat   42 41.9   Time   lat

Part(B) NetCDF Data Model(Contains) LAB 3 : Part(B) NetCDF Data Model(Contains) A NetCDF dataset contains : Dimensions Variables Attributes Dimensions Longitude Latitude Time Variables long 10 11 12 13 lat     Time Variables(long , lat ,time)  

Part(B) NetCDF Data Model(Contains) LAB 3 : Part(B) NetCDF Data Model(Contains) Here, we use the "normal" convention with each of the indices, i, j, and k, starting from 1.

1. Dimensions (for example, time, latitude, longitude, or height.) LAB 3 : NetCDF Data Model 1. Dimensions (for example, time, latitude, longitude, or height.) A dimension may be used to represent a real physical dimension, for example, time, latitude, longitude, or height. A dimension might also be used to index other quantities, for example station or model-run-number. A netCDF dimension has both a name and a length. 2. Variables(represents an array of values of the same type, which store the bulk data.) Variables are used to store the bulk of the data in a netCDF dataset. A variable represents an array of values of the same type. A scalar value is treated as a 0-dimensional array. A variable has a name, a data type, and a shape described by its list of dimensions specified when the variable is created. A variable may also have associated attributes, which may be added, deleted or changed after the variable is created.

LAB 3 : NetCDF Data Model 3. Attributes(are used to store data about the data ,ancillary data or metadata). NetCDF attributes are used to store data about the data (ancillary data or metadata), similar in many ways to the information stored in data dictionaries and schema in conventional database systems. Most attributes provide information about a specific variable. These are identified by the name (or ID) of that variable, together with the name of the attribute.

Part(B) NetCDF Data Model(Contains) LAB 3 : Part(B) NetCDF Data Model(Contains) 3.The ncread command Read data from variable in NetCDF data source Syntax vardata = ncread(source,varname)   source Text string specifying the name of the NetCDF file Varname Text string specifying the name of a variable in the NetCDF file Vardata The data in the variable, ncread uses the MATLAB datatype that is the closest type to the corresponding NetCDF datatype . >> ncdisp('PRESSURE_9.nc', '/‘ , 'min‘ ) >>long=ncread(‘PRESSURE_9.nc‘ , ‘longitude‘ ) Example:

Part(B) NetCDF Data Model(Contains) LAB 3 : Part(B) NetCDF Data Model(Contains) 3.The ncread command Example: vardata = ncread(source,varname) >> ncdisp( 'PRESSURE_9.nc', '/‘ , 'min') >>long=ncread( ‘PRESSURE_9.nc‘ , ‘longitude') >>lat=ncread( ‘PRESSURE_9.nc’ , ’latitude’) >>time=ncread( ‘PRESSURE_9.nc’ , ’time’) >>msl=ncread( ‘PRESSURE_9.nc’ , ’msl’) Example(1) :- Retrieve data from nc-file to read again in excel sheet for Baghdad only . Example(2) :- Retrieve data from nc-file to read again in excel sheet for all location .

LAB 3 : NetCDF Data Model clear all display('latitude for Baghdad =33') LT=input('Enter your latitude='); display('longitude for Baghdad =44') LG=input('Enter your longitude='); %%%%%%%%%%%%%%%%%%%%%%%%% msl=ncread('PRESSURE_9.nc','msl'); long=ncread('PRESSURE_9.nc','longitude'); lat=ncread('PRESSURE_9.nc','latitude'); time1=ncread('PRESSURE_9.nc','time'); msl=0.01*msl; % 1Pa=0.01 hPa

LAB 3 : NetCDF Data Model LGG=find(long==LG); LTT=find(lat==LT); if isempty(LGG)||isempty(LTT) disp('LOCATION NOT FOUND IN THIS NetCDF FILE') break end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% latt2=[LG ; LT]; msl_baghdad=msl(LGG,LTT,:); MSL=msl_baghdad(:); time=double(time1); AA=datestr(time./24+datenum('1900-01-01 0:0:0')); AA=datenum(AA);

LAB 3 : NetCDF Data Model AA=datenum(AA); yy=year(AA);mm=month(AA);dd=day(AA);hh=hour(AA); date1=[yy mm dd hh]; DD={'Year','Month','Day','Hour'}; X={'Pressure(hPa)'}; filename='msl_BAGHDAD2015_9.xlsx'; sheet = 1; C={'LOCATION: BAGHDAD','','','Longitude';'DATE FROM 1/9/2015 -30/9/2015','','','Latitude'}; xlswrite(filename,C,sheet,'A1') xlswrite(filename,DD,sheet,'A3') xlswrite(filename,latt2,sheet,'E1') xlswrite(filename,X,sheet,'E3') xlswrite(filename,date1,sheet,'A4') xlswrite(filename,MSL,sheet,'E4')

LAB 3 : NetCDF Data Model clear all ncdisp( 'PRESSURE_9.nc', '/','min') Variable=input('write your main variable='); msl=ncread('PRESSURE_9.nc',Variable); % 1Pa=0.01 hPa; msl=0.01*msl; long=ncread('PRESSURE_9.nc','longitude'); lat=ncread('PRESSURE_9.nc','latitude'); time1=ncread('PRESSURE_9.nc','time'); m=numel(long); n=numel(lat); h=0;g=0;

LAB 3 : NetCDF Data Model for i=1:n for j=1:m h=h+1; latt(h)=lat(i); longg(h)=long(j); end latt1=[longg ; latt]; mm=length(time1); MSL=zeros(mm,m*n);

LAB 3 : NetCDF Data Model for i=1:n for j=1:m g=g+1; MSL(:,g)=msl(j,i,:); end time=double(time1); AA=datestr(time./24+datenum('1900-01-01 0:0:0')); AA=datenum(AA); yy=year(AA);mm=month(AA);dd=day(AA);hh=hour(AA); date1=[yy mm dd hh]; DD={'Year','Month','Day','Hour'};

LAB 3 : NetCDF Data Model for i=1:n*m X(i)={'Pressure(hPa)'}; end filename='msl2015_9.xlsx'; sheet = 1; C={'LOCATION: IRAQ','','','Longitude';'DATE FROM 1/9/2015 -30/9/2015','','','Latitude'}; xlswrite(filename,C,sheet,'A1') xlswrite(filename,DD,sheet,'A3') xlswrite(filename,latt1,sheet,'E1') xlswrite(filename,X,sheet,'E3') xlswrite(filename,date1,sheet,'A4') xlswrite(filename,MSL,sheet,'E4')

LAB 3 : NetCDF Data Model >> NC_1LOC latitude for Baghdad =33 Enter your latitude=33 longitude for Baghdad =44 Enter your longitude=44 Variables: longitude Size: 16x1 Dimensions: longitude latitude Dimensions: latitude time Size: 120x1 Dimensions: time msl Size: 16x16x120 Dimensions: longitude,latitude,time write your main variable='msl'

LAB 3 : NetCDF Data Model >> NC_FILE Variables: longitude Size: 16x1 Dimensions: longitude latitude Dimensions: latitude time Size: 120x1 Dimensions: time msl Size: 16x16x120 Dimensions: longitude,latitude,time write your main variable='msl'

LAB 3 : NetCDF Data Model >> load pressure_9 >>map(longg,latt,MSL)

LAB 3 : NetCDF Data Model Example(1) :- Retrieve data from nc-file to read again in excel sheet for Baghdad only .

Example(2) :- Retrieve data from nc-file to read again in excel sheet for all location . LAB 3 : NetCDF Data Model

LAB 3 : http://apps.ecmwf.int/datasets/data/macc-reanalysis/levtype=sfc/ NetCDF Data Model

LAB 3 : NetCDF Data Model

LAB 3 : NetCDF Data Model