architecture-building-systems / CityEnergyAnalyst

The City Energy Analyst (CEA)
https://www.cityenergyanalyst.com/
MIT License
196 stars 66 forks source link

Old radiation script not working #661

Closed gabriel-happle closed 7 years ago

gabriel-happle commented 7 years ago

I can't run the arcgis radiation on my machine! I tried multiple scenarios from pycharm as well as from arcgis.

PyTables is not installed. No support for HDF output.
C:\Users\Gabriel\Documents\GitHub\CEAforArcGIS\cea\databases\weather\Singapore.epw
complete calculating sunrise
Traceback (most recent call last):
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 508, in <module>
    longitude=args.longitude, year=args.year)
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 493, in run_as_script
    weather_path=weather_path)
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 97, in solar_radiation_vertical
    Burn(Simple_context, locator.get_terrain(), dem_rasterfinal, locator.get_temporary_folder(), dem_raster_extent, gv)
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 455, in Burn
    RadiationDEM.save(DEMfinal)
RuntimeError: ERROR 010240: Could not save raster dataset to C:\Users\Gabriel\Documents\ArcGIS\Default.gdb\DEM_All2 with output format FGDBR.

Process finished with exit code 1

But I do have the specified Default.gdb:

f9b4d6c4-3fe7-11e7-98b0-22debb8082ae

gabriel-happle commented 7 years ago
Start Time: Thu May 25 14:57:28 2017
Running script RadiationTool...
longitude: 7.43958333333
latitude: 46.9524055556
['C:\\Users\\Gabriel\\Anaconda2\\envs\\cea\\python.exe', '-u', '-m', 'cea.cli', '--scenario', u'C:\\cea-reference-case\\reference-case-zug\\baseline', 'radiation', '--arcgis-db', 'C:\\Users\\Gabriel\\Documents\\ArcGIS\\Default.gdb', '--latitude', '46.9524055556', '--longitude', '7.43958333333', '--year', '2014', '--weather-path', 'c:\\users\\gabriel\\documents\\github\\ceaforarcgis\\cea\\databases\\weather\\Zug.epw']
PyTables is not installed. No support for HDF output.
c:\users\gabriel\documents\github\ceaforarcgis\cea\databases\weather\Zug.epw
complete calculating sunrise
Traceback (most recent call last):
  File "C:\Users\Gabriel\Anaconda2\envs\cea\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Users\Gabriel\Anaconda2\envs\cea\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "c:\users\gabriel\documents\github\ceaforarcgis\cea\cli.py", line 381, in <module>
    main()
  File "c:\users\gabriel\documents\github\ceaforarcgis\cea\cli.py", line 377, in main
    parsed_args.func(parsed_args)
  File "c:\users\gabriel\documents\github\ceaforarcgis\cea\cli.py", line 177, in radiation
    weather_path=args.weather_path)
  File "c:\users\gabriel\documents\github\ceaforarcgis\cea\resources\radiation_arcgis\radiation.py", line 97, in solar_radiation_vertical
    Burn(Simple_context, locator.get_terrain(), dem_rasterfinal, locator.get_temporary_folder(), dem_raster_extent, gv)
  File "c:\users\gabriel\documents\github\ceaforarcgis\cea\resources\radiation_arcgis\radiation.py", line 455, in Burn
    RadiationDEM.save(DEMfinal)
RuntimeError: ERROR 010240: Could not save raster dataset to C:\Users\Gabriel\Documents\ArcGIS\Default.gdb\DEM_All2 with output format FGDBR.
jimenofonseca commented 7 years ago

@gabriel-happle what is the case study?

gabriel-happle commented 7 years ago

I think all of them. I tried ecocampus and zug.

jimenofonseca commented 7 years ago

It works in my computer for all scenarios except ecocampus. @daren-thomas do you think this has to do with the installation of arcgis or something?

jimenofonseca commented 7 years ago

@gabriel-happle can you check you have the spatial analyst extension of arcgis enabled?

gabriel-happle commented 7 years ago

@JIMENOFONSECA having a different error now. Trying to run zug case study

C:\Users\Gabriel\Anaconda2\envs\cea\python.exe C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py
PyTables is not installed. No support for HDF output.
C:\Users\Gabriel\Documents\GitHub\CEAforArcGIS\cea\databases\weather\Zug.epw
complete calculating sunrise
Traceback (most recent call last):
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 508, in <module>
    longitude=args.longitude, year=args.year)
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 493, in run_as_script
    weather_path=weather_path)
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 97, in solar_radiation_vertical
    Burn(Simple_context, locator.get_terrain(), dem_rasterfinal, locator.get_temporary_folder(), dem_raster_extent, gv)
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 449, in Burn
    '0.5')  # creating raster of the footprints of the buildings
  File "C:\Program Files (x86)\ArcGIS\Desktop10.4\arcpy\arcpy\conversion.py", line 2290, in FeatureToRaster
    raise e
arcgisscripting.ExecuteError: ERROR 000871: Output raster: Unable to delete the output c:\Users\Gabriel\AppData\Local\Temp\AllRaster.
ERROR 000581: Invalid parameters.
Failed to execute (FeatureToRaster).

Process finished with exit code 1
gabriel-happle commented 7 years ago

after manually deleting the specified folder I ended up with the same error as before

C:\Users\Gabriel\Anaconda2\envs\cea\python.exe C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py
PyTables is not installed. No support for HDF output.
C:\Users\Gabriel\Documents\GitHub\CEAforArcGIS\cea\databases\weather\Zug.epw
complete calculating sunrise
Traceback (most recent call last):
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 508, in <module>
    longitude=args.longitude, year=args.year)
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 493, in run_as_script
    weather_path=weather_path)
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 97, in solar_radiation_vertical
    Burn(Simple_context, locator.get_terrain(), dem_rasterfinal, locator.get_temporary_folder(), dem_raster_extent, gv)
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 455, in Burn
    RadiationDEM.save(DEMfinal)
RuntimeError: ERROR 010240: Could not save raster dataset to C:\Users\Gabriel\Documents\ArcGIS\Default.gdb\DEM_All2 with output format FGDBR.

Process finished with exit code 1

I think these errors are connected to reading/writing permissions of files. Deleting all the files in temp folder now and try again.

jimenofonseca commented 7 years ago

@gabriel-happle mmm weird..

jimenofonseca commented 7 years ago

mmm, @darenthomas are you facing this too?


From: Gabriel Happle [notifications@github.com] Sent: Thursday, May 25, 2017 6:32 PM To: architecture-building-systems/CEAforArcGIS Cc: Jimeno Fonseca; Mention Subject: Re: [architecture-building-systems/CEAforArcGIS] Old radiation script not working (#661)

@JIMENOFONSECAhttps://github.com/jimenofonseca having a different error now. Trying to run zug case study

C:\Users\Gabriel\Anaconda2\envs\cea\python.exe C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py PyTables is not installed. No support for HDF output. C:\Users\Gabriel\Documents\GitHub\CEAforArcGIS\cea\databases\weather\Zug.epw complete calculating sunrise Traceback (most recent call last): File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 508, in longitude=args.longitude, year=args.year) File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 493, in run_as_script weather_path=weather_path) File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 97, in solar_radiation_vertical Burn(Simple_context, locator.get_terrain(), dem_rasterfinal, locator.get_temporary_folder(), dem_raster_extent, gv) File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 449, in Burn '0.5') # creating raster of the footprints of the buildings File "C:\Program Files (x86)\ArcGIS\Desktop10.4\arcpy\arcpy\conversion.py", line 2290, in FeatureToRaster raise e arcgisscripting.ExecuteError: ERROR 000871: Output raster: Unable to delete the output c:\Users\Gabriel\AppData\Local\Temp\AllRaster. ERROR 000581: Invalid parameters. Failed to execute (FeatureToRaster).

Process finished with exit code 1

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/architecture-building-systems/CEAforArcGIS/issues/661#issuecomment-303978640, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIjrgufrCe2TmrntBXpt3MCOjcjbwpllks5r9VjQgaJpZM4NmCLP.

gabriel-happle commented 7 years ago

after deleting all (non-active) files in AppData/Local/Temp and the Arcgis default.gdb I end up with this different error when running the old radiation script from pycharm:

C:\Users\Gabriel\Anaconda2\envs\cea\python.exe C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py
PyTables is not installed. No support for HDF output.
C:\Users\Gabriel\Documents\GitHub\CEAforArcGIS\cea\databases\weather\Zug.epw
complete calculating sunrise
Traceback (most recent call last):
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 508, in <module>
    longitude=args.longitude, year=args.year)
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 493, in run_as_script
    weather_path=weather_path)
  File "C:/Users/Gabriel/Documents/GitHub/CEAforArcGIS/cea/resources/radiation_arcgis/radiation.py", line 92, in solar_radiation_vertical
    simplification_tolerance=8, minimum_area=None)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.4\arcpy\arcpy\cartography.py", line 1266, in SimplifyBuilding
    raise e
arcgisscripting.ExecuteError: ERROR 000210: Cannot create output C:\Users\Gabriel\Documents\ArcGIS\Default.gdb\Simple_CQ
Failed to execute (SimplifyBuilding).

Process finished with exit code 1

Looks like arcgis has to create the default.gdb... Trying from ArcGIS now

--> In this way radiation is running when started from ArcGIS for the Zug case

gabriel-happle commented 7 years ago

for the reference: (there are also some warnings in the log)

radiation_succes_from_arcgis.txt

gabriel-happle commented 7 years ago

@JIMENOFONSECA now we are on the same page again.

getting this geometry error for EcoCampus:

Executing: RadiationTool C:\cea-reference-case\reference-case-ecocampus\baseline Singapore 2014 1.36666666667 103.833333333
Start Time: Fri May 26 11:29:44 2017
Running script RadiationTool...
longitude: 103.833333333
latitude: 1.36666666667
['C:\\Users\\Gabriel\\Anaconda2\\envs\\cea\\python.exe', '-u', '-m', 'cea.cli', '--scenario', u'C:\\cea-reference-case\\reference-case-ecocampus\\baseline', 'radiation', '--arcgis-db', 'C:\\Users\\Gabriel\\Documents\\ArcGIS\\Default.gdb', '--latitude', '1.36666666667', '--longitude', '103.833333333', '--year', '2014', '--weather-path', 'c:\\users\\gabriel\\documents\\github\\ceaforarcgis\\cea\\databases\\weather\\Singapore.epw']
PyTables is not installed. No support for HDF output.
c:\users\gabriel\documents\github\ceaforarcgis\cea\databases\weather\Singapore.epw
complete calculating sunrise
complete burning buildings into raster
complete calculating boundaries
c:\users\gabriel\documents\github\ceaforarcgis\cea\resources\radiation_arcgis\radiation.py:431: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  DataCentroids['FactorShade'] = 1
c:\users\gabriel\documents\github\ceaforarcgis\cea\resources\radiation_arcgis\radiation.py:432: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  DataCentroids['Freeheight'] = DataCentroids.height_ag
Traceback (most recent call last):
  File "C:\Users\Gabriel\Anaconda2\envs\cea\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Users\Gabriel\Anaconda2\envs\cea\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "c:\users\gabriel\documents\github\ceaforarcgis\cea\cli.py", line 381, in <module>
    main()
  File "c:\users\gabriel\documents\github\ceaforarcgis\cea\cli.py", line 377, in main
    parsed_args.func(parsed_args)
  File "c:\users\gabriel\documents\github\ceaforarcgis\cea\cli.py", line 177, in radiation
    weather_path=args.weather_path)
  File "c:\users\gabriel\documents\github\ceaforarcgis\cea\resources\radiation_arcgis\radiation.py", line 104, in solar_radiation_vertical
    CalcObservers(Simple_CQ, observers, DataFactorsBoundaries, path_arcgis_db, gv)
  File "c:\users\gabriel\documents\github\ceaforarcgis\cea\resources\radiation_arcgis\radiation.py", line 314, in CalcObservers
    arcpy.Dissolve_management(Buffer_CQ0, Buffer_CQ1, "Name", "#", "SINGLE_PART", "DISSOLVE_LINES")
  File "C:\Program Files (x86)\ArcGIS\Desktop10.4\arcpy\arcpy\management.py", line 4329, in Dissolve
    raise e
arcgisscripting.ExecuteError: ERROR 999999: Error executing function.
Invalid Topology [Incomplete void poly.]
Failed to execute (Dissolve).

Completed script RadiationTool...
Succeeded at Fri May 26 11:30:36 2017 (Elapsed Time: 52.01 seconds)

Maybe I should try to do this: https://gis.stackexchange.com/questions/33995/how-to-repair-topology-of-a-shapefile

jimenofonseca commented 7 years ago

Yes that is what I get too. I believe it has to do with the scenario itself, can you check that all geometry is closed?

Try http://desktop.arcgis.com/en/arcmap/10.3/manage-data/editing-topology/finding-topology-errors-with-the-error-inspector.htm

This is ArcGIS issue so I guess checking on google about the error might help in here..

From: Gabriel Happle [mailto:notifications@github.com] Sent: Friday, 26 May 2017 11:33 AM To: architecture-building-systems/CEAforArcGIS CEAforArcGIS@noreply.github.com Cc: Jimeno Fonseca fonseca@arch.ethz.ch; Mention mention@noreply.github.com Subject: Re: [architecture-building-systems/CEAforArcGIS] Old radiation script not working (#661)

@JIMENOFONSECAhttps://github.com/jimenofonseca now we are on the same page again.

getting this geometry error for EcoCampus:

Executing: RadiationTool C:\cea-reference-case\reference-case-ecocampus\baseline Singapore 2014 1.36666666667 103.833333333

Start Time: Fri May 26 11:29:44 2017

Running script RadiationTool...

longitude: 103.833333333

latitude: 1.36666666667

['C:\Users\Gabriel\Anaconda2\envs\cea\python.exe', '-u', '-m', 'cea.cli', '--scenario', u'C:\cea-reference-case\reference-case-ecocampus\baseline', 'radiation', '--arcgis-db', 'C:\Users\Gabriel\Documents\ArcGIS\Default.gdb', '--latitude', '1.36666666667', '--longitude', '103.833333333', '--year', '2014', '--weather-path', 'c:\users\gabriel\documents\github\ceaforarcgis\cea\databases\weather\Singapore.epw']

PyTables is not installed. No support for HDF output.

c:\users\gabriel\documents\github\ceaforarcgis\cea\databases\weather\Singapore.epw

complete calculating sunrise

complete burning buildings into raster

complete calculating boundaries

c:\users\gabriel\documents\github\ceaforarcgis\cea\resources\radiation_arcgis\radiation.py:431: SettingWithCopyWarning:

A value is trying to be set on a copy of a slice from a DataFrame.

Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy

DataCentroids['FactorShade'] = 1

c:\users\gabriel\documents\github\ceaforarcgis\cea\resources\radiation_arcgis\radiation.py:432: SettingWithCopyWarning:

A value is trying to be set on a copy of a slice from a DataFrame.

Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy

DataCentroids['Freeheight'] = DataCentroids.height_ag

Traceback (most recent call last):

File "C:\Users\Gabriel\Anaconda2\envs\cea\lib\runpy.py", line 174, in _run_module_as_main

"__main__", fname, loader, pkg_name)

File "C:\Users\Gabriel\Anaconda2\envs\cea\lib\runpy.py", line 72, in _run_code

exec code in run_globals

File "c:\users\gabriel\documents\github\ceaforarcgis\cea\cli.py", line 381, in

main()

File "c:\users\gabriel\documents\github\ceaforarcgis\cea\cli.py", line 377, in main

parsed_args.func(parsed_args)

File "c:\users\gabriel\documents\github\ceaforarcgis\cea\cli.py", line 177, in radiation

weather_path=args.weather_path)

File "c:\users\gabriel\documents\github\ceaforarcgis\cea\resources\radiation_arcgis\radiation.py", line 104, in solar_radiation_vertical

CalcObservers(Simple_CQ, observers, DataFactorsBoundaries, path_arcgis_db, gv)

File "c:\users\gabriel\documents\github\ceaforarcgis\cea\resources\radiation_arcgis\radiation.py", line 314, in CalcObservers

arcpy.Dissolve_management(Buffer_CQ0, Buffer_CQ1, "Name", "#", "SINGLE_PART", "DISSOLVE_LINES")

File "C:\Program Files (x86)\ArcGIS\Desktop10.4\arcpy\arcpy\management.py", line 4329, in Dissolve

raise e

arcgisscripting.ExecuteError: ERROR 999999: Error executing function.

Invalid Topology [Incomplete void poly.]

Failed to execute (Dissolve).

Completed script RadiationTool...

Succeeded at Fri May 26 11:30:36 2017 (Elapsed Time: 52.01 seconds)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/architecture-building-systems/CEAforArcGIS/issues/661#issuecomment-304182186, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIjrgufEVn1iXlkesOFrbOmgc9QqJsVjks5r9kfSgaJpZM4NmCLP.

gabriel-happle commented 7 years ago

@JIMENOFONSECA I tried repairing the geometry and changed some vertex of an overlapping building. No success. The internet says that the ERROR 999999 of ArcGIS is most of the time thrown because of 32bit Memory issues! They suggest splitting shapefiles. E.g. here: http://support.esri.com/technical-article/000012368

I don't know what to do anymore.

By the way @daren-thomas and @JIMENOFONSECA I can also not run the radiation for Zurich and other case studies

image

daren-thomas commented 7 years ago

I too have troubles with the radiation script...

martin-mosteiro commented 7 years ago

I ran the old radiation script on the master branch on both the Zurich baseline and masterplan scenarios and it ran with no issues.

martin-mosteiro commented 7 years ago

I successfully ran the open reference case from ArcGIS (before I was running from Pycharm). I tried running Ecocampus from ArcGIS: no success.

daren-thomas commented 7 years ago

there seem to be multiple issues here. I'm working on a bug that states "ERROR 000732: Remove Features: Dataset C:\Users\darthoma\Documents\ArcGIS\Default.gdb\Non_overlap does not exist or is not supported" - I created a separate issue for that: #699

daren-thomas commented 7 years ago

I can run the Zug case study after following the steps explained in #699.

daren-thomas commented 7 years ago

I, too, get the arcgisscripting.ExecuteError: ERROR 999999: Error executing function. when running the ecocampus study.

jimenofonseca commented 7 years ago

This issue is being handled in #685 @daren-thomas would you mind testing it there? I am facing another error for the ecocampus. The pandas dataframe runs out of memory while writing or reading. I checked online and it seems that it does not work good for Win32bit.should all we update to a win64 python?

daren-thomas commented 7 years ago

@JIMENOFONSECA so... we close this issue?

The move to win64 is not one to take lightly. We can do this, but keep in mind that this might require about a week of work for me until we have everything up and running. Please link the sources you used to support the move.