Indian Forum for Water Adroit

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Sonali

Pages: 1 ... 20 21 [22]
316
Models / Principal Components Analysis
« on: October 28, 2011, 02:02:27 PM »
Notes on PCA, which I got from Deepa. It is really nice. :) :) :). It may help you.

317
Data / NETCDF and MATLAB
« on: October 28, 2011, 01:38:10 PM »
NETCDF and MATLAB

Generally GCM outputs are available in NetCDF format. We need to extract it for our analysis purpose.
 NetCDF (Network Common Data Form) is a set of software libraries and self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data.
A netCDF dataset contains dimensions, variables, and attributes, which all have both a name and an ID number by which they are identified. These components can be used together to capture the meaning of data and relations among data fields in an array-oriented dataset. The netCDF library allows simultaneous access to multiple netCDF datasets which are identified by dataset ID numbers, in addition to ordinary file names.

MATLAB is an integrated technical computing environment that combines numeric computation, advanced graphics and visualization, and a high-level programming language. MATLAB provides access to more than 30 functions in the Network Common Data Form (netCDF) interface. In most cases, the syntax of the MATLAB function is similar to the syntax of the netCDF library function. The functions are implemented as a package called netcdf. To use these functions, prefix the function name with package name netcdf. For example, to call the netCDF library routine used to open existing netCDF files, use the following MATLAB syntax:

ncid = netcdf.open (ncfile, mode );

NetCDF Library Functions

File Operations

netcdf: Summary of MATLAB Network Common Data Form (netCDF) capabilities

netcdf.abort: Revert recent netCDF file definitions

netcdf.close: Close netCDF file

netcdf.create: Create new netCDF dataset

netcdf.endDef: End netCDF file define mode

netcdf.getConstant: Return numeric value of named constant

netcdf.getConstantNames: Return list of constants known to netCDF library

netcdf.inq: Return information about netCDF file

netcdf.inqLibVers: Return netCDF library version information

netcdf.open: Open netCDF file

netcdf.reDef: Put open netCDF file into define mode

netcdf.setDefaultFormat: Change default netCDF file format

netcdf.setFill: Set netCDF fill mode

netcdf.sync: Synchronize netCDF file to disk



Dimensions



netcdf.defDim: Create netCDF dimension

netcdf.inqDim: Return netCDF dimension name and length

netcdf.inqDimID: Return dimension ID

netcdf.renameDim: Change name of netCDF dimension



Variables


netcdf.defVar: Create netCDF variable

netcdf.getVar: Return data from netCDF variable

netcdf.inqVar: Return information about variable

netcdf.inqVarID: Return ID associated with variable name

netcdf.putVar: Write data to netCDF variable

netcdf.renameVar: Change name of netCDF variable



Attributes


netcdf.copyAtt: Copy attribute to new location

netcdf.delAtt: Delete netCDF attribute

netcdf.getAtt: Return netCDF attribute

netcdf.inqAtt: Return information about netCDF attribute

netcdf.inqAttID: Return ID of netCDF attribute

netcdf.inqAttName: Return name of netCDF attribute

netcdf.putAtt: Write netCDF attribute

netcdf.renameAtt: Change name of attribute



Reading NETCDF files in MATLAB


•        Open the NETCDF file using the command netcdf.open(‘filename’,’NC_NOWRITE’)

•         Explore the contents of the NETCDF file using the command netcdf.inq(ncid) and store the values in an array.

•         Check what global information is stored in the NETCDF file using netcdf.getAtt(ncid,netcdf.getConstant(‘NC_GLOBAL’),’fielname’)

•         Get the dimensions value and iterate through the dimensions to get the dimension Information using the function netcdf.inqDim(netcdf,dimid)

•         Get the data from the netcdf file by using the function netcdf.getVar(ncid,attid)

•         Missing data as flagged in the NETCDF file is replaced with NaN (not a number) value

•         A check for scale factor and add offset is also done, and data is scaled first and then offset is added to the data. (as per UNIDATA best practices )

•         Data attributes are stored in a structure named with the same name as the data and ending in “_info”

•         After reading the data a separate function is called to create a movie file in MATLAB which will allow us to animate the varying precipitation data over the years.


Here is an example, which may help you in intial stage to deal with data in NetCDF format

Code: [Select]
%% Open netcdf file
filename = 'nswrs.sfc.gauss.1990.nc';
ncid = netcdf.open(filename,'NC_NOWRITE');
 
%% Explore the Contents
[numdims,nvars,natts] = netcdf.inq(ncid);
 
%% Get Global attributes Information
for ii = 0:natts-1
    fieldname = netcdf.inqAttName(ncid, netcdf.getConstant('NC_GLOBAL'), ii);
    fileinfo.(fieldname) = netcdf.getAtt(ncid,netcdf.getConstant('NC_GLOBAL'), fieldname );
end
 %% Open netcdf file
filename = 'nswrs.sfc.gauss.1990.nc';
ncid = netcdf.open(filename,'NC_NOWRITE');
 
%% Explore the Contents
[numdims,nvars,natts] = netcdf.inq(ncid);
 
%% Get Global attributes Information
for ii = 0:natts-1
    fieldname = netcdf.inqAttName(ncid, netcdf.getConstant('NC_GLOBAL'), ii);
    fileinfo.(fieldname) = netcdf.getAtt(ncid,netcdf.getConstant('NC_GLOBAL'), fieldname );
end
    % Get raw data
    data = netcdf.getVar(ncid,ii-1);
   
    % Replace Missing Numbers (if necessary
    if (isfield(tmpstruct, 'missing_value') )
        data( data == tmpstruct.missing_value ) = NaN;
    end
   
    % Scale data (if necessary)
    if( isfield(tmpstruct, 'scale_factor') )
        data = double(data) * tmpstruct.scale_factor;
    end
    % Apply offset (if necessary)
    if( isfield(tmpstruct, 'add_offset') )
        data = data + tmpstruct.add_offset;
    end
   
    % Transpose data from column major to row major
    if( isnumeric(data) && ndims(data) > 2 )
        data = permute(data, [2 1 3:ndims(data)]);
    elseif ( isnumeric(data) && ndims(data) == 2 )
        data = data';
    end
% store attribute and data with appropriate name
    varinfoname = [name '_info'];
    assignin('caller', varinfoname, tmpstruct);
    assignin('caller', name, data);
end
%% Close File
netcdf.close(ncid);
 

[/font][/size]

318
Data / NCEP/NCAR Reanalysis Data
« on: October 28, 2011, 12:57:32 PM »
NCEP/NCAR Reanalysis Data

The NCEP/NCAR Reanalysis Project is a joint project between the National Centers for Environmental Prediction (NCEP, formerly "NMC") and the National Center for Atmospheric Research (NCAR). The goal of this joint effort is to produce new atmospheric analyses using historical data (1957 onwards) and as well to produce analyses of the current atmospheric state (Climate Data Assimilation System, CDAS).

http://www.esrl.noaa.gov/psd/data/reanalysis/reanalysis.shtml

http://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanalysis.derived.html
 [NCEP/NCAR Reanalysis Monthly Means and Other Derived Variables]

NCEP/NCAR reanalysis output variables are classified in to four categories depending on the relative influence of the observational data and the model on the gridded variable. (kalnay et al., 1996). Category A the analysis of variable is strongly influenced by observed data; hence it is more reliable class (e.g., upper air temperature & wind). Category B the analysis of variable is strongly influenced by model data and lesser direct effect of observed data as compared to category A (e.g., humidity, surface temperature). Category C, no observations directly affecting and derived solely from the model (e.g., clouds and precipitation). Category D represents a field that is fixed from climatological values and does not depend on the model (e.g., plant resistance, land sea mask).


319
Data / Indian Institute of Tropical Meteorology
« on: October 28, 2011, 12:54:56 PM »
Indian Institute of Tropical Meteorology

IITM is a premiere research Institute to generate scientific knowledge in the field of meteorology and atmospheric sciences that has potential application in various fields such as agriculture, economics, health, water resources, transportation, communications, etc. It functions as a national centre for basic and applied research in monsoon meteorology.

Meteorological Data Sets for downloading


http://www.tropmet.res.in/Data%20Archival-51-Page

http://www.tropmet.res.in/static_page.php?page_id=64


320
Data / Downloading GCM Data
« on: October 28, 2011, 12:50:10 PM »
General Circulation Model or global climate model is often shortened to GCM and can be used for weather forecasting, understanding climate and predicting climate change. General Circulation Models take many factors into account including atmospheric, chemical, biological, ocean movement and more.

There are mainly two types of GCMs are available. Atmospheric and Ocean GCMs. Separately they account for the changes within the atmosphere and the ocean respectively. Put together they make up a complete climate model which is a 'coupled' model i.e. coupled atmosphere-ocean General Circulation Models (AOGCMs).

These models most often used to make the predictions of future climate. These predictions are sometimes called scenarios. Based on different scenarios the IPCC (intergovernmental panel on climate change) can recommend measures to mitigate global warming and can predict what results a specific reduction in green house gases are likely to have.

Advanced coupled atmosphere-ocean General Circulation Model can also to some extent predict regional climate changes. These predictions help in future planning and policy making for a nation in various fields.


Links to Download GCM Data and Important information about different hydrologic and climatic variables


http://www-pcmdi.llnl.gov/new_users.php Coupled Model Intercomparison Project (CMIP)

https://esg.llnl.gov:8443/index.jsp

http://www.mad.zmaw.de/index.html

http://www.cgd.ucar.edu/pcm/

http://www.ipcc-data.org/ [IPCC Data Distribution Centre]

https://esgcet.llnl.gov:8443/about/ipccTables.do [All Variables]

http://www.cccma.ec.gc.ca/data/data.shtml [Canadian Centre for Climate Modelling and Analysis]

http://disc.sci.gsfc.nasa.gov/giovanni/additional/users-manual/G3_manual_parameter_appendix.shtml

[Giovanni-3 Online Users Manual: Data Parameter Appendix, which provides short descriptions & supporting links for data parameters in Giovanni-3 instances (bridge between data and Science).]

321
Announcements / Re: Mobile numbers of people at IISc
« on: October 28, 2011, 09:07:12 AM »
9611025512

[SONALI PATTANAYAK]

Pages: 1 ... 20 21 [22]