NetCDF 資料格式介紹 NCL 變數設定介紹

Slides:



Advertisements
Similar presentations
Introduction to arrays
Advertisements

NCL NCL stands for NCAR Command Language. It is similar to IDL and MATLAB. It is most convenient for reading NetCDF files and plotting maps, but there.
CIS 101: Computer Programming and Problem Solving Lecture 2 Usman Roshan Department of Computer Science NJIT.
EGR 106 – Week 2 – Arrays Definition, size, and terminology Construction methods Addressing and sub-arrays Some useful functions for arrays Character arrays.
Introduction to Computing Dr. Nadeem A Khan. Lecture 24.
Lecture 2 MATLAB fundamentals Variables, Naming Rules, Arrays (numbers, scalars, vectors, matrices), Arithmetical Operations, Defining and manipulating.
EGR 106 – Week 3 – More on Arrays Brief review of last week Additional ideas: – Special arrays – Changing an array – Some array operators – Character arrays.
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.
The NCAR Command Language (NCL) Ethan Alpert Visualization and Enabling Technologies Section, SCD, NCAR.
Mathcad Variable Names A string of characters (including numbers and some “special” characters (e.g. #, %, _, and a few more) Cannot start with a number.
Matlab tutorial course Lesson 2: Arrays and data types
Lists in Python.
ArcGIS and NASA EOS Data NASA GES DISC Team: Aijun Chen, Wenli Yang, Peisheng Zhao, Long Pham, Chris Lynnes, Gail Wade NASA ESDIS: Ross Bagwell, Francis.
NCL Introduction Dennis Shea National Center for Atmospheric Research.
Slides based on lectures from the NCL workshop Also see the NCL homepage.
NetCDF Operators 1 netCDF Operators [NCO]
Introduction Dennis Shea NCAR is sponsored by the National Science Foundation.
1 Structured Query Language (SQL). 2 Contents SQL – I SQL – II SQL – III SQL – IV.
File IO Dennis Shea National Center for Atmospheric Research pdf Vis5D png NCAR is sponsored by the National Science Foundation Shapefiles.
Brief Overview: GRIB, HDF, WRF.nc
The HDF Group HDF/HDF-EOS Workshop XV1 Tools to Improve the Usability of NASA HDF Data Kent Yang and Joe Lee The HDF Group April 17, 2012.
>> x = [ ]; y = 2*x y = Arrays x and y are one dimensional arrays called vectors. In MATLAB all variables are arrays. They allow functions.
Eurasia Institute of Earth Sciences Istanbul Technical University NCL Introduction Deniz Bozkurt web.itu.edu.tr/bozkurtd ITU Eurasia Institute of Earth.
NCL Sample Scripts Dennis Shea Climate and Global Dynamics Division Climate Analysis Section.
Dennis Shea National Center for Atmospheric Research
Data File Formats: netCDF by Tom Whittaker University of Wisconsin-Madison SSEC/CIMSS 2009 MUG Meeting June, 2009.
CIVIL AND GEOMATIC ENGINEERING FT Okyere. CIV 257- COMPUTER PROGRAMMING Lecture 3.
Arrays. Review of last lecture Overview of computer languages Overview of IDL Strength of IDL: (1) Interactive/compiled modes; (2) Array-oriented; (3)
 2008 Pearson Education, Inc. All rights reserved. 1 Arrays and Vectors.
Introduction to Engineering MATLAB – 4 Arrays Agenda Creating arrays of numbers  Vectors: 1-D Arrays  Arrays: 2-D Arrays Array Addressing Strings & String.
Two Dimensional Arrays. Students will be able to: code algorithms to solve two- dimensional array problems. use 2-D arrays in programs. pass two-use 2-D.
NetCDF Operators 1 netCDF Operators [NCO]
Introduction Dennis Shea NCAR is sponsored by the National Science Foundation.
NcBrowse: A Graphical netCDF File Browser Donald Denbo NOAA-PMEL/UW-JISAO
Arrays and Collections
ARRAYS (Extra slides) Arrays are objects that help us organize large amounts of information.
Chapter 11 - JavaScript: Arrays
Adding CF Attributes to an HDF5 File
Python data visualization
File Input / Output Dennis Shea Input Output
(Network Common Data Form)
Matrices Rules & Operations.
Two-Dimensional Arrays Lesson xx
© 2016 Pearson Education, Ltd. All rights reserved.
Complex data types Complex data types: a data type made of a complex of smaller pieces. Pascal has four very commonly used complex data types: strings,
Debugging and Random Numbers
EGR 115 Introduction to Computing for Engineers
Efficiently serving HDF5 via OPeNDAP
Introduction to Programming for Mechanical Engineers (ME 319)
National Scientific Library at Tbilisi State University
JavaScript: Functions.
>> JavaScript: Arrays
Engineering Problem Solving with C++, Etter/Ingber
Lists in Python.
Matlab tutorial course
Numbers.
NetCDF and Scientific Data Standard
CSCI N207 Data Analysis Using Spreadsheet
Web DB Programming: PHP
JavaScript Arrays.
Statistics 540 Computing in Statistics
Array Creation ENGR 1181 MATLAB 02.
HDF5 Performance Enhancements with the Elimination of Unlimited Dimension Debbie Mao, Daniel Ziskin, Merritt Deeter, Sara Martinez-alonso MOPITT is an.
HDF-EOS Workshop XXI / The 2018 ESIP Summer Meeting
Arrays In this section of notes you will be introduced to a composite type where all elements must be of the same type (homogeneous): arrays Homogeneous.
Using Script Files and Managing Data
Announcements P3 due today
Multi-Dimensional Arrays
GSICS Baseline Review: Product meta-data and structures
NCL variable based on a netCDF variable model
Presentation transcript:

NetCDF 資料格式介紹 NCL 變數設定介紹

什麼是NetCDF? 常用的大氣資料格式 以副檔名 .nc 標示 self-described data format 用 ncdump -h 將檔頭印出 與 NCL 一樣都是 NCAR 的產品 變數設定的方式與 NCL 一模一樣 Exercise 1b: 用NCL互動模式讀取NC檔案

NCL 變數設定 X f = addfile(“foo.nc”,”r”) ; grb/hdf x = f->X Scalar or Array f = addfile(“foo.nc”,”r”) ; grb/hdf x = f->X NCL reads scalar/array variable, attributes, and coordinate variables as one object (structure) attributes long_name _FillValue units add_offset scale_factor etc. X accessed via @ accessed via & values Scalar or Array attributes long_name _FillValue units add_offset scale_factor etc. time lev lat lon etc. coord var ‘Pictoral’ view of NVL variable time lev lat lon etc. coordinates

assign/access with @ character Attributes [ @ ] info associated with a variable or file attributes can be any data type except file or list scalar, multi dimensional array (string, numeric) assign/access with @ character T = (/ 10, 25, 39 /) T@units = “degC” T@long_name = “Temperature” T@wgts = (/ 0.25, 0.5, 0.25 /) T@x2d = (/ (/1,2,3/), (/4,5,6/), (/7,8,9/) /) T@_FillValue = -999 title = T@long_name attribute functions [isatt, getfilevaratts] if (isatt(T,"units")) then .... end if atts = getfilevaratts (fin, "T") delete an attribute: delete(T@wgts)

netCDF Operators [NCO] & CDO: _FillValue attribute Unidata & NCL reserved attribute; CF compliant netCDF Operators [NCO] & CDO: _FillValue attribute ncview: recognizes missing_value attribute (COARDS) best to create netCDF files with both NCL functions recognize _FillValue most functions will ignore for computations (eg, “avg”) use built-in function “ismissing” to check for _FillValue if (any (ismissing(T) )) then … end if NOTE: if (any(T.eq.T@_FillValue)) will not work NCL: best to not use zero as a _FillValue OK except when contouring [random bug]

Arrays: Indexing & Dimension Numbers row major left dimension varies slowest; right dim varies fastest dimension numbering left to right [0,1,..] subscripts 0-based [ entire range for N index values: 0,N-1 ] Consider T(:, :, :, :) T (0, 1, 2, 3) left dimension is 0 : varies slowest mid-left dimension is 1 mid-right dimension is 2 right dimension is 3 : varies fastest Some processing functions operate on dimension numbers Example: T(ntim, klev, nlat, mlon)  T(0, 1, 2, 3) Tzon = dim_avg_n( T, 3 )  Tzon(ntim, klev, nlat) Tstd = dim_stddev_n( T, 0 )  Tstd (klev, nlat, mlon)

NCL (netCDF): Named Dimensions [!] may be “named”: x(time,level,lat,lon) dimensions are named on netCDF files alternative way to reference subscripts assigned with ! character {let T(:,:,:) -> T(0,1,2)} T!0 = "time" ; leftmost [slowest varying] dim T!1 = "lat“ T!2 = "lon" ; rightmost [fastest varying] dim dim names may be renamed, retrieved T!1 = ”latitude" … dName = T!2 delete can eliminate: delete (T!2) ! Functionality is like R’s rownames and colnames named dimensions used to reshape T(lat|:, lon|:, time|:)

Variable Subscripting (2 of 3) Coordinate Variable Subscripting only applies to coordinate variables (1D, mono) same rules apply for ranges, strides, defaults use curly brackets {…} standard and coordinate subs can be mixed [if no reorder] T(2:7,{-30:30},:)  six times, all lon, lat -30° to +30° (inclusive) T(0,{-20},{-180:35:3})  1st time, lat nearest -20°, every 3rd lon between -180° and 35° T(::12,{latS:latN},:)  all times/lon, lat latS to latN (inclusive) T(8,{latS},{lonL:lonR:3}) 9th time, lat nearest latS, every 3rd lon between latL and lonR