|
POST
|
Xander Bakker, please could you open the data in ArcGIS to cross-check the input file with my attached image from ArcGIS
... View more
06-13-2018
12:11 PM
|
0
|
0
|
1653
|
|
POST
|
Xander Bakker same data i am running on my PC with the same code provided by u but i am getting data out of range. Please could you clarify why it is happening and when i opening the same data in ArcGIS , the time spam showing 2013 which i shown in attached image, but your code displays 1900 . I am getting confused
... View more
06-13-2018
12:09 PM
|
0
|
0
|
1653
|
|
POST
|
Xander Bakker, Thank you. I ran the code but its showing data out of range. Which NC file I provided you, its contain the monthly data for 2013, but I don't understand how it's showing the year of 1900. maybe a problem with my data however I am providing you the updated link for data download, Kindly look at the updated file of NetCDF Updated Download link - 2013.nc - Google Drive After running the code, its showing dimension_values 01-12-2013 12:00:00
nowFile (1): 01-12-2013 12:00:00
nowFile (2): 01-12-2013 12:00:00
test 2013
DATA OUT OF RANGE I have taken a snapshot of the data from ArcGIS, the time spam of NC looks
... View more
06-13-2018
02:02 AM
|
0
|
10
|
1653
|
|
POST
|
Xander Bakker Thank you. I have added the download link with my question for my input file. Kindly check it.
... View more
06-12-2018
06:45 AM
|
0
|
0
|
3402
|
|
POST
|
Xander Bakker, please can you look at the code, why its generating error message,
... View more
06-11-2018
10:24 PM
|
0
|
0
|
1513
|
|
POST
|
Dan Patterson, Thank you. I have added the print statement but the print statement now showing any dimension of NetCDF. I have tried to convert the single layer of NetCDF file to raster using ArcGIS, its successful run. I have copied the code from ArcGIS. arcpy.MakeNetCDFRasterLayer_md(in_netCDF_file="E:/Weather/2002.nc", variable="slhf", x_dimension="longitude", y_dimension="latitude", out_raster_layer="sshf_Layer", band_dimension="", dimension_values="time '01-01-2013 12:00:00'", value_selection_method="BY_VALUE") but i have huge layer in NetCDF file, how to loop through all layer and convert it to raster
... View more
06-11-2018
10:05 PM
|
0
|
19
|
3402
|
|
POST
|
i have updated the code formatting and chosen Python format. Regarding dimension, I have time dimension NetCDF file, based on each time file i am trying to export it as a raster.
... View more
06-11-2018
06:03 AM
|
0
|
21
|
3402
|
|
POST
|
I have single NetCDF file which is time dimension NetCDF file, the netCDF file contains the monthly weather data for 20 years. I want to convert the NetCDF to raster tiff format and output of the raster as same the month and year name. below is code but it's producing the error in line number 29. Time format of the data is YY-MM-DD 2013-01-01 12:00, 2013-02-01 12:00, so on. How to loop all the time dimension. updated download link for input files: 2013.nc - Google Drive I tried to extract the layer manually using ArcGIS tool, it's successfully extracted. I have copied the code from ArcGIS arcpy.MakeNetCDFRasterLayer_md(in_netCDF_file="E:/Weather/2002.nc",
variable="slhf",
x_dimension="longitude",
y_dimension="latitude",
out_raster_layer="sshf_Layer",
band_dimension="",
dimension_values="time '01-01-2013 12:00:00'",
value_selection_method="BY_VALUE") # Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *
#Workspace
outLoc = r"E:\Weather/"
inNetCDF = r"E:\Weather\2002.nc"
#Veriable
variable = "slhf"
x_dimension = "lon"
y_dimension = "lat"
band_dimension = ""
dimension = "time"
valueSelectionMethod = "BY_VALUE"
nc_FP = arcpy.NetCDFFileProperties(inNetCDF)
nc_Dim = nc_FP.getDimensions()
for dimension in nc_Dim:
if dimension == "time":
top = nc_FP.getDimensionSize(dimension)
for i in range(0, top):
dimension_values = nc_FP.getDimensionValue(dimension, i)
nowFile = str(dimension_values)
nowFile = nowFile.translate(None, '/')
# I needed after 2013
if int(nowFile.split()[0].split('-')[-1])==2013:
dv1 = ["time", dimension_values]
dimension_values = [dv1]
arcpy.MakeNetCDFRasterLayer_md(inNetCDF, variable, x_dimension, y_dimension, nowFile, band_dimension, dimension_values, valueSelectionMethod)
print "success"
outname = outLoc + nowFile
arcpy.CopyRaster_management(nowFile, outname,"", "", "", "NONE", "NONE", "")
else: print "DATA OUT OF RANGE" Error message ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000237: One or more dimensions are invalid
ERROR 000237: One or more dimensions are invalid
Failed to execute (MakeNetCDFRasterLayer).
... View more
06-11-2018
05:06 AM
|
0
|
24
|
8039
|
|
POST
|
Hi Xander Bakker Thank you. I have solved the issue by installing SciPy version 1.6 windows executable file.
... View more
05-11-2018
04:32 AM
|
1
|
1
|
7976
|
|
POST
|
I have tried using the lower version of Scipy I.e 0.17.0, 0.17.1 etc, but it's producing the another error Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import scipy
File "C:\Python27\ArcGIS10.3\lib\site-packages\scipy\__init__.py", line 103, in <module>
raise ImportError(msg)
ImportError: Error importing scipy: you cannot import scipy while
being in scipy source directory; please exit the scipy source
tree first, and relaunch your python intepreter.
... View more
05-08-2018
10:52 AM
|
0
|
4
|
7976
|
|
POST
|
Dan Patterson I have downloaded several version of Scipy i.e. 0.18, 1.1 but it's producing the same error. May I please know the compatible version of scipy with 1.7.1 Numpy version.
... View more
05-08-2018
08:29 AM
|
0
|
6
|
7976
|
|
POST
|
I am installing SciPy on Windows 7 64 bit. I am using ArcGIS 10.3 and default NumPy version 1.7.1 and I downloaded the SciPy version 1.1.0 from Python libs. After stored in the site package of Python folder When I executing the Scipy, I am getting following error. Earlier I installed the SciPy in the same way which I follow now, but now it's returning the error msg. type "copyright", "credits" or "license()" for more information.
>>> import numpy
>>> import scipy
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import scipy
File "C:\Python27\ArcGIS10.3\lib\site-packages\scipy\__init__.py", line 119, in <module>
from scipy._lib._ccallback import LowLevelCallable
File "C:\Python27\ArcGIS10.3\lib\site-packages\scipy\_lib\_ccallback.py", line 1, in <module>
from . import _ccallback_c
ImportError: cannot import name _ccallback_c
... View more
05-08-2018
05:22 AM
|
0
|
8
|
11424
|
|
POST
|
Sorry, Earlier the option had disabled to mark it correct, that's why I could not able to mark it. Now the option is functioning, hence I marked it correct. Thanks & regards Shouvik Jha
... View more
08-30-2017
12:00 AM
|
0
|
0
|
595
|
|
POST
|
Hi Xander Bakker, many thanks for your great cooperation. I ran the script. The script is running perfectly and results also correct. Once again thank you very much for your such great contribution. Thanks & regards Shouvik Jha
... View more
08-29-2017
03:46 AM
|
1
|
1
|
2025
|
|
POST
|
Hi xander_bakker, Thank you very much for your such great cooperation. We are really very thankful for such wonderful and useful script from you. The updated script is running perfectly and produced the exact result. Thanks & regards Shouvik Jha
... View more
08-29-2017
03:34 AM
|
1
|
2
|
4836
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-01-2017 09:56 PM | |
| 1 | 01-19-2017 08:03 AM | |
| 1 | 07-31-2017 11:57 AM | |
| 1 | 08-25-2016 09:38 AM | |
| 1 | 08-17-2016 11:13 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:25 AM
|