SlideShare a Scribd company logo
4/14/2016 Python IDLE (Integrated Development and Learning Environment) for remote sensing, hydrological and meteorological applications | Ramesh Dhungel | L…
https://www.linkedin.com/pulse/python­idle­integrated­development­learning­remote­sensing­dhungel?trk=prof­post 1/30
H­1B visa needed? ­ We specialize exclusively in employment based immigration visas. Call us.
Python IDLE (Integrated Development and Learning
Environment) for remote sensing, hydrological and
meteorological applications
Apr 14, 2016 87 views 0 Likes 0 Comments   
This post will discuss about Python IDLE (Integrated Development Environment
or Integrated Development and Learning Environment), especially for the
meteorological and hydrological applications. Image processing environment like
ERDAS Imagine, ENVI had been widely used in remote sensing community as
well as Matlab and R. But, there is a very little discussion about the Python IDLE
integrated with ArcGIS, basically with ArcScrit or ArcPy. It can be difficult to
implement looping and iterative process in ModelBuilder of ArcGIS, ERDAS
Imagine and ENVI, then the role comes of the Python IDLE. ERDAS Image
Model Maker can also be messy if you are developing complex algorithms. Python
IDLE not only can handle these complex processes in elegant way, but it will
provide a dynamic environment for advance algorithm development. I have been
working on the algorithm development of Land surface model using Python IDLE
to compute evapotranspiration (ET), agricultural water management, irrigation
Ramesh Dhungel
Water Resources, Remote Sensing and Land
Surface Modeler (LSM) (Ph.D. Civil Engineering)
Edit post View stats
Python IDLE (Integrated
Development and Learning
Environment) for remote…
sensing, hydrological andRamesh Dhungel
The Pros and Cons of Being
Super Rich
Ben Casnocha
What Happens When The
Internet Gets a Body?
John Battelle
Personification: The Future of
Marketing is Near…And It is
Facebook!?
David Yuan
Microsoft Sues the DOJ: Why
and What You Should Know
Greg Leffler
Trump is wrong about
unemployment, but he's not the
only one
Zachary Karabell
The Voyeur's Motel: the place
Pulse Publish a post
Home Profile My Network Jobs Interests Business Services Try Premium for free
 Advanced 
1
 Search for people, jobs, companies, and more...
4/14/2016 Python IDLE (Integrated Development and Learning Environment) for remote sensing, hydrological and meteorological applications | Ramesh Dhungel | L…
https://www.linkedin.com/pulse/python­idle­integrated­development­learning­remote­sensing­dhungel?trk=prof­post 2/30
scheduling, precision agriculture, geospatial modeling etc., which virtually
includes many boundary layer processes. This post will show some of the
important steps for developing complex algorithms using Python IDLE. These
algorithms are implemented while estimating ET for 3­hour time period.
Figure 1: Estimation of ET using NARR and METRIC model for 3­hour time
period for the entire months ( i.e.,  3 * 8 * 30 ) images of ET 
For two source surface energy balance model, please follow the
cartoon in the following post.
https://www.linkedin.com/pulse/pixel­scale­validation­ground­truth­satellite­
based­surface­dhungel?trk=pulse_spock­articles
Importing necessary modules:
import arcgisscripting
import os
import time
import sys
# Create a geoprocessor object, for example gp or rdh or something
gp = arcgisscripting.create(9.3)
4/14/2016 Python IDLE (Integrated Development and Learning Environment) for remote sensing, hydrological and meteorological applications | Ramesh Dhungel | L…
https://www.linkedin.com/pulse/python­idle­integrated­development­learning­remote­sensing­dhungel?trk=prof­post 3/30
# Check out ArcGIS Spatial Analyst extension license
gp.CheckOutExtension("Spatial")
# Overwrite existing outputs
gp.OverWriteOutput = 1
Here are some of the examples: As usual, these codes are part of codes developed
in this process, so only a portion is shown. 
 a) Reading the image  using Python IDLE:
ComDir = r'I:PapersMeterological_applicationsCommon'
DEM =os.path.join(ComDir, 'DEM_clipped_large.img')
b) Conditional sentences:
Theta_ref=os.path.join(ComDir,'theta_ref_.img')
Theta_ref_eqn = 'con( '+Soil_final+' == 0 , 0.360, con( '+Soil_final+' == 1 , 0.36,
con( '+Soil_final+' == 2 , 0.34, con( '+Soil_final+' == 3 , 0.329,'
Theta_ref_eqn+= 'con( '+Soil_final+' == 4 , 0.2, con( '+Soil_final+' == 5 , 0.2,
con( '+Soil_final+' == 6 , 0.30, con( '+Soil_final+' == 7, 0.360,'
Theta_ref_eqn+= 'con( '+Soil_final+' == 8 , 0.36, 0.36 ) ) ) ) ) ) ) ) )'
gp.SingleOutputMapAlgebra_sa(Theta_ref_eqn,Theta_ref)
c) Writing equations:
workDir =
r'I:PapersMeterological_applicationsCombined_Ess_Ec_interpolation_06112010'
 Water_flag = os.path.join(workDir, 'Water_flag.img')
 Water_flg_eqn= 'con(('+Landuse+' == 11) or ( '+NDVI+' 0), 1, 0)'
4/14/2016 Python IDLE (Integrated Development and Learning Environment) for remote sensing, hydrological and meteorological applications | Ramesh Dhungel | L…
https://www.linkedin.com/pulse/python­idle­integrated­development­learning­remote­sensing­dhungel?trk=prof­post 4/30
  gp.SingleOutputMapAlgebra_sa(Water_flg_eqn, Water_flag)
d) For and while looping (multi looping):
i= Current_satellite_passing_Index + 1
proceed with all the algorithms
H_Flux_new_soil = os.path.join(workDir,'sheat_new_soil_'+ str(i)+'.img') 
G_Flux_new_soil = os.path.join(workDir,'gheat_new_soil_'+ str(i)+'.img')
 while i = Next_satellite_passing_Index + 1 :
 else:
 Figure 2 shows an example the algorithm developed in the process:
e) Monitoring pixels in the simulation process using python shell:
   if DEBUG:
      PrintCellValue(gp,ETsoil_sec_pre,'tResult ­­ ETsoil_sec_pre: ')
      PrintCellValue(gp,ETveg_sec_pre,'tResult ­­ ETveg_sec_pre: ')
      PrintCellValue(gp,soilm_pre,'tResult ­­ soilm_pre: ')
4/14/2016 Python IDLE (Integrated Development and Learning Environment) for remote sensing, hydrological and meteorological applications | Ramesh Dhungel | L…
https://www.linkedin.com/pulse/python­idle­integrated­development­learning­remote­sensing­dhungel?trk=prof­post 5/30
Figure 3 shows the python shell while running the algorithm:
f) Extracting pixel or cell value from directory:
R_Rgl=(gp.GetCellValue( Rgl,'2601776.501 1325307.224  ', '1').getoutput(0))
myRgl = 'Rgl: '+ R_Rgl + 'n'
myfile.write(myRgl)
Write a table for certain cell value for entire simulation period:
 for i in range (i, 1359, 1):
   myOut = ','.join((str(i), R_Date, R_precip, R_irrigation, R_NDVI, R_fc,
R_In_short, R_EThour_com, R_EThour_com_final, R_ETrF_com, R_ETcor,
R_ETveg_hour, R_ETsoil_hour, R_ETcor_veg, R_ETcor_soil,
R_ETcor_com,'n'))
   myfile.write(myOut)
 myfile.close()
g) For real­time plotting options in Python IDLE, please look my
previous post:
4/14/2016 Python IDLE (Integrated Development and Learning Environment) for remote sensing, hydrological and meteorological applications | Ramesh Dhungel | L…
https://www.linkedin.com/pulse/python­idle­integrated­development­learning­remote­sensing­dhungel?trk=prof­post 6/30
Real­time simulation of the iterative calculation of the
satellite based surface energy fluxes
https://www.linkedin.com
White paper An iterative procedure is still used to converge fluxes in evapotranspiration (ET)
calculation in many ET models like METRIC (Allen et al., 2007), SEBAL (Bastiaanssen et al.,
1998) and SEBS (Su, 2002). In this post, a real­time simulation is shown to expedite the satellite
based surface energy balance fluxes in low wind speed condition.
Finally, once the image is processed, you can use ArcGIS or any other image
viewer to analyze the results. One of the drawbacks of Python IDLE might be the
need of ArcGIS license as it is integrated into ArcGIS.
For the further reading, please look these references:
Dhungel R, Allen R.G., Trezza R., Robison C. W., 2014. Comparison of Latent
Heat Flux Using Aerodynamic Methods and Using the Penman–Monteith
Method with Satellite­Based Surface Energy Balance. Remote Sensing.
6(9):8844­8877.
Using a Two Source Energy Balance model to compute evapotranspiration
between satellite overpasses: Simulation of ET using weather and Satellite data
(Under Review). Meteorological Applications (MET­15­0095).
Dhungel, R., 2014. Time integration of evapotranspiration using a two source
surface energy balance model using NARR reanalysis weather data and satellite
based METRIC data. D. Dissertation, University of Idaho.
http://digital.lib.uidaho.edu/cdm/ref/collection/etd/id/829
Please keep on following for the updates of the post!!!!!!!!!!!

More Related Content

PDF
How AI revolutionizes robotics and automotive industries
PPTX
Python in the Atmospheric sciences
PDF
Time integration of evapotranspiration using a two source surface energy bala...
PDF
“R” statistical tool for engineering environment-hydrology students
PDF
Introduction to post_gis
PPTX
Daily evapotranspiration by combining remote sensing with ground observations...
PDF
Water platform 2011-2014
PDF
6 measurement&representation
How AI revolutionizes robotics and automotive industries
Python in the Atmospheric sciences
Time integration of evapotranspiration using a two source surface energy bala...
“R” statistical tool for engineering environment-hydrology students
Introduction to post_gis
Daily evapotranspiration by combining remote sensing with ground observations...
Water platform 2011-2014
6 measurement&representation

Viewers also liked (20)

PDF
Evapotranspiration Bed Wastewater Treatment and Gardening
PDF
Crop Et And Implications For Irrigation
PDF
11 modern-iuh
PDF
A sensitivity Analysis of Eddy Covariance Data Processing Methods for Evapotr...
PDF
5 hydrology quantities-measures_instruments_activities
PDF
TIME INTEGRATION OF EVAPOTRANSPIRATION USING A TWO SOURCE SURFACE ENERGY BALA...
PDF
14 snow hydrology-part1
PDF
Session I: Water Consumption – Evapotranspiration (ET) Case Study Tunisia
PDF
10 water in soil-rev 1
PDF
Introduction tohydrology c
PDF
Introduction tohydrology b
PDF
Using Git Inside Eclipse, Pushing/Cloning from GitHub
PPT
From land use to land cover: evapotraspiration assessment in a metropolitan r...
PDF
4 introduction to uDig
PPTX
Adding Confidence to Seasonal Drought Forecasts using reference evapotranspir...
PDF
3 introduction gis
PDF
2013 ASPRS Track, Developing an ArcGIS Toolbox for Estimating EvapoTranspirat...
PPT
Water science l2 cwr final full ed
PDF
2 hydro-geomorphology
PPTX
Cu07821 3 precipitation and evapotranspiration
Evapotranspiration Bed Wastewater Treatment and Gardening
Crop Et And Implications For Irrigation
11 modern-iuh
A sensitivity Analysis of Eddy Covariance Data Processing Methods for Evapotr...
5 hydrology quantities-measures_instruments_activities
TIME INTEGRATION OF EVAPOTRANSPIRATION USING A TWO SOURCE SURFACE ENERGY BALA...
14 snow hydrology-part1
Session I: Water Consumption – Evapotranspiration (ET) Case Study Tunisia
10 water in soil-rev 1
Introduction tohydrology c
Introduction tohydrology b
Using Git Inside Eclipse, Pushing/Cloning from GitHub
From land use to land cover: evapotraspiration assessment in a metropolitan r...
4 introduction to uDig
Adding Confidence to Seasonal Drought Forecasts using reference evapotranspir...
3 introduction gis
2013 ASPRS Track, Developing an ArcGIS Toolbox for Estimating EvapoTranspirat...
Water science l2 cwr final full ed
2 hydro-geomorphology
Cu07821 3 precipitation and evapotranspiration
Ad

More from Ramesh Dhungel (9)

PDF
Water Balance to Recharge Calculation: Implications for Watershed Management ...
PDF
Pixel scale validation and ground truth of satellite-based surface energy flu...
PDF
Real-time simulation of the iterative calculation of the satellite based surf...
PDF
Assessment of Ecosystem Services in a Semi-arid Agriculture-dominant Area: Fr...
PDF
Water:Remembered or Forgotten
PDF
Price Elasticity of Water Demand in a Small College Town: An Inclusion of Sys...
PDF
Comparison of Latent Heat Flux Using Aerodynamic Methods and Using the Penman...
PDF
WATER RESOURCE SUSTAINABILITY OF THE PALOUSE REGION: A SYSTEMS APPROACH
PDF
Water Resource Sustainability of the Palouse Region: A Systems Approach
Water Balance to Recharge Calculation: Implications for Watershed Management ...
Pixel scale validation and ground truth of satellite-based surface energy flu...
Real-time simulation of the iterative calculation of the satellite based surf...
Assessment of Ecosystem Services in a Semi-arid Agriculture-dominant Area: Fr...
Water:Remembered or Forgotten
Price Elasticity of Water Demand in a Small College Town: An Inclusion of Sys...
Comparison of Latent Heat Flux Using Aerodynamic Methods and Using the Penman...
WATER RESOURCE SUSTAINABILITY OF THE PALOUSE REGION: A SYSTEMS APPROACH
Water Resource Sustainability of the Palouse Region: A Systems Approach
Ad

Recently uploaded (20)

PPTX
OOP with Java - Java Introduction (Basics)
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
Welding lecture in detail for understanding
PDF
PPT on Performance Review to get promotions
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Internet of Things (IOT) - A guide to understanding
PPT
Mechanical Engineering MATERIALS Selection
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
DOCX
573137875-Attendance-Management-System-original
PPTX
web development for engineering and engineering
PPTX
Sustainable Sites - Green Building Construction
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
OOP with Java - Java Introduction (Basics)
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Welding lecture in detail for understanding
PPT on Performance Review to get promotions
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
CH1 Production IntroductoryConcepts.pptx
Internet of Things (IOT) - A guide to understanding
Mechanical Engineering MATERIALS Selection
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Foundation to blockchain - A guide to Blockchain Tech
Embodied AI: Ushering in the Next Era of Intelligent Systems
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
CYBER-CRIMES AND SECURITY A guide to understanding
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
573137875-Attendance-Management-System-original
web development for engineering and engineering
Sustainable Sites - Green Building Construction
R24 SURVEYING LAB MANUAL for civil enggi
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx

Python IDLE (Integrated Development and Learning Environment) for remote sensing, hydrological and meteorological applications