<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Batch conversion of NetCDF to raster - python script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/batch-conversion-of-netcdf-to-raster-python-script/m-p/129635#M10071</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got a lot of netCDF files that I have to convert to rasters.&amp;nbsp; Each netCDF will be divided into 12 rasters based on the "month" dimension (jan = 1 .... dec = 12).&amp;nbsp; I've written a script to loop through all the netCDF files in my workspace and convert them to the rasters, each with an appropriate name.&amp;nbsp; I need some help fixing the script, it falls over before converting anything and gives me the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Processing: E:\SOLAR_DATA\netcdf\monthly_means_daily_ghe\ghe_stats_1990-1990.nc&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "N:/gdmp/Solar/BOMNetCDFConversion/rob_working.py", line 90, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeNetCDFRasterLayer_md(nc, variable, xdimension, ydimension, nowFileNew, "", ncDimValue, valueSelectionMethod)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\md.py", line 165, in MakeNetCDFRasterLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000238: One or more dimension values are invalid&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (MakeNetCDFRasterLayer).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My script is attached.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Aug 2012 03:54:08 GMT</pubDate>
    <dc:creator>RobKay</dc:creator>
    <dc:date>2012-08-10T03:54:08Z</dc:date>
    <item>
      <title>Batch conversion of NetCDF to raster - python script</title>
      <link>https://community.esri.com/t5/python-questions/batch-conversion-of-netcdf-to-raster-python-script/m-p/129635#M10071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got a lot of netCDF files that I have to convert to rasters.&amp;nbsp; Each netCDF will be divided into 12 rasters based on the "month" dimension (jan = 1 .... dec = 12).&amp;nbsp; I've written a script to loop through all the netCDF files in my workspace and convert them to the rasters, each with an appropriate name.&amp;nbsp; I need some help fixing the script, it falls over before converting anything and gives me the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Processing: E:\SOLAR_DATA\netcdf\monthly_means_daily_ghe\ghe_stats_1990-1990.nc&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "N:/gdmp/Solar/BOMNetCDFConversion/rob_working.py", line 90, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeNetCDFRasterLayer_md(nc, variable, xdimension, ydimension, nowFileNew, "", ncDimValue, valueSelectionMethod)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\md.py", line 165, in MakeNetCDFRasterLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000238: One or more dimension values are invalid&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (MakeNetCDFRasterLayer).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My script is attached.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2012 03:54:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-conversion-of-netcdf-to-raster-python-script/m-p/129635#M10071</guid>
      <dc:creator>RobKay</dc:creator>
      <dc:date>2012-08-10T03:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Batch conversion of NetCDF to raster - python script</title>
      <link>https://community.esri.com/t5/python-questions/batch-conversion-of-netcdf-to-raster-python-script/m-p/129636#M10072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I figured out what was going wrong and thought I'd post it just in case someone was running into the same issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The MakeNetCDFRasterLayer_md command was not working because the required input for the dimension_values parameter is a value table, I was trying to input a different data type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MakeNetCDFRasterLayer_md (in_netcdf_file, variable, x_dimension, y_dimension, out_raster_layer, {band_dimension}, {dimension_values}, {value_selection_method})&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Once I created the value table and loaded it with the appropriate dimensions and values, 2 column table as is shown when running the tool in desktop, everything went smoothly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 23:38:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-conversion-of-netcdf-to-raster-python-script/m-p/129636#M10072</guid>
      <dc:creator>RobKay</dc:creator>
      <dc:date>2012-08-21T23:38:06Z</dc:date>
    </item>
  </channel>
</rss>

