<div dir="ltr"><div dir="ltr"><div dir="ltr">Oi Vanúcia</div><div dir="ltr"><br></div><div>I believe I answered a similar question on 14 February. Note the '<span><span style="color:rgb(0,0,255)"><b>-nc4c</b><font color="#000000">'</font></span></span> option at the end.</div><div><br></div><div><div>%> <a href="https://www.ncl.ucar.edu/Document/Tools/ncl_convert2nc.shtml" target="_blank"><b>ncl_convert2nc</b></a> <span>MOD11_L2.hdf <span style="color:rgb(0,0,255)"><b>-nc4c</b></span></span></div></div><div dir="ltr"><br></div><div dir="ltr"><span>netCDF's "Classic mode" refers to netCDF-3. <br></span></div><div dir="ltr"><span>netCDF-3 <b>does not support</b> (allow) <b>unsigned integer</b> types</span></div><div dir="ltr"><div>netCDF-4 does allow (support) these numeric types.</div><div><br></div><div>Surprisingly, <b>ncl_convert2nc </b>converted these numeric data types to type short<b>.</b></div><div>I <b>speculate </b>this would be 'ok.'<b><br></b></div><div><br></div><div> <br></div><div>%> <b>ncl_convert2nc</b> MOD11_L2.hdf <b>-nc4c</b><br>Processing file: MOD11_L2.hdf...<br> Copyright (C) 1995-2017 - All Rights Reserved<br> University Corporation for Atmospheric Research<br> NCAR Command Language Version 6.5.0 -29Mar2018_0148<br> The use of this software is governed by a License Agreement.<br> See <a href="http://www.ncl.ucar.edu/">http://www.ncl.ucar.edu/</a> for more details.</div><div>C<b>lassic mode NetCDf</b> does not support unsigned integer types: <b>LST will be written as type short</b><br>Classic mode NetCDf does not support unsigned integer types: QC will be written as type short<br>Classic mode NetCDf does not support unsigned integer types: Error_LST will be written as type byte<br>Classic mode NetCDf does not support unsigned integer types: Emis_31 will be written as type byte<br>Classic mode NetCDf does not support unsigned integer types: Emis_32 will be written as type byte<br>Classic mode NetCDf does not support unsigned integer types: View_angle will be written as type byte<br>Classic mode NetCDf does not support unsigned integer types: View_time will be written as type byte<br><br></div><div><br></div><span></span></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 19, 2019 at 8:28 AM Vanúcia Schumacher <<a href="mailto:vanucia-schumacher@hotmail.com" target="_blank">vanucia-schumacher@hotmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
Hi NCL team</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
I would like to convert data in hdf to netcdf. <br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
I tried to use ncl_convert2nc, but it did not work:<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span>Classic mode NetCDf does not support unsigned integer types: LST will be written as type short<br>
</span>
<div>Classic mode NetCDf does not support unsigned integer types: QC will be written as type short<br>
</div>
<div>Classic mode NetCDf does not support unsigned integer types: Error_LST will be written as type byte<br>
</div>
<div>Classic mode NetCDf does not support unsigned integer types: Emis_31 will be written as type byte<br>
</div>
<div>Classic mode NetCDf does not support unsigned integer types: Emis_32 will be written as type byte<br>
</div>
<div>Classic mode NetCDf does not support unsigned integer types: View_angle will be written as type byte<br>
</div>
<div>Classic mode NetCDf does not support unsigned integer types: View_time will be written as type byte<br>
</div>
<span></span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
I also tried this and it did not work (data attached):<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span> fils = ("MOD11_L2.hdf") </span>
<div> f = addfile(fils, "r") </div>
<div> var = short2flt_hdf(f->LST) <br>
</div>
<div> printVarSummary(var) </div>
<div>var!0 = "lat"<br>
</div>
<span>var!1 = "lon"</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span>...</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span>var original:</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<span></span></div>
<span>Type: float<br>
</span>
<div>Total Size: 11102800 bytes<br>
</div>
<div> 2775700 values<br>
</div>
<div>Number of Dimensions: 2<br>
</div>
<div>Dimensions and sizes: [Along_swath_lines_1km_MOD_Swath_LST | 2050] x [Cross_swath_pixels_1km_MOD_Swath_LST | 1354]<br>
</div>
<div>Coordinates: <br>
</div>
<div>Number Of Attributes: 11<br>
</div>
<div> long_name : Land-surface Temperature<br>
</div>
<div> units : K<br>
</div>
<div> Number_Type : uint16<br>
</div>
<div> valid_range : ( 7500, 65535 )<br>
</div>
<div> LST : LST data * scale_factor<br>
</div>
<div> scale_factor_err : 0<br>
</div>
<div> add_offset_err : 0<br>
</div>
<div> calibrated_nt : 5<br>
</div>
<div> hdf_name : LST<br>
</div>
<div> _FillValue_original : 0<br>
</div>
<div> _FillValue : 0<br>
</div>
<span></span>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:14pt;color:rgb(0,0,0)">
<div><br>
</div>
<div><br>
</div>
<div>Variable: new_var<br>
</div>
<div>Type: float<br>
</div>
<div>Total Size: 11102800 bytes<br>
</div>
<div> 2775700 values<br>
</div>
<div>Number of Dimensions: 2<br>
</div>
<div>Dimensions and sizes: [lat | 2050] x [lon | 1354]<br>
</div>
<div>Coordinates: <br>
</div>
<div>Number Of Attributes: 11<br>
</div>
<div> long_name : Land-surface Temperature<br>
</div>
<div> units : K<br>
</div>
<div> Number_Type : uint16<br>
</div>
<div> valid_range : ( 7500, 65535 )<br>
</div>
<div> LST : LST data * scale_factor<br>
</div>
<div> scale_factor_err : 0<br>
</div>
<div> add_offset_err : 0<br>
</div>
<div> calibrated_nt : 5<br>
</div>
<div> hdf_name : LST<br>
</div>
<div> _FillValue_original : 0<br>
</div>
<div> _FillValue : 0<br>
</div>
<div><br>
</div>
<div>Variable: new_var<br>
</div>
<div>Type: float<br>
</div>
<div>Total Size: 11102800 bytes<br>
</div>
<div> 2775700 values<br>
</div>
<div>Number of Dimensions: 2<br>
</div>
<div>Dimensions and sizes: [lat | 2050] x [lon | 1354]<br>
</div>
<div>Coordinates: <br>
</div>
<div>Number Of Attributes: 11<br>
</div>
<div> _FillValue : 0<br>
</div>
<div> _FillValue_original : 0<br>
</div>
<div> hdf_name : LST<br>
</div>
<div> calibrated_nt : 5<br>
</div>
<div> add_offset_err : 0<br>
</div>
<div> scale_factor_err : 0<br>
</div>
<div> LST : LST data * scale_factor<br>
</div>
<div> valid_range : ( 7500, 65535 )<br>
</div>
<div> Number_Type : uint16<br>
</div>
<div> units : K<br>
</div>
<div> long_name : Land-surface Temperature<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><span>warning:Argument 0 of the current function or procedure was coerced to the appropriate type and thus will not change if the function or procedure modifies its value<br>
</span>
<div><br>
</div>
<span></span></div>
<div><br>
</div>
<span></span><br>
</div>
</div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>