<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:Calibri">Thank you Rick,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri">Filedimdef successfully added lat/lon, but how can we remove DIM_001/ DIM_002 and assign lat/lon to the variable pixTot?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri">&nbsp;&nbsp; file global attributes:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri">&nbsp;&nbsp; dimensions:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri">&nbsp; &nbsp; &nbsp; DIM_001 = 1440<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri">&nbsp; &nbsp; &nbsp; DIM_002 = 720<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri">&nbsp; &nbsp; &nbsp; lat = 1440<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri">&nbsp; &nbsp; &nbsp; lon = 720<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri">&nbsp;&nbsp; variables:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri">&nbsp; &nbsp; &nbsp; integer pixTot ( DIM_001, DIM_002 )<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; CodeMissingValue :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -9999<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; DimensionNames :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nlon,nlat<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family:Calibri"><o:p>&nbsp;</o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-family:Calibri;color:black">From: </span>
</b><span style="font-family:Calibri;color:black">Rick Brownrigg &lt;brownrig@ucar.edu&gt;<br>
<b>Date: </b>Monday, May 1, 2017 at 4:15 PM<br>
<b>To: </b>&quot;Su, Jian (GSFC-610.2)[ADNET SYSTEMS INC]&quot; &lt;jian.su@nasa.gov&gt;<br>
<b>Cc: </b>&quot;ncl-talk@ucar.edu&quot; &lt;ncl-talk@ucar.edu&gt;<br>
<b>Subject: </b>Re: [ncl-talk] change dimensions to lat/lon<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi Jay,<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">There are probably several ways to do this. One that occurs to me is to create the dimensions in the new file with the &quot;filedimdef&quot; procedure:<br>
<br>
&nbsp;&nbsp;&nbsp; <a href="http://ncl.ucar.edu/Document/Functions/Built-in/filedimdef.shtml">http://ncl.ucar.edu/Document/Functions/Built-in/filedimdef.shtml</a><o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">So in your case, that might look something like:<br>
<br>
&nbsp;&nbsp;&nbsp; filedimdef(f,(/&quot;lat&quot;,&quot;lon&quot;/),(/1440, 720/), (/False,False/))<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">You can add the other information directly as global attributes of the file:<o:p></o:p></p>
</div>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp; f-&gt;LatitudeResolution=0.25<o:p></o:p></p>
</div>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp; f-&gt;LongitudeResolution=0.25<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">&nbsp;&nbsp;&nbsp; ...etc...<o:p></o:p></p>
</div>
<p class="MsoNormal">Hope that helps...<o:p></o:p></p>
</div>
<p class="MsoNormal">Rick<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">On Mon, May 1, 2017 at 12:28 PM, Su, Jian (GSFC-610.2)[ADNET SYSTEMS INC] &lt;<a href="mailto:jian.su@nasa.gov" target="_blank">jian.su@nasa.gov</a>&gt; wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hello,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I am using ncl to convert HDF5 files to netCDF, and one of them looks like this:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Variable: f<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Type: file<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">filename:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; out<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">path:&nbsp;&nbsp;&nbsp; out.nc4<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;&nbsp; file global attributes:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;&nbsp; dimensions:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp; &nbsp; &nbsp; DIM_001 = 1440<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp; &nbsp; &nbsp; DIM_002 = 720<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;&nbsp; variables:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp; &nbsp; &nbsp; integer pixTot ( DIM_001, DIM_002 )<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; CodeMissingValue :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -9999<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; DimensionNames :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nlon,nlat<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">How can I change DIM_001 and DIM_002 to lat/lon, and add the grid information eg,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">LatitudeResolution=0.25;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">LongitudeResolution=0.25;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">NorthBoundingCoordinate=90;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">SouthBoundingCoordinate=-90;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">EastBoundingCoordinate=180;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">WestBoundingCoordinate=-180;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thanks,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Jay<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
</body>
</html>