Reading NC Files

Source: Internet
Author: User

1. ArcGIS

Multidimention tools, make NetCDF Raster Layer

Note: It is difficult to know only through ArcGIS that the displayed image has a linear relationship with the real image

The file structure can be viewed through MATLAB:

blh
Dimensions:longitude,latitude, Time
datatype:int16
Scale_factor = 0.0326
Add_offset = 1.09e+03
_fillvalue = -3.28e+04
units = ' m '
Span style= "font-family: ' Times New Roman ', Times;" > Long_name = ' boundary layer height '

2. Matlab

% convert NC to Tiff written by Chengli Wang%the Workfile should being directed to the NC file clcclearfile_dir= ' k:\ Liu Lei \u disk contents \ Zhang Xiuying \baselayers\boundary Layer height\nc\ '; Addpath (File_dir); Out_dir=strcat (File_dir, ' \output '); mkdir (Out_dir); % Create new file File_id=ls ([File_dir, ' *.nc ']);% find all the *.nc[m,n]=size (file_id);%ncdisp (file_id (1,:));% the WORKF Ile should is directed to the NC file%ncinfo (file_id (1,:));   R=georasterref (' Rastersize ', [401 561], ' rasterinterpretation ', ' cells ',... ' Latlim ', [5], ' Lonlim ', [[], ' columnsstartfrom ', ' North '),% r=georasterref (' rastersize ', [561 401], ' Rasterinterpretation ', ' cells ',...% ' Latlim ', [5-0.125 55+0.125], ' Lonlim ', [70-0.125 140+0.125], ' columnsstartfrom ', '    South '), various= ' BLH '; for a=1:m yy=file_id (a,1:4);    Img=ncread (file_id (A,:), various);    % Img=ncread (file_id (A,:), '/variables/blh ')% Lat=ncread (file_id (A,:), ' latitude ');    % Lon=ncread (file_id (A,:), ' longitude ');    % Time=ncread (file_id (A,:), ' time ');          [A,b,c]=size (IMG) For I=1:c data0=img (:,:, i);        scale_factor=0.032599;        add_offset=1019.5013;        Data=data0*scale_factor+add_offset;        Data=data ';        If i>=10 mm=num2str (i);        else Mm=strcat (' 0 ', num2str (i));    End Out_id=strcat (out_dir, ' \ ', yy,mm, '. tif ') geotiffwrite (out_id,data,r); End End

  

Reading NC Files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.