Data Pre‐Processing for SWAT · Data Pre‐Processing for SWAT Written by Laura Briley, 2010...

10
1 Data Pre‐Processing for SWAT Written by Laura Briley, 2010 University of Michigan/NOAA/CIRES Table of Contents DATA PRE-PROCESSING FOR SWAT 1 INTRODUCTION 1 1. SOFTWARE:MAP WINDOW GIS 1 2. LOAD WORLD DATA GRID 2 3. DETERMINE REGION OF INTEREST 2 B. ADDING DATA 2 C. CREATE A NEW SHAPEFILE 3 D. CREATE A WATERSHED BOUNDARY CLIPPING FILE 3 4. DETERMINE THE UTM ZONE LOCATION OF YOUR WATERSHED 4 A. IDENTIFYING 4 5. PRE-PROCESS DEM DATA 4 B. REPROJECT THE SQUARE CLIP 4 C. MERGE GRIDBOXES 5 D. CLIPPING 5 6. RE-PROJECT TO UTM COORDINATES 6 7. SAVE MWSAT INPUT FILE 7 8. PRE-PROCESS LAND USE DATA 7 9. PRE-PROCESS SOIL DATA 7 10. WEATHER DATA 7 Introduction This document will assist a user in the pre‐processing of data to be used in the Soil and Water Assessment Tool (SWAT). There are four main data files that SWAT requires: Digital Elevation Model (DEM) data, landuse data, soil data, and weather data. There are many more datasets that can be used as input to SWAT but they are optional. The purpose of this document is to provide a new SWAT user with the steps necessary to get data for a specific watershed and pre‐process the data so that it is ready to be run with SWAT. The user should know that the data used in these examples is convenient but most likely not the best data for all applications. 1. Software: Map Window GIS Download and install the latest stable release version of Map Window GIS. This software allows user to easily manipulate data to the formats required by MWSWAT. http://www.mapwindow.org/downloads/index.php?show_details=1

Transcript of Data Pre‐Processing for SWAT · Data Pre‐Processing for SWAT Written by Laura Briley, 2010...

Page 1: Data Pre‐Processing for SWAT · Data Pre‐Processing for SWAT Written by Laura Briley, 2010 University of Michigan/NOAA/CIRES Table of Contents DATA PREPROCESSING FOR SWAT 1 INTRODUCTION

1

DataPre‐ProcessingforSWATWrittenbyLauraBriley,2010UniversityofMichigan/NOAA/CIRES

TableofContents

DATAPRE­PROCESSINGFORSWAT 1INTRODUCTION 11. SOFTWARE:MAPWINDOWGIS 12. LOADWORLDDATAGRID 23. DETERMINEREGIONOFINTEREST 2B. ADDINGDATA 2C. CREATEANEWSHAPEFILE 3D. CREATEAWATERSHEDBOUNDARYCLIPPINGFILE 34. DETERMINETHEUTMZONELOCATIONOFYOURWATERSHED 4A. IDENTIFYING 45. PRE­PROCESSDEMDATA 4B. REPROJECTTHESQUARECLIP 4C. MERGEGRIDBOXES 5D. CLIPPING 56. RE­PROJECTTOUTMCOORDINATES 67. SAVEMWSATINPUTFILE 78. PRE­PROCESSLANDUSEDATA 79. PRE­PROCESSSOILDATA 710. WEATHERDATA 7

IntroductionThisdocumentwillassistauserinthepre‐processingofdatatobeusedintheSoilandWaterAssessmentTool(SWAT).TherearefourmaindatafilesthatSWATrequires:DigitalElevationModel(DEM)data,landusedata,soildata,andweatherdata.TherearemanymoredatasetsthatcanbeusedasinputtoSWATbuttheyareoptional.ThepurposeofthisdocumentistoprovideanewSWATuserwiththestepsnecessarytogetdataforaspecificwatershedandpre‐processthedatasothatitisreadytoberunwithSWAT.Theusershouldknowthatthedatausedintheseexamplesisconvenientbutmostlikelynotthebestdataforallapplications.

1. Software:MapWindowGISDownloadandinstallthelateststablereleaseversionofMapWindowGIS.ThissoftwareallowsusertoeasilymanipulatedatatotheformatsrequiredbyMWSWAT.http://www.mapwindow.org/downloads/index.php?show_details=1

Page 2: Data Pre‐Processing for SWAT · Data Pre‐Processing for SWAT Written by Laura Briley, 2010 University of Michigan/NOAA/CIRES Table of Contents DATA PREPROCESSING FOR SWAT 1 INTRODUCTION

2

2. LoadWorldDataGridThismapisthelayoutforUTMprojecteddata.ThroughouttheprocessingofdatatheUTMprojectionwillbeused.Insomecases,datawillneedtobeassignedthisprojectionorreprojectedtomatchUTM.

a. DownloadthezipfileofWorldDataGridshttp://www.waterbase.org/download_data.html

b. UnzipthefileandOpenWorldDataGrids bydoubleclickingtheicon.

3. DetermineRegionofInterestIfyouhaveaspecificwatershedthatyouwouldliketomodel,youcanlocateitusingtheresourceinpartabelow(skipto3.aifthisdescribesyourpreference).Thisexampleusesaspecificwatershedfortheregionofinterest.Ifyouwanttohanddrawaregion,turnoffthedatalayersinthemapwindowbyuncheckingtheboxesnexttoeachnameexcepttheonethatismostusefultoyou(mostlikelythecountrylayerwillbehelpful).Zoom intoalevelwhereyoucaneasilydrawyourregion.Continuewithstep3.cwherethenewshapefileiscreated.

a. DownloadtheGlobalRiverBasinShapefileforyourregionofinterest.http://www.waterbase.org/download_data.htmlThefilesaredividedbycontinent.Unzipthefileoncedownloaded.

b. AddingDataAddtheriverbasinfiletoyourmapwindowbyclickingon andnavigatetothefolderthefileissavedinandselecttheshapefiletoload.Aprojectionwarningwillappearandinmostcases,includingthisone,youwillwanttohavethenewlayerreprojectedtothecurrentmapwindow’sprojection.Ifyoudonotseethenewlayer,dragittothetopofthelegendlistsoitisvisible.Turnoffanyunwantedlayers.Zoomintoyourwatershedregionsothatyoucanstillseetheentireboundaryofyourwatershed.Ifyouwanttohighlightyourwatershed,usethe toolandclickinsidetheareaofyourwatershed.

Page 3: Data Pre‐Processing for SWAT · Data Pre‐Processing for SWAT Written by Laura Briley, 2010 University of Michigan/NOAA/CIRES Table of Contents DATA PREPROCESSING FOR SWAT 1 INTRODUCTION

3

c. CreateaNewShapefileOnlycompletethisstepifyouarenotusingthepredefinedwatershedboundaryfileinpart3.a.UnderthePlug‐Insmenu,selectShapefileEditortoturnonthetoolbar.Createanewshapefileusing .ChangetheshapefiletypetopolygonandclickOK.Younowhaveashapefileforyourwatershed.Next,drawyourwatershed.Tocreateyourwatershed’sboundaryyoumayuse or

toaddashape.Theformerwillallowyoutodrawyourshapebyclickingtocreatethevertices(straightlineswillconnectyourpoints).Tocompleteyourshape,makesureitisaclosedpolygonanddoubleclick.Thesecondoptionwillallowyoutoaddapredefinedshape(circle,polygon,ellipse)bydefiningthesize.

d. CreateaWatershedBoundaryClippingFileCreateasquareregionaroundyourwatershedforclippingdata.First,createanewshapefileoftypepolygon(seesection3.c)andtitleitincludingtheterm“clip”soyouknowthisisthefiletousewhenclippingdatasets.Inthisexamplewewillcallthenewfilesquare_clip.Leaveampleroomaroundyourwatershedbecauseyoudonotwanttoclipittoocloseandendupwithmissingdataattheboundaryforfuture,lowerresolution,layersthatyouclip.Oncethenewlayerisaddedtothewindow,youcanadjustitstransparencyifyouwishinordertoseethelayersunderneath.Todothis,rightclickonthelayerinthelegendandselectProperties.Therearevariousoptionsrangingfromturningoffthe“showfill”propertytodefininga“transparencypercent.”

Page 4: Data Pre‐Processing for SWAT · Data Pre‐Processing for SWAT Written by Laura Briley, 2010 University of Michigan/NOAA/CIRES Table of Contents DATA PREPROCESSING FOR SWAT 1 INTRODUCTION

4

4. DeterminetheUTMZoneLocationofyourWatershed

a. IdentifyingIdentifythegrid(s)whereyourwatershedislocated.Makesureyourdem_srtm_gridlayerisselectedunderDataLayers.Identify andthenclickinsideonegridboxatatime.TheSRTMvalueiswhatyouwanttorecord.Continuetoselectanyothergridboxesthatthesquare_cliptouches.

b. ThisboxlabelisnottheactualUTMzonebutitisstillimportanttoremember.

TheUTMzone(http://en.wikipedia.org/wiki/File:Utm‐zones.jpg)canbedeterminedbyfindingtheverticalcolumnthatthewatershedresidesin.Recordthisvalueandifitisinthenorthernorsouthernhemisphere.

5. Pre‐processDEMdataa. Usethissitehttp://srtm.csi.cgiar.org/SELECTION/inputCoord.asptodownload

DEMdata.FirstchangethethirdselectionoptiontoArcInfoASCIIformatandthenselectthegridboxesonthemapthatencompassyourwatershed.ConfirmtheyarecorrectbycheckingtheresultforTileXandTileYinthesecondsectionforDataSelectionMethod.TileXandTileYshouldcorrespondtoyourboxesidentifiedinstep4.a.Onceallrequiredboxesareselected,clicktheyellowboxtobeginyoursearchanddownloadthedatafromtheCSIserver.

b. ReprojectthesquareclipInpreparationforapplyingthecliptotheDEMlayer,theclipmustfirstbereprojectedtomatchtheprojectionoftheDEM.TurnonGISToolsbyselectingPlug‐Ins‐GISTools.Makesurethecliplayerisselectedinthelegend.GotoGISTools,Vector,ReprojectaShapefile.Selectthesquare_clip.Usethefollowingprojectionsettings:

Page 5: Data Pre‐Processing for SWAT · Data Pre‐Processing for SWAT Written by Laura Briley, 2010 University of Michigan/NOAA/CIRES Table of Contents DATA PREPROCESSING FOR SWAT 1 INTRODUCTION

5

SelectOK.DONOTADDITTOTHEMAPbecausethemapisadifferentprojection.RestartMapWindow.

c. MergegridboxesIfyourwatershedliesinonlyoneUTMgridbox,simplyskiptopart5.d.InanewMapWindowproject,addtheDEMdataonegridboxatatime.Thesefilesareverylargeandcantakealongtimetoload.UnderthePlug‐insmenudropdown,turnonGISToolsanditshouldthenappearalongthetopmenubarofMapWindow.Inordertocliptheregionusingsquare_clip,thegridboxesmustfirstbemergedintoonefile.Todothis,gotoGISTools\Raster\MergeGrids.Addthefilesoneatatimeforthegridboxesyouneedtomerge.Toaddmoreuse .Whenfinished,clickOK.KeeptheoutputformatASCII,name,andclickFinish.

d. ClippingFirst,clearalllayersandthenloadthenew,mergedlayer.Nextwewillclipthislayertooursquare_clipshapefilecreatedearlier,whichoutlinesthewatershed.Loadthesquare_cliplayeraswellanddragittothetopofthelistsothatitappearsonthemap.Zoomtotheregionifnecessary.

GotoGISTools\Raster\ClipGridwithPolygon.Leave“CliptoExtents(Fast)”unchecked.Click“SelectShapes”andselecttheboxshapeoutliningtheregion.Click“Done”and“OK”.CloseMapWindowanddonotsave.

Page 6: Data Pre‐Processing for SWAT · Data Pre‐Processing for SWAT Written by Laura Briley, 2010 University of Michigan/NOAA/CIRES Table of Contents DATA PREPROCESSING FOR SWAT 1 INTRODUCTION

6

6. Re‐ProjecttoUTMCoordinatesMWSWATrequiresthattheinputfilesbeinmeterunitsandequalareaprojectionsowemustre‐projectthefiles.MWSWATdeveloperstypicallyuseUTMcoordinates.AlthoughUTMisnottechnicallyequalareaprojection,itissufficientlycloseforreasonablysizedwatersheds.ThisincludestheDEMUTMfilethatwewillultimatelysaveandtheclippingfilessothatwecanre‐cliptheDEMtoremoveanymissingvaluesfromthere‐projection.

a. RestartMapWindow(oneofthepurposesofquittingandrestartingMapWindowistocleartheprojectionmemory)andaddtheclippedDEM.GotoGISTools\Raster\ReprojectGrids,addthelayer,andclickOK.

i. Category:ProjectedCoordinateSystemsii. Group:Utm–Wgs1984iii. Name:WGS1984UTMZone##(thisisthezonethatyoufoundearlierin

step3d.iv. ClickOK.DONOTADDNEWLAYERTOMAPBECAUSEPROJECTIONS

AREDIFFERENT!v. CloseMapWindow.

b. Tocheckthatourre‐projectedmapiscorrect,wewillre‐projectourwatershedandlayerthedatasetstoconfirmgeographiclocations.

i. OpenthewatershedshapefileandgotoTools\Vector\AssignProjectiontoShapefile

1. Selectthewatershedfilea. Category:GeographicCoordinateSystemsb. Group:Worldc. Name:WGS1984

ii. AddthiswatershedlayertotheDEMUTMlayeranditwillaskifyouwanttore‐projectthewatershedtomatchtheDEMUTM.Allowittoperformthere‐projectionanditwillsaveanewfilecalledwatershed_name_reprojected.LoadthislayerandconfirmthattheDEMUTMisinthecorrectgeographiclocation.

iii. CloseMapWindow.c. Repeatsteps5bi‐iiiforsquare_clipsothatitismanuallyconvertedtoWGS1984

andthenaddtotheDEMUTMmapandselecttore‐projecttomapprojection.Renamesquare_clip_reprojectedtosquare_clip_UTMsotheprojectionisdocumented.

d. CliptheDEMUTMusingthesquare_clip_UTMfilesothatanymissingvaluesare

eliminated.

Page 7: Data Pre‐Processing for SWAT · Data Pre‐Processing for SWAT Written by Laura Briley, 2010 University of Michigan/NOAA/CIRES Table of Contents DATA PREPROCESSING FOR SWAT 1 INTRODUCTION

7

7. SaveMWSATinputFileSavethenewclippedDEMUTMfileandwatershedUTMfileinawaythatindicatestheywillbeusedwithMWSWAT.Example:DEM_utm_SWAT

8. Pre‐processLandUseDataa. Downloadlandusedataforyourregionofinterest.

http://www.waterbase.org/download_data.htmlb. InanewMapWindowproject,loadWorldDataGridsandturnonlanduse_grid.

Ifyouareunsurewhereyouwatershedislocated,alsoloadyourwatershedshapefile.Determinewhichlanduseboxyourwatershedislocatedwithin.CloseandthenopenanewMapWindowprojectandloadthelanduseTIFimagethatcorrespondstothelanduseboxnumber.

c. Followtheinstructionsin4ctoclipthelandusemapwithsquare_clipbutthistimecheckthe“CliptoExtents(Fast)”option.

d. Re‐projecttheclippedlandusedatatoUTMusinginstructions5a.Checkthe

geographiclocationbyloadingsquare_clip_UTM.e. Cliplanduse_UTMwithsquare_clip_UTM.f. Savelanduse_clipped_UTMasland_utm_MWSWAT.

9. Pre‐processSoilDataa. Downloadsoildataforyourregionofinterest.

http://www.waterbase.org/download_data.htmlb. Repeatinstructionsinstep7withsoildata.

10. WeatherDataIfyouhaveweatherdatathatyouwouldliketoincorporateintoSWATinordertoobtainthemostrealisticsimulation,thereareafewnecessarystepsinformattingtheinputfiles.SWATwillaccepttemperature(degreeC),precipitation(mm/day),windspeed(m/s),solarradiation(MJ/m2),relativehumidity(fractional),andpotentialevapotranspiration(mmH2O)weatherinputs.Specificunitsforthesevariablesmustalsobefollowed.

a. Createatextfileofweatherlocation/stationinformation

Page 8: Data Pre‐Processing for SWAT · Data Pre‐Processing for SWAT Written by Laura Briley, 2010 University of Michigan/NOAA/CIRES Table of Contents DATA PREPROCESSING FOR SWAT 1 INTRODUCTION

8

Youmustknowtheexactlocationofwhereyourweatherdatawascollected.Itisalsoveryimportantthattheexactfileformattingisfollowed.Thisfilecontainsthelatitude,longitude,andelevationoftheweatherstationandeachstationmusthaveasixdigitID.YoumaycreatetheIDifyourstationwasnotinitiallyassignedone.Thefollowingiscopiedoutof“MapWindowInterfaceforSWAT”frompage67:“First make a .txt file called any name you choose, e.g. stations.txt…It may have any number of header lines followed by one or more station lines. The first 6 characters of a station line must be decimal digits (and the first 6 characters of a header line must not be all decimal digits). These six digits form the station identifier. Each station line must also have (numbering the first, leftmost position as 1):

• A latitude in positions 38-42 inclusive, starting with a + or – sign in position 38, followed by 4 decimal digits representing a latitude in hundredths of a degree.

• A longitude in positions 44-49 inclusive, starting with a + or – sign in position 44, followed by 5 decimal digits representing a longitude in hun dredths of a degree.

• An elevation in positions 51 -55 inclusive, starting with a + or – sign in position 51, followed by 4 decimal digits representing an elevation in metres.

The station lines may contain other data, but it is ignored.”

b. Createindividualfilesforeachweatherstationandvariable

Placethesefilesinthesamefolderasyourstationsfile.(bestifthesefilesareinthefolderofyourMWSWATproject)Thefollowingistakenfrom“MapWindowInterfaceforSWAT”frompage67:

“In the same folder as stations.txt may be placed files nnnnnn.pcp, nnnnnn.tmp, nnnnnn.slr, nnnnnn.hmd, nnnnnn.wnd with precipitation, temperature, solar radiation, relative humidity and wind speed data respectively, where nnnnnn is the identifier of a station in stations.txt…The structure of each of these five file types is as follows:

• The first line can contain any text: it is ignored. For .pcp and .tmp only: i. The second line has the string “Lati” in positions 0 -3 and a latitude in degrees expressed as a decimal number, o ptionally starting with a – sign, in positions 8-12 for .pcp,13-17 for .tmp. ii. The third line has the string “Long” in positions 0 -3 and a longitude in degrees expressed as a decimal number, optionally starting with a – sign, in positions 8-12 for .pcp,13-17 for .tmp. iii. The fourth line has the string “Elev” in positions 0 -3 and an elevation in degrees expressed as a decimal number, optionally starting with a – sign, in positions 8-12 for .pcp,13-17 for .tmp.

• The following lines all have the date in Julian form (4 -digit year followed by 3-digit zero-filled day) in columns 1-7. The date is followed by one or two numbers as follows

Page 9: Data Pre‐Processing for SWAT · Data Pre‐Processing for SWAT Written by Laura Briley, 2010 University of Michigan/NOAA/CIRES Table of Contents DATA PREPROCESSING FOR SWAT 1 INTRODUCTION

9

i. For .pcp: the precipitation for that day in mm in the form xxx.x in positions 8 -12 ii. For .tmp: the maximum and minimum temperatures for the day in °C, each in the form xxx.x, in positions 8 -12 and 13-17 respectively. iii. For .slr: the solar radiation for that day in MJ/m2 in the form xxxx.xxx in positions 8-15. iv. For .hmd: the relative humidity for that day as a fraction in the form xxxx.xxx in positions 8-15. v. For .wnd: the wind speed for that day in m/s for in the form xxxx.xxx in positions 8-15.

• The dates in all files must be the same, and within each file must be sequential days.”

Page 10: Data Pre‐Processing for SWAT · Data Pre‐Processing for SWAT Written by Laura Briley, 2010 University of Michigan/NOAA/CIRES Table of Contents DATA PREPROCESSING FOR SWAT 1 INTRODUCTION

10