Test_img = "C:\\temp\\precip_" + b + ".img"Īrcpy.MakeNetCDFRasterLayer_md(precip_2010_nc, "precip", "lat", "long", precip_Layer, "", inDate, "BY_VALUE") Precip_layer_lyr = "C:\\temp\\precip_" + b + ".lyr" Precip_2010_nc = "H:\\ArcGIS\\Rainfall Index\\precip.V.nc" Import arcpy, os, time, datetime, calendarĪ = "C:\\temp\\" Any feedback would be greatly appreciated. I have started with Jason's script above but I am getting an error with dimension value, so I think my error is comes early on. I have been working at this for awhile and struggling to iterate through rainfall data and extract to raster for the entire year by each day. #export raster layer (from scratch workspace) to raster output folder as *.imgĪrcpy.CopyRaster_management(outRasterFolder, ((os.path.join(outRasterFolder, "netcdf_"+rasters))), "", "", "NONE", "NONE", "") (dimensionValues,dimvalues), #need to feed in each day (value from the time dimension e.g time ) (outRasterFolder,dimvalues), #output folder named by dimension value NcFP = arcpy.NetCDFFileProperties(inNetCDF) # loop through all dimension and show the values OutRasterFolder = "D:/data/FFDInetcdf/OutputRasters" InNetCDF = r"D:/DSE_work/FFDInetcdf/FEB2009FFDI/IDZ00026_VIC_ADFD_FFDI_SFC.nc"Įnv.workspace="D:/DSE_work/FFDInetcdf/FEB2009FFDI" My main problem is working out how to run makenetcdfrasterlayer on each dimension value (for time) and being able to export these as rasters.Īny feedback will be greatly appreciated!! I am still having trouble running makenetcdfrasterlayer and then exporting as a raster in python. #export raster layer (from scratch workspace?) to raster output folder as *.imgĪrcpy.CopyRaster_management(InMemory_netCDF_File, OutputRasterFolder, "", "", "NONE", "NONE", "") InMemory_netCDF_File, bandDimension, dimensionValues, OutRasterFolder = "D:/data/netcdffiles/OutputRasters/"įor DimensionValuesofTime in arcpy.ListDimensionValues():ĭimensionValues_List.append(DimensionValues.time)Īrcpy.MakeNetCDFRasterLayer_md(inNetCDFFile, variable, XDimension, YDimension, InMemory_netcdf_raster = "InMemory_netCDF_File" InNetCDFFile = "D:/data/netcdffiles/SURFACEWEATHERDATA.nc" #Make a separate raster *.img file for each dimension value (time) in a netcdf file I have made an attempt at the code using acrpy.MakeNetCDFRasterLayer_md and arcpy.CopyRaster_managment but I don't understand how to work loop through the dimension values and how to work with files that go to memory (which is what happens to the netcdf files).Īny feedback will be greatly appreciated. I can run arcpy to get a particular day if I enter the name of the day in the dimension field (i.e ) but how can I get it to find them without me having to enter each one and then export each one. I would like to open a netcdf file which has a months worth of data and then export each day as a separate raster.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |