NetCDF and binary read in MATLAB Pierre Chien 2009/03/19.

Slides:



Advertisements
Similar presentations
NCAR Aviation Facility Processing Software. Current System Architecture Raw Data Processor On The Ground In Flight netCDF file WINDS Display Display &
Advertisements

Software development process. Explanation of the iterative nature of the software development process.
Introduction to Openmp & openACC
SCIP Optimization Suite
CHAPTER 5 INPUT/OUT FORMAT. Introduction READ (*,*) x WRITE (*,*) x This is free format: the first * is for I/O device number (* = input is keyboard *
The Model Output Interoperability Experiment in the Gulf of Maine: A Success Story Made Possible By CF, NcML, NetCDF-Java and THREDDS Rich Signell (USGS,
The NCAR Command Language (NCL) and the NetCDF Data Format Research Tools Presentation Matthew Janiga 10/30/2012.
Fortran 4- Reading and Writing from Data Files Chapter 4 of your Fortran book.
Better data management through NetCDF Jaison Kurian CAOS IISc.
Reading NetCDF Files in Matlab and analyzing the data.
Fprintf and other examples. Save command >> !ls >> a = 3; >> save afile a >> !ls afile.mat >> !dir Directory of C:\MATLAB6p5\work\save 11/21/ :30.
Collaboration Tools and Techniques for Large Model Data Sets Rich Signell,USGS Woods Hole, MA.
ME1107 Computing Y Yan
EGR 106 – Truss Design Project (cont.) Truss design programs Graphical interface tools in Matlab Saving and loading data Formatted output Project Assignment.
NetCDF An Effective Way to Store and Retrieve Scientific Datasets Jianwei Li 02/11/2002.
Lecture 7 Sept 17 Goals: Complete Chapter 4 Chapters 5 and 6.
General Computer Science for Engineers CISC 106 Lecture 07 Dr. John Cavazos Computer and Information Sciences 2/25/2009.
Introduction to NetCDF Ernesto Munoz. Outline Overview of NetCDF Overview of NetCDF NetCDF file information NetCDF file information CDL utilities: ncdump,
Input/Output Functions Selim Aksoy Bilkent University Department of Computer Engineering
Division Example 2x - 3y + 4z = 10 x + 6y - 3z = 4 -5x + y + 2z = 3 A*X = B where A = B = >> X = A\B X =
Input/Output Functions Selim Aksoy Bilkent University Department of Computer Engineering
The textread Function It is designed to read ASCII files that are formatted into columns of data Each column can be of a different type It is useful for.
CHARACTER DATA MET 50. Character data We have extensively used REAL and INTEGER data types. There is also: CHARACTER data COMPLEX data LOGICAL data 12/1/2011.
NetCDF Ed Hartnett Unidata/UCAR
HDF 1 NCSA HDF XML Activities Robert E. McGrath Mike Folk National Center for Supercomputing Applications.
Fortran- Subprograms Chapters 6, 7 in your Fortran book.
Session 2: Using OPeNDAP-enabled Applications to Access Australian Data Services and Repositories eResearch Australasia 2011, ½ Day Morning Workshop, Thursday.
1 NetCDF and Self-Describing Data Kate Hedstrom January 2010
MATLAB and Scientific Data: New Features and Capabilities
1. Fundamentals of Computer Systems Define a computer system Computer Systems in the modern world Professional standards for computer systems Ethical,
Beginning Fortran Fortran (77) Basics 22 October 2009 *Black text on white background provided for easy printing.
Netcdf course Intro CF convention Netcdf excercises.
NetCDF-4 The Marriage of Two Data Formats Ed Hartnett, Unidata June, 2004.
1 High level view of HDF5 Data structures and library HDF Summit Boeing Seattle September 19, 2006.
NetCDF for Developers and Data Providers Russ Rew, UCAR Unidata ICTP Advanced School on High Performance and Grid Computing 14 April 2011.
Development of ORBIT Data Generation and Exploration Routines G. Shelburne K. Indireshkumar E. Feibush.
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.
Matlab Training Session 10: Loading Binary Data Course Website: Training Sessions.htm.
Advanced Rappture Concepts and Tips Michael McLennan Software Architect HUBzero™ Platform for Scientific Collaboration.
Session 3: Using OPeNDAP-enabled Applications to Access Australian Data Services and Repositories eResearch Australasia 2011, ½ Day Morning Workshop, Thursday.
Project 4 : SciDAC All Hands Meeting, September 11-13, 2002 A. Choudhary, W. LiaoW. Gropp, R. Ross, R. Thakur Northwestern UniversityArgonne National Lab.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room , Chris Hill, Room ,
Climate Data Formats Deniz Bozkurt
Some Fortran programming tips ATM 562 Fall 2015 Fovell (see also PDF file on class page) 1.
HDF5.
Introduction Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
1 Lab 1. C Introduction  C: –Developed by Bell lab. in –a procedure-oriented programming language.  Developing environments: –Editing –Preprocessing.
Introduction Copyright © Software Carpentry This work is licensed under the Creative Commons Attribution License See
Input and Output I: ASCII and Binary files. Data formats ASCII Binary netCDF HDF.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
The HDF Group Introduction to netCDF-4 Elena Pourmal The HDF Group 110/17/2015.
FITSIO, HDF4, NetCDF, PDB and HDF5 Performance Some Benchmarks Results Elena Pourmal Science Data Processing Workshop February 27, 2002.
GIS for Atmospheric Sciences and Hydrology By David R. Maidment University of Texas at Austin National Center for Atmospheric Research, 6 July 2005.
Higher Computing Science 2016 Prelim Revision. Topics to revise Computational Constructs parameter passing (value and reference, formal and actual) sub-programs/routines,
File Operations in Matlab Load / Save *.dat, *.mat vs. -ascii fopen /fclose.
Input Output Garbage In, Garbage Out. Outline Announcements: –HWII solutions on web soon –Homework III: due Wednesday Advanced ASCII Binary Basics Cell-arrays.
SUNY-New Paltz Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz “Lecture 11”
TSDS (HPDE DAP). Objectives (1) develop a standard API for time series-like data, (2) develop a software package, TSDS (Time Series Data Server), that.
Libcf – A CF Convention Library for NetCDF Ed Hartnett Unidata Program Center Boulder Colorado June 11, 2007.
Input Output Garbage In, Garbage Out. Outline Announcements: –Homework III: due Wednesday Advanced ASCII Binary Basics Filesystem Fun.
Getting started with Matlab: Outline
NetCDF 3.6: What’s New Russ Rew
COUNTING IN BINARY Binary weightings 0 x x x x 8
Tad Scheiblich RSI December 2, 2005
CEE 6440 GIS in Water Resources Fall 2004 Term Paper Presentation
NetCDF and Scientific Data Standard
MIT MSEAS Software Software reads and displays any model output for MOOS-IVP Provides ocean images on which vehicle simulations are superimposed Snapshots.
COUNTING IN BINARY Binary weightings 0 x x x x 8
NCL variable based on a netCDF variable model
Presentation transcript:

NetCDF and binary read in MATLAB Pierre Chien 2009/03/19

NetCDF in FORTRAN 77

NetCDF (network Common Data Form) is a set of software libraries and machine- independent data formats that support the creation, access, and sharing of array- oriented scientific data

Use NetCDF in MATLAB Two path were required to be added before using NetCDF –addpath mexnc –addpath matlab_netCDF_OPeNDAP Two common way to read NetCDF –inqnc(‘file’) To see what do they have in this nc file –getnc(‘file’,‘variable_name’); To get the variable in the nc file

Use NetCDF in Linux ncdump -h file –Output the title for this nc file ncdump -v variable file –Output the value in this variable for this nc file

Use NetCDF in FORTRAN PROGRAM MAIN include ‘netcdf.inc’ INTEGER start(3),count(3),strid(3) INTEGER ncid,varid,status REAL TEMP(No,Na,itime) … DATA start /1,1,1/ DATA count /1,1,1/ DATA strid /1,1,1/ … status=nf_open(input, nf_nowrite, ncid) If (status.ne. nf_noerr)print *, nf_strerror(status) status = nf_inq_varid (ncid, ‘U10’, varid) status = nf_get_varS_real (ncid, varid, start, count, strid, TEMP) … nfclose = nf_close(ncid)

Write NetCDF in FORTRAN PROGRAM MAIN include ‘netcdf.inc’ INTEGER start(3),count(3) INTEGER ncid,varid,status REAL TEMP(No,Na,itime) … DATA start /1,1,1/ DATA count /1,1,1/ … status=nf_open(input, nf_write, ncid) status = nf_inq_varid (ncid, ‘U10’, varid) status = nf_get_varA_real (ncid, varid, start, count, TEMP) … status = nf_put_varA_real(ncid, varid, start, count, TEMP) … nfclose = nf_close(ncid)

Read and Write binary file in MATLAB

ASCII file in FORTRAN OPEN(174, file='T2_test', form='formatted') WRITE(174,*) 'ITF=', ITF-1 DO J = 1, J0 write(174,999) ((T2(I,J,1)+T2(I,J,2))*.5, I = 1, I0) ENDDO 999 format(122f8.3)

Binary file in FORTRAN OPEN(175, file='T2_testa', form='unformatted') WRITE(175) ((REAL(T2(I,J,1)+T2(I,J,2))*.5,I=1,I0),J=1,J0)

Reading binary file in MATLAB INTSIZE4=‘int32’; REALSIZE = ‘real*4’; fid = fopen(‘file’,‘r’,‘b’); fread(fid,1,INTSIZE4) TEMP = fread(fid,I0*J0,REALSIZE); SST = reshape(TEMP,I0,J0); fread(fid,1,INTSIZE4) fclose(fid);