POST
|
Hi Dan, Thanks a lot for that. I will have a look this week-end and let you know how I go! Cheers
... View more
03-17-2016
01:45 AM
|
0
|
0
|
231
|
POST
|
The results seem correct, Australia is certainly very hot in summer!
... View more
03-12-2016
04:28 AM
|
0
|
1
|
231
|
POST
|
Thanks Dan, it happended to me before with the attachments. I am downloading them right now and will have a look
... View more
03-12-2016
04:09 AM
|
0
|
0
|
231
|
POST
|
Hi Dan, I did check for the data and the licence does not allow for external use, sorry. But I am sure if you modify the shape you won't have any issues... The avi file was an excellent idea, I don't use time visualisation very often but I should. Please let me know when you have a change to share the script, I am looking forward to trying on more files! Cheers,
... View more
03-11-2016
12:38 AM
|
0
|
0
|
688
|
POST
|
Thanks for that. I somehow get different results. Just looking at the first txt file (mx19610101), I get: min = 7.829 ; mean = 26.725; max = 45.344. That's just from reading the Statistics of the grid obtained from the txt file and that seems more realistic for the month of January. Regarding using the data fro writing/teaching, I'll have to get back to you tonight on that one as it is not freely available data and I just need to make sure it's okay to use Cheers
... View more
03-08-2016
04:45 PM
|
0
|
1
|
1210
|
POST
|
Ultimately, I am trying to get an average "growing season temperature or GST" which is an average temperature for each day from 1 October to 30 April, over a 30-year period. It is to characterise the variability within a region so the maps are essential. My idea was to get the average Maximum temperature for that period and the average Minimum temperature for the same period and then get the average. A GST per year would be ideal but might be tricky to get as it straddles two years e.g. from 1 October 1961 to 30 April 1962.
... View more
03-08-2016
05:29 AM
|
0
|
4
|
1210
|
POST
|
Hi Dan, That's brilliant! It sounds much easier than the previous approach. I have zipped four months' worth of data if you want to play with it. Let me know if you want me to upload some more. I must say I am not familiar at all with arrays, would you mind pointing me to some additional information ? And possibly copy the start of a script? Much appreciated!
... View more
03-08-2016
04:30 AM
|
0
|
14
|
5758
|
POST
|
Good news on the script, it seems to be running although the output isn't correct. Here are the modifications I made from your suggestions guys (based on Xander's script): shorter paths ; delete the dashes, replace by underscores ; point 'res_ws' to a folder instead of a geodatabase ; Tiff or ESRI grid, it doesn't seem to make much difference although the Tiff appears more stable. The initial issue happened when writing the first raster to the fgdb. I can see the various cellstat1, cellstat2... and the total_sum so it is processing the rasters. Unfortunately, the output is a grid comprised between -3.40282e+038 and 3.40282e+038. This is likely due to the way NoData is handled. The parameter of CellStatistics being ''DATA", it shouldn't take the NoData into account in the calculation. One way of dealing with this would be to convert NoData to 0 but given that the data is temperature, it doesn't make scientific sense to attribute a zero as I will be calculating the mean eventually. I have attached a few files in their original format (txt).
... View more
03-07-2016
12:43 AM
|
0
|
1
|
688
|
POST
|
Hi there, Struggling a bit as to where I should add the extension ".tif". I would say: outname = os.path.join(res_ws, "cellstat{0}".format(i).tif) However, I still get an error message, different one though: File "E:\Software\new_script_geonet_revB.py", line 45, in <module> main() File "E:\Software\new_script_geonet_revB.py", line 26, in main outname = os.path.join(res_ws, "cellstat{0}".format(i).tif) AttributeError: 'str' object has no attribute 'tif'
... View more
03-06-2016
04:55 AM
|
0
|
3
|
520
|
POST
|
Hi, Sorry to only get back to you now, I just had a chance to look at the script today... I removed the dashes and tried to use shorter pathnames. I ran the script and got an error message: File "E:/Software/new_script_geonet.py", line 44, in <module> main() File "E:/Software/new_script_geonet.py", line 26, in main cellstat.save(outname) RuntimeError: ERROR 010240: Could not save raster dataset to E:\BOM\daily_temp\daily_max_temp\MaxTemp.gdb\cellstat1 with output format FGDBR. Any ideas on what I could modify in the script to get it right? Thanks! Mathieu
... View more
03-06-2016
01:09 AM
|
0
|
6
|
520
|
POST
|
Thanks for that, I wouldn't have thought about it! You're right, my goal is not to get the total sum but it is a first step into a more complex calculation. Once I get this script running smoothly, I will fine tune the calculation. Cheers
... View more
02-02-2016
04:09 AM
|
0
|
12
|
1466
|
POST
|
Hi Xander, I did try without setting the NoData cells to Zero and it didn't change the result. The Cell Statistics tool only allows 1,000 rasters if I am not mistaken so I could give it a go in several batches. The thing is I have to run this script on another 10,000 files and I was hoping to get it to work on the whole workspace. It looks like I will have to subdivide my data though. I'll try to shorten the path too. Thanks
... View more
02-02-2016
03:49 AM
|
0
|
15
|
1466
|
POST
|
Hi Dan, The zip file contains the *.py that I edited and ran within IDLE. Here is the script: import os,sys import arcpy from arcpy.sa import * sPath = sys.path[0] dataPath = 'E:\BOM\daily-temperature\daily-maximum-temperature\max_temp_1971_2000_grids' # ADD your workspace path here outPath = 'E:\BOM\daily-temperature\daily-maximum-temperature' arcpy.env.overwriteOutput = 1 arcpy.CheckOutExtension('Spatial') arcpy.env.scratchWorkspace = outPath arcpy.env.workspace = dataPath #create a list of rasters in the workspace rasters = arcpy.ListRasters('','') i = 0 #loop through rasters in list for raster in rasters: print "processing raster: %s" %os.path.join(dataPath,raster) #convert nodata to zero out1 = Con(IsNull(raster), 0, raster) #sum rasters together if i == 0: out2 = out1 i += 1 else: out2 = out2 + out1 i += 1 #save final output out2.save(os.path.join(outPath,'sumRas2')) Thanks, Mathieu
... View more
02-02-2016
03:28 AM
|
0
|
0
|
1466
|
POST
|
Hi there, I am trying to sum close to 6,000 ESRI grids and found a piece of script on this forum that I have tried to adapt (attached). The script runs fine and prompts every grid but eventually crashes when it reaches the last raster. No output is created. Would you have any idea as to why it crashes? The script seems to work fine when I test it on 5-10 grids. Could the reason be the 5,000 ESRI grid limit that can be stored in a single workspace directory (Esri Grid format—Help | ArcGIS for Desktop) ? I did try on less than 5,000 grids but had the same outcome. I am using ArcGIS 10.2.2 and Python 2.7.5. Thanks for your help! Mathieu
... View more
02-02-2016
02:05 AM
|
0
|
28
|
10694
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|