From 50db00f515f01e4aa3fb1dde070b5447404039db Mon Sep 17 00:00:00 2001 From: rickD Date: Fri, 13 Nov 2020 17:44:30 -0800 Subject: [PATCH 1/4] initialize config, running in LakeCat --- .gitignore | 1 + ControlTable_LakeCat.csv | 235 +++++++++++++++++++----------------- LakeCat.py | 184 +++++++++++++--------------- lake_cat_config.py.template | 35 ++++++ 4 files changed, 247 insertions(+), 208 deletions(-) create mode 100644 .gitignore create mode 100644 lake_cat_config.py.template diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9ecffa3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +lake_cat_config.py diff --git a/ControlTable_LakeCat.csv b/ControlTable_LakeCat.csv index 32553cc..b3df048 100644 --- a/ControlTable_LakeCat.csv +++ b/ControlTable_LakeCat.csv @@ -1,111 +1,124 @@ -f_d_Title,DirectoryLocations,FullTableName,accum_type,MetricName,AppendMetric,LandscapeLayer,summaryfield,Final_Table_Name,MetricType,Conversion,by_RPU,run,notes -ingrid_dir,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/LandscapeRasters/QAComplete,BFI,Continuous,BFI,none,bfi.tif,,BFI,Mean,1,0,0, -Framework,L:/Priv/CORFiles/Geospatial_Library_Projects/LakeCat/LakeCat_Framework,Clay,Continuous,Clay,none,clay.tif,,STATSGO_Set1,Mean,0.01,0,0, -out_dir,L:/Priv/CORFiles/Geospatial_Library_Projects/LakeCat/Allocation_Accumulation,PctImp2006,Continuous,PctImp2006,none,imp2006.tif,,ImperviousSurfaces2006,Mean,1,0,0, -LakeCat_repo_dir,F:/GitProjects/s/LakeCat,Om,Continuous,Om,none,om.tif,,STATSGO_Set2,Mean,0.01,0,0, -StreamCat_dir,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/Allocation_and_Accumulation,Perm,Continuous,Perm,none,perm.tif,,STATSGO_Set2,Mean,0.01,0,0, -NHD_dir,H:/NHDPlusV21,Rckdep,Continuous,Rckdep,none,rckdep.tif,,STATSGO_Set2,Mean,0.01,0,0, -final_tables_dir,L:/Priv/CORFiles/Geospatial_Library_Projects/LakeCat/FTP_Staging/LakeCat/FinalTables,RdDens,Continuous,RdDens,none,roadden.tif,,RoadDensity,Mean,1,0,0, -,,RdCrs,Continuous,RdCrs,none,rdstcrs.tif,,RoadStreamCrossings,Density,1,0,0, -,,Runoff,Continuous,Runoff,none,runoff.tif,,Runoff,Mean,1,0,0, -,,Sand,Continuous,Sand,none,sand.tif,,STATSGO_Set1,Mean,0.01,0,0, -,,WtDep,Continuous,WtDep,none,wtdep.tif,,STATSGO_Set2,Mean,0.01,0,0, -,,Elev,Continuous,Elev,none,elev_cm,,Elevation,Mean,0.01,1,0, -,,PopDen2010,Continuous,PopDen2010,none,POP_SQKM.tif,,USCensus2010,Mean,1,0,0, -,,HUDen2010,Continuous,HUDen2010,none,HU_SQKM.tif,,USCensus2010,Mean,1,0,0, -,,NH4_2008,Continuous,NH4_2008,none,dep_nh4_2008.tif,,NADP,Mean,1,0,0, -,,NO3_2008,Continuous,NO3_2008,none,dep_no3_2008.tif,,NADP,Mean,1,0,0, -,,InorgNWetDep_2008,Continuous,InorgNWetDep_2008,none,dep_totalN_2008.tif,,NADP,Mean,1,0,0, -,,SN_2008,Continuous,SN_2008,none,dep_splusn_2008.tif,,NADP,Mean,1,0,0, -,,tmin,Continuous,Tmin8110,none,tmin.tif,,PRISM_1981_2010,Mean,1,0,0, -,,tmean,Continuous,Tmean8110,none,tmean.tif,,PRISM_1981_2010,Mean,1,0,0, -,,tmax,Continuous,Tmax8110,none,tmax.tif,,PRISM_1981_2010,Mean,1,0,0, -,,precip,Continuous,Precip8110,none,precip.tif,,PRISM_1981_2010,Mean,1,0,0, -,,AgKffact,Continuous,AgKffact,none,AgKffact.tif,,Kffact,Mean,0.01,0,0, -,,Kffact,Continuous,Kffact,none,kffact.tif,,Kffact,Mean,0.01,0,0, -,,CanalDensity,Continuous,CanalDens,none,CanalsDitches.tif,,CanalsDitches,Density,0.03,0,0, -,,Pestic97,Continuous,Pestic97,none,pestic.tif,,Pesticides97,Mean,1,0,0, -,,Al2O3,Continuous,Al2O3,none,al20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -,,CaO,Continuous,CaO,none,cao20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -,,Fe2O3,Continuous,Fe2O3,none,fe20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -,,K2O,Continuous,K2O,none,k20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -,,MgO,Continuous,MgO,none,mgo20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -,,Na2O,Continuous,Na2O,none,na20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -,,P2O5,Continuous,P2O5,none,p20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -,,S,Continuous,S,none,s20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -,,SiO2,Continuous,SiO2,none,si20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -,,N,Continuous,N,none,n20mar14.tif,,GeoChemPhys2,Mean,1,0,0, -,,HydrlCond,Continuous,HydrlCond,none,perm20mar14.tif,,GeoChemPhys3,Mean,1,0,0, -,,CompStrgth,Continuous,CompStrgth,none,ucs20mar14.tif,,GeoChemPhys4,Mean,1,0,0, -,,CBNF,Continuous,CBNF,none,cbnf.tif,,AgriculturalNitrogen,Mean,1,0,0, -,,Fert,Continuous,Fert,none,fert.tif,,AgriculturalNitrogen,Mean,1,0,0, -,,Manure,Continuous,Manure,none,manure.tif,,AgriculturalNitrogen,Mean,1,0,0, -,,Fire2000,Continuous,PctFire2000,none,fire2000.tif,,FirePerimeters,Mean,100,0,0, -,,Fire2001,Continuous,PctFire2001,none,fire2001.tif,,FirePerimeters,Mean,100,0,0, -,,Fire2002,Continuous,PctFire2002,none,fire2002.tif,,FirePerimeters,Mean,100,0,0, -,,Fire2003,Continuous,PctFire2003,none,fire2003.tif,,FirePerimeters,Mean,100,0,0, -,,Fire2004,Continuous,PctFire2004,none,fire2004.tif,,FirePerimeters,Mean,100,0,0, -,,Fire2005,Continuous,PctFire2005,none,fire2005.tif,,FirePerimeters,Mean,100,0,0, -,,Fire2006,Continuous,PctFire2006,none,fire2006.tif,,FirePerimeters,Mean,100,0,0, -,,Fire2007,Continuous,PctFire2007,none,fire2007.tif,,FirePerimeters,Mean,100,0,0, -,,Fire2008,Continuous,PctFire2008,none,fire2008.tif,,FirePerimeters,Mean,100,0,0, -,,Fire2009,Continuous,PctFire2009,none,fire2009.tif,,FirePerimeters,Mean,100,0,0, -,,Fire2010,Continuous,PctFire2010,none,fire2010.tif,,FirePerimeters,Mean,100,0,0, -,,PctNonAgIntrodManagVeg,Continuous,PctNonAgIntrodManagVeg,none,IntrodManagVeg.tif,,NonAgIntrodManagVeg,Mean,100,0,0, -,,PRISMppt_2008,Continuous,Precip08,none,PRISMppt_2008.tif,,PRISM_0809,Mean,1,0,0, -,,PRISMppt_2009,Continuous,Precip09,none,PRISMppt_2009.tif,,PRISM_0809,Mean,1,0,0, -,,PRISMtmean_2008,Continuous,Tmean08,none,PRISMtmean_2008.tif,,PRISM_0809,Mean,1,0,0, -,,PRISMtmean_2009,Continuous,Tmean09,none,PRISMtmean_2009.tif,,PRISM_0809,Mean,1,0,0, -,,WetnessIndex,Continuous,WetIndex,none,cti_v3.tif,,WetIndx,Mean,1,0,0, -,,nlcd2006,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/NLCD2006_lookup.csv,none,nlcd2006.tif,,NLCD2006,Percent,1,0,0, -,,nlcd2011,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/NLCD2011_lookup.csv,none,nlcd2011.tif,,NLCD2011,Percent,1,0,0, -,,lith,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Lithology_lookup.csv,none,us_lithology_1km_dd83.tif,,Lithology,Percent,1,0,0, -,,Ag2006HiSlp,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Ag2006HiSlp_lookup.csv,none,Ag2006HiSlp.tif,,AgMidHiSlopes,Percent,1,0,0, -,,Ag2006MidSlp,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Ag2006MidSlp_lookup.csv,none,Ag2006MidSlp.tif,,AgMidHiSlopes,Percent,1,0,0, -,,PctFrstLossByYear,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/ForestLossByYear_lookup.csv,none,lossyr.tif,,ForestLossByYear0013,Percent,1,0,0, -,,NABD,Point,NABD_Dens,none,NABD.shp,NIDStorM3;NrmStorM3,NABD,Density,1,0,0, -,,Dams,Point,DamDens,none,dams.shp,NIDStorM3;NrmStorM3,Dams,Density,1,0,0, -,,Mine,Point,MineDens,none,mines.shp,,Mines,Density,1,0,0, -,,NPDES,Point,NPDESDens,none,NPDES_Major.shp,,EPA_FRS,Density,1,0,0, -,,Superfund,Point,SuperfundDens,none,Superfund.shp,,EPA_FRS,Density,1,0,0, -,,TRI,Point,TRIDens,none,TRI.shp,,EPA_FRS,Density,1,0,0, -,,CoalMines,Point,CoalMineDens,none,USTRAT.shp,,CoalMines,Density,1,0,0, -,,PctImp2011,Continuous,PctImp2011,none,imp2011.tif,,ImperviousSurfaces2011,Mean,1,0,0, -,,PADUS,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/GAP_Status_lookup.csv,none,gap_sts.tif,,PADUS,Percent,1,0,0, -,,MODIS_Ir_Ag_2002,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_02.tif,,MODIS_IrrigAg,Percent,1,0,0, -,,MODIS_Ir_Ag_2007,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_07.tif,,MODIS_IrrigAg,Percent,1,0,0, -,,MODIS_Ir_Ag_2012,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_12.tif,,MODIS_IrrigAg,Percent,1,0,0, -,,MTBS_Severity_1984,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1984.tif,,MTBS_Severity_1984,Percent,1,0,0, -,,MTBS_Severity_1985,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1985.tif,,MTBS_Severity_1985,Percent,1,0,0, -,,MTBS_Severity_1986,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1986.tif,,MTBS_Severity_1986,Percent,1,0,0, -,,MTBS_Severity_1987,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1987.tif,,MTBS_Severity_1987,Percent,1,0,0, -,,MTBS_Severity_1988,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1988.tif,,MTBS_Severity_1988,Percent,1,0,0, -,,MTBS_Severity_1989,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1989.tif,,MTBS_Severity_1989,Percent,1,0,0, -,,MTBS_Severity_1990,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1990.tif,,MTBS_Severity_1990,Percent,1,0,0, -,,MTBS_Severity_1991,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1991.tif,,MTBS_Severity_1991,Percent,1,0,0, -,,MTBS_Severity_1992,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1992.tif,,MTBS_Severity_1992,Percent,1,0,0, -,,MTBS_Severity_1993,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1993.tif,,MTBS_Severity_1993,Percent,1,0,0, -,,MTBS_Severity_1994,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1994.tif,,MTBS_Severity_1994,Percent,1,0,0, -,,MTBS_Severity_1995,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1995.tif,,MTBS_Severity_1995,Percent,1,0,0, -,,MTBS_Severity_1996,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1996.tif,,MTBS_Severity_1996,Percent,1,0,0, -,,MTBS_Severity_1997,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1997.tif,,MTBS_Severity_1997,Percent,1,0,0, -,,MTBS_Severity_1998,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1998.tif,,MTBS_Severity_1998,Percent,1,0,0, -,,MTBS_Severity_1999,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1999.tif,,MTBS_Severity_1999,Percent,1,0,0, -,,MTBS_Severity_2000,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2000.tif,,MTBS_Severity_2000,Percent,1,0,0, -,,MTBS_Severity_2001,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2001.tif,,MTBS_Severity_2001,Percent,1,0,0, -,,MTBS_Severity_2002,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2002.tif,,MTBS_Severity_2002,Percent,1,0,0, -,,MTBS_Severity_2003,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2003.tif,,MTBS_Severity_2003,Percent,1,0,0, -,,MTBS_Severity_2004,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2004.tif,,MTBS_Severity_2004,Percent,1,0,0, -,,MTBS_Severity_2005,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2005.tif,,MTBS_Severity_2005,Percent,1,0,0, -,,MTBS_Severity_2006,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2006.tif,,MTBS_Severity_2006,Percent,1,0,0, -,,MTBS_Severity_2007,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2007.tif,,MTBS_Severity_2007,Percent,1,0,0, -,,MTBS_Severity_2008,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2008.tif,,MTBS_Severity_2008,Percent,1,0,0, -,,MTBS_Severity_2009,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2009.tif,,MTBS_Severity_2009,Percent,1,0,0, -,,MTBS_Severity_2010,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2010.tif,,MTBS_Severity_2010,Percent,1,0,0, -,,MTBS_Severity_2011,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2011.tif,,MTBS_Severity_2011,Percent,1,0,0, -,,MTBS_Severity_2012,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2012.tif,,MTBS_Severity_2012,Percent,1,0,0, -,,MTBS_Severity_2013,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2013.tif,,MTBS_Severity_2013,Percent,1,0,0, -,,MTBS_Severity_2014,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2014.tif,,MTBS_Severity_2014,Percent,1,0,0, -,,MTBS_Severity_2015,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2015.tif,,MTBS_Severity_2015,Percent,1,0,0, -,,MTBS_Severity_2016,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2016.tif,,MTBS_Severity_2016,Percent,1,0,0, -,,US_Level_III_Ecoregions,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/US_Level_III_Ecoregions_lookup.csv,none,US_Level_III_Ecoregions.tif,,US_Level_III_Ecoregions,Percent,1,0,1, +FullTableName,accum_type,MetricName,AppendMetric,LandscapeLayer,summaryfield,Final_Table_Name,MetricType,Conversion,by_RPU,run,notes +BFI,Continuous,BFI,none,bfi.tif,,BFI,Mean,1,0,0, +Clay,Continuous,Clay,none,clay.tif,,STATSGO_Set1,Mean,0.01,0,0, +PctImp2006,Continuous,PctImp2006,none,imp2006.tif,,ImperviousSurfaces2006,Mean,1,0,0, +Om,Continuous,Om,none,om.tif,,STATSGO_Set2,Mean,0.01,0,0, +Perm,Continuous,Perm,none,perm.tif,,STATSGO_Set2,Mean,0.01,0,0, +Rckdep,Continuous,Rckdep,none,rckdep.tif,,STATSGO_Set2,Mean,0.01,0,0, +RdDens,Continuous,RdDens,none,roadden.tif,,RoadDensity,Mean,1,0,0, +RdCrs,Continuous,RdCrs,none,rdstcrs.tif,,RoadStreamCrossings,Density,1,0,0, +Runoff,Continuous,Runoff,none,runoff.tif,,Runoff,Mean,1,0,0, +Sand,Continuous,Sand,none,sand.tif,,STATSGO_Set1,Mean,0.01,0,0, +WtDep,Continuous,WtDep,none,wtdep.tif,,STATSGO_Set2,Mean,0.01,0,0, +Elev,Continuous,Elev,none,elev_cm,,Elevation,Mean,0.01,1,0, +PopDen2010,Continuous,PopDen2010,none,POP_SQKM.tif,,USCensus2010,Mean,1,0,0, +HUDen2010,Continuous,HUDen2010,none,HU_SQKM.tif,,USCensus2010,Mean,1,0,0, +NH4_2008,Continuous,NH4_2008,none,dep_nh4_2008.tif,,NADP,Mean,1,0,0, +NO3_2008,Continuous,NO3_2008,none,dep_no3_2008.tif,,NADP,Mean,1,0,0, +InorgNWetDep_2008,Continuous,InorgNWetDep_2008,none,dep_totalN_2008.tif,,NADP,Mean,1,0,0, +SN_2008,Continuous,SN_2008,none,dep_splusn_2008.tif,,NADP,Mean,1,0,0, +tmin,Continuous,Tmin8110,none,tmin.tif,,PRISM_1981_2010,Mean,1,0,0, +tmean,Continuous,Tmean8110,none,tmean.tif,,PRISM_1981_2010,Mean,1,0,0, +tmax,Continuous,Tmax8110,none,tmax.tif,,PRISM_1981_2010,Mean,1,0,0, +precip,Continuous,Precip8110,none,precip.tif,,PRISM_1981_2010,Mean,1,0,0, +AgKffact,Continuous,AgKffact,none,AgKffact.tif,,Kffact,Mean,0.01,0,0, +Kffact,Continuous,Kffact,none,kffact.tif,,Kffact,Mean,0.01,0,0, +CanalDensity,Continuous,CanalDens,none,CanalsDitches.tif,,CanalsDitches,Density,0.03,0,0, +Pestic97,Continuous,Pestic97,none,pestic.tif,,Pesticides97,Mean,1,0,0, +Al2O3,Continuous,Al2O3,none,al20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +CaO,Continuous,CaO,none,cao20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +Fe2O3,Continuous,Fe2O3,none,fe20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +K2O,Continuous,K2O,none,k20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +MgO,Continuous,MgO,none,mgo20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +Na2O,Continuous,Na2O,none,na20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +P2O5,Continuous,P2O5,none,p20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +S,Continuous,S,none,s20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +SiO2,Continuous,SiO2,none,si20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +N,Continuous,N,none,n20mar14.tif,,GeoChemPhys2,Mean,1,0,0, +HydrlCond,Continuous,HydrlCond,none,perm20mar14.tif,,GeoChemPhys3,Mean,1,0,0, +CompStrgth,Continuous,CompStrgth,none,ucs20mar14.tif,,GeoChemPhys4,Mean,1,0,0, +CBNF,Continuous,CBNF,none,cbnf.tif,,AgriculturalNitrogen,Mean,1,0,0, +Fert,Continuous,Fert,none,fert.tif,,AgriculturalNitrogen,Mean,1,0,0, +Manure,Continuous,Manure,none,manure.tif,,AgriculturalNitrogen,Mean,1,0,0, +Fire2000,Continuous,PctFire2000,none,fire2000.tif,,FirePerimeters,Mean,100,0,0, +Fire2001,Continuous,PctFire2001,none,fire2001.tif,,FirePerimeters,Mean,100,0,0, +Fire2002,Continuous,PctFire2002,none,fire2002.tif,,FirePerimeters,Mean,100,0,0, +Fire2003,Continuous,PctFire2003,none,fire2003.tif,,FirePerimeters,Mean,100,0,0, +Fire2004,Continuous,PctFire2004,none,fire2004.tif,,FirePerimeters,Mean,100,0,0, +Fire2005,Continuous,PctFire2005,none,fire2005.tif,,FirePerimeters,Mean,100,0,0, +Fire2006,Continuous,PctFire2006,none,fire2006.tif,,FirePerimeters,Mean,100,0,0, +Fire2007,Continuous,PctFire2007,none,fire2007.tif,,FirePerimeters,Mean,100,0,0, +Fire2008,Continuous,PctFire2008,none,fire2008.tif,,FirePerimeters,Mean,100,0,0, +Fire2009,Continuous,PctFire2009,none,fire2009.tif,,FirePerimeters,Mean,100,0,0, +Fire2010,Continuous,PctFire2010,none,fire2010.tif,,FirePerimeters,Mean,100,0,0, +PctNonAgIntrodManagVeg,Continuous,PctNonAgIntrodManagVeg,none,IntrodManagVeg.tif,,NonAgIntrodManagVeg,Mean,100,0,0, +PRISMppt_2008,Continuous,Precip08,none,PRISMppt_2008.tif,,PRISM_0809,Mean,1,0,0, +PRISMppt_2009,Continuous,Precip09,none,PRISMppt_2009.tif,,PRISM_0809,Mean,1,0,0, +PRISMtmean_2008,Continuous,Tmean08,none,PRISMtmean_2008.tif,,PRISM_0809,Mean,1,0,0, +PRISMtmean_2009,Continuous,Tmean09,none,PRISMtmean_2009.tif,,PRISM_0809,Mean,1,0,0, +WetnessIndex,Continuous,WetIndex,none,cti_v3.tif,,WetIndx,Mean,1,0,0, +nlcd2006,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/NLCD2006_lookup.csv,none,nlcd2006.tif,,NLCD2006,Percent,1,0,0, +nlcd2011,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/NLCD2011_lookup.csv,none,nlcd2011.tif,,NLCD2011,Percent,1,0,0, +lith,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Lithology_lookup.csv,none,us_lithology_1km_dd83.tif,,Lithology,Percent,1,0,0, +Ag2006HiSlp,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Ag2006HiSlp_lookup.csv,none,Ag2006HiSlp.tif,,AgMidHiSlopes,Percent,1,0,0, +Ag2006MidSlp,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Ag2006MidSlp_lookup.csv,none,Ag2006MidSlp.tif,,AgMidHiSlopes,Percent,1,0,0, +PctFrstLossByYear,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/ForestLossByYear_lookup.csv,none,lossyr.tif,,ForestLossByYear0013,Percent,1,0,0, +NABD,Point,NABD_Dens,none,NABD.shp,NIDStorM3;NrmStorM3,NABD,Density,1,0,0, +Dams,Point,DamDens,none,dams.shp,NIDStorM3;NrmStorM3,Dams,Density,1,0,0, +Mine,Point,MineDens,none,mines.shp,,Mines,Density,1,0,0, +NPDES,Point,NPDESDens,none,NPDES_Major.shp,,EPA_FRS,Density,1,0,0, +Superfund,Point,SuperfundDens,none,Superfund.shp,,EPA_FRS,Density,1,0,0, +TRI,Point,TRIDens,none,TRI.shp,,EPA_FRS,Density,1,0,0, +CoalMines,Point,CoalMineDens,none,USTRAT.shp,,CoalMines,Density,1,0,0, +PctImp2011,Continuous,PctImp2011,none,imp2011.tif,,ImperviousSurfaces2011,Mean,1,0,0, +PADUS,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/GAP_Status_lookup.csv,none,gap_sts.tif,,PADUS,Percent,1,0,0, +MODIS_Ir_Ag_2002,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_02.tif,,MODIS_IrrigAg,Percent,1,0,0, +MODIS_Ir_Ag_2007,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_07.tif,,MODIS_IrrigAg,Percent,1,0,0, +MODIS_Ir_Ag_2012,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_12.tif,,MODIS_IrrigAg,Percent,1,0,0, +MTBS_Severity_1984,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1984.tif,,MTBS_Severity_1984,Percent,1,0,0, +MTBS_Severity_1985,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1985.tif,,MTBS_Severity_1985,Percent,1,0,0, +MTBS_Severity_1986,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1986.tif,,MTBS_Severity_1986,Percent,1,0,0, +MTBS_Severity_1987,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1987.tif,,MTBS_Severity_1987,Percent,1,0,0, +MTBS_Severity_1988,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1988.tif,,MTBS_Severity_1988,Percent,1,0,0, +MTBS_Severity_1989,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1989.tif,,MTBS_Severity_1989,Percent,1,0,0, +MTBS_Severity_1990,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1990.tif,,MTBS_Severity_1990,Percent,1,0,0, +MTBS_Severity_1991,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1991.tif,,MTBS_Severity_1991,Percent,1,0,0, +MTBS_Severity_1992,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1992.tif,,MTBS_Severity_1992,Percent,1,0,0, +MTBS_Severity_1993,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1993.tif,,MTBS_Severity_1993,Percent,1,0,0, +MTBS_Severity_1994,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1994.tif,,MTBS_Severity_1994,Percent,1,0,0, +MTBS_Severity_1995,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1995.tif,,MTBS_Severity_1995,Percent,1,0,0, +MTBS_Severity_1996,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1996.tif,,MTBS_Severity_1996,Percent,1,0,0, +MTBS_Severity_1997,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1997.tif,,MTBS_Severity_1997,Percent,1,0,0, +MTBS_Severity_1998,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1998.tif,,MTBS_Severity_1998,Percent,1,0,0, +MTBS_Severity_1999,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1999.tif,,MTBS_Severity_1999,Percent,1,0,0, +MTBS_Severity_2000,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2000.tif,,MTBS_Severity_2000,Percent,1,0,0, +MTBS_Severity_2001,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2001.tif,,MTBS_Severity_2001,Percent,1,0,0, +MTBS_Severity_2002,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2002.tif,,MTBS_Severity_2002,Percent,1,0,0, +MTBS_Severity_2003,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2003.tif,,MTBS_Severity_2003,Percent,1,0,0, +MTBS_Severity_2004,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2004.tif,,MTBS_Severity_2004,Percent,1,0,0, +MTBS_Severity_2005,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2005.tif,,MTBS_Severity_2005,Percent,1,0,0, +MTBS_Severity_2006,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2006.tif,,MTBS_Severity_2006,Percent,1,0,0, +MTBS_Severity_2007,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2007.tif,,MTBS_Severity_2007,Percent,1,0,0, +MTBS_Severity_2008,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2008.tif,,MTBS_Severity_2008,Percent,1,0,0, +MTBS_Severity_2009,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2009.tif,,MTBS_Severity_2009,Percent,1,0,0, +MTBS_Severity_2010,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2010.tif,,MTBS_Severity_2010,Percent,1,0,0, +MTBS_Severity_2011,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2011.tif,,MTBS_Severity_2011,Percent,1,0,0, +MTBS_Severity_2012,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2012.tif,,MTBS_Severity_2012,Percent,1,0,0, +MTBS_Severity_2013,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2013.tif,,MTBS_Severity_2013,Percent,1,0,0, +MTBS_Severity_2014,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2014.tif,,MTBS_Severity_2014,Percent,1,0,0, +MTBS_Severity_2015,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2015.tif,,MTBS_Severity_2015,Percent,1,0,0, +MTBS_Severity_2016,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2016.tif,,MTBS_Severity_2016,Percent,1,0,0, +US_Level_III_Ecoregions,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/US_Level_III_Ecoregions_lookup.csv,none,US_Level_III_Ecoregions.tif,,US_Level_III_Ecoregions,Percent,1,0,0, +nlcd2001,Categorical,lookup/NLCD2001_lookup.csv,none,NLCD_2001_Land_Cover_L48_20190424.tif,,NLCD2001,Percent,1,0,1, +nlcd2001_RipBuf100,Categorical,lookup/NLCD2001_lookup.csv,Rp100,NLCD_2001_Land_Cover_L48_20190424.tif,,NLCD2001RipBuf100,Percent,1,0,0, +nlcd2004,Categorical,lookup/NLCD2004_lookup.csv,none,NLCD_2004_Land_Cover_L48_20190424.tif,,NLCD2004,Percent,1,0,0, +nlcd2006,Categorical,lookup/NLCD2006_lookup.csv,none,NLCD_2006_Land_Cover_L48_20190424.tif,,NLCD2006,Percent,1,0,0, +nlcd2006_HiSlp,Categorical,lookup/NLCD2006_lookup.csv,Slp20,NLCD_2006_Land_Cover_L48_20190424.tif,,NLCD2006HiSlope,Percent,1,0,0, +nlcd2006_MidSlp,Categorical,lookup/NLCD2006_lookup.csv,Slp10,NLCD_2006_Land_Cover_L48_20190424.tif,,NLCD2006MidSlope,Percent,1,0,0, +nlcd2006_RipBuf100,Categorical,lookup/NLCD2006_lookup.csv,Rp100,NLCD_2006_Land_Cover_L48_20190424.tif,,NLCD2006RipBuf100,Percent,1,0,0, +nlcd2008,Categorical,lookup/NLCD2008_lookup.csv,none,NLCD_2008_Land_Cover_L48_20190424.tif,,NLCD2008,Percent,1,0,0, +nlcd2011,Categorical,lookup/NLCD2011_lookup.csv,none,NLCD_2011_Land_Cover_L48_20190424.tif,,NLCD2011,Percent,1,0,0, +nlcd2011_RipBuf100,Categorical,lookup/NLCD2011_lookup.csv,Rp100,NLCD_2011_Land_Cover_L48_20190424.tif,,NLCD2011RipBuf100,Percent,1,0,0, +nlcd2013,Categorical,lookup/NLCD2013_lookup.csv,none,NLCD_2013_Land_Cover_L48_20190424.tif,,NLCD2013,Percent,1,0,0, +nlcd2016,Categorical,lookup/NLCD2016_lookup.csv,none,NLCD_2016_Land_Cover_L48_20190424.tif,,NLCD2016,Percent,1,0,0, +nlcd2016_RipBuf100,Categorical,lookup/NLCD2016_lookup.csv,Rp100,NLCD_2016_Land_Cover_L48_20190424.tif,,NLCD2016RipBuf100,Percent,1,0,0, diff --git a/LakeCat.py b/LakeCat.py index b24fd10..43dadb9 100644 --- a/LakeCat.py +++ b/LakeCat.py @@ -3,151 +3,141 @@ Created on Tue May 31 15:24:06 2016 -#ctl = pd.read_csv('D:/Projects/LakeCat_scrap/ControlTable_LakeCat_RD.csv') +#ctl = pd.read_csv("D:/Projects/LakeCat_scrap/ControlTable_LakeCat_RD.csv") @author: Rdebbout """ import os -import sys import arcpy import numpy as np import pandas as pd import geopandas as gpd -#ctl = pd.read_csv(sys.argv[1]) -ctl = pd.read_csv(r'F:/GitProjects/LakeCat/ControlTable_LakeCat.csv') -ctl = pd.read_csv('F:/GitProjects/NARS/Landscape Metrics/ControlTable_LakeCat_NLA17.csv') -arcpy.CheckOutExtension("spatial") from datetime import datetime as dt -#sys.path.append(ctl.DirectoryLocations.values[3]) -sys.path.append('F:/GitProjects/LakeCat') from arcpy.sa import ZonalStatisticsAsTable, TabulateArea -from LakeCat_functions import inputs, rpus, dbf2DF, getOnNetLakes2, chkColumnLength, PointInPoly, Accumulation +from LakeCat_functions import (inputs, rpus, dbf2DF, getOnNetLakes2, + chkColumnLength, PointInPoly, Accumulation) +from lake_cat_config import FRAMEWORK, LYR_DIR, NHD_DIR, OUT_DIR, STREAMCAT_DIR +arcpy.CheckOutExtension("spatial") arcpy.env.cellSize = "30" -ingrid_dir = ctl.DirectoryLocations.values[0] -frame = ctl.DirectoryLocations.values[1] -out_dir = ctl.DirectoryLocations.values[2] -StreamCat = ctl.DirectoryLocations.values[4] -NHD_dir = ctl.DirectoryLocations.values[5] +if not os.path.exists(OUT_DIR): + os.mkdir(OUT_DIR) + os.mkdir("%s/ZStats" % OUT_DIR) -if not os.path.exists(out_dir): - os.mkdir(out_dir) - os.mkdir('%s/ZStats' % out_dir) - +ctl = pd.read_csv(r"ControlTable_LakeCat.csv") lls = [line for line in ctl.index if ctl.run[line] == 1] for ll in lls: # loop through each FullTableName in control table - print 'running....%s' % ctl.LandscapeLayer[ll] + print("running....%s" % ctl.LandscapeLayer[ll]) accum_type = ctl.accum_type[ll] - LLyr = '%s/%s' % (ingrid_dir, ctl.LandscapeLayer[ll]) + LLyr = "%s/%s" % (LYR_DIR, ctl.LandscapeLayer[ll]) metric = ctl.MetricName[ll] name = ctl.FullTableName[ll] - ddir = '%s/ZStats/%s' % (out_dir,name) - if not os.path.exists(ddir) and accum_type != 'Point': + ddir = "%s/ZStats/%s" % (OUT_DIR,name) + if not os.path.exists(ddir) and accum_type != "Point": os.mkdir(ddir) summaryfield = None if type(ctl.summaryfield[ll]) == str: - summaryfield = ctl.summaryfield[ll].split(';') + summaryfield = ctl.summaryfield[ll].split(";") start = dt.now() - if accum_type != 'Point': - csv = "%s/%s.csv" % (out_dir, name) + if accum_type != "Point": + csv = "%s/%s.csv" % (OUT_DIR, name) stats = pd.DataFrame() for zone in rpus.keys(): - pre = '%s/NHDPlus%s/NHDPlus%s' % (NHD_dir, inputs[zone], zone) + pre = "%s/NHDPlus%s/NHDPlus%s" % (NHD_DIR, inputs[zone], zone) for rpu in rpus[zone]: - if metric == 'Elev': - LLyr = '%s/NEDSnapshot/Ned%s/%s' % (pre, rpu, + if metric == "Elev": + LLyr = "%s/NEDSnapshot/Ned%s/%s" % (pre, rpu, ctl.LandscapeLayer[ll]) - out = '{0}/ZStats/{1}/{1}_{2}.dbf'.format(out_dir, name, rpu) + out = "{0}/ZStats/{1}/{1}_{2}.dbf".format(OUT_DIR, name, rpu) if not os.path.exists(out): - raster = '%s/rasters/wsheds/wtshds_%s.tif' % (frame, rpu) - if accum_type == 'Categorical': - TabulateArea(raster, "Value", LLyr, "Value", + raster = "%s/rasters/wsheds/wtshds_%s.tif" % (FRAMEWORK, rpu) + if accum_type == "Categorical": + TabulateArea(raster, "Value", LLyr, "Value", out, "30") - if accum_type == 'Continuous': - ZonalStatisticsAsTable(raster, "Value", LLyr, + if accum_type == "Continuous": + ZonalStatisticsAsTable(raster, "Value", LLyr, out, "DATA", "ALL") tbl = dbf2DF(out) - tbl.rename(columns={'VALUE':'UID'},inplace=True) + tbl.rename(columns={"VALUE":"UID"},inplace=True) stats = pd.concat([stats, tbl]) stats.to_csv(csv, index=False) - - if accum_type == 'Point': - - pct_full = pd.read_csv('%s/border/pct_full.csv' % frame) + + if accum_type == "Point": + + pct_full = pd.read_csv("%s/border/pct_full.csv" % FRAMEWORK) points = gpd.GeoDataFrame.from_file(LLyr) - basins = '%s/shps/allBasins.shp' % (frame) - stats = PointInPoly(points, basins, pct_full, 'UID', summaryfield) - - print 'ZonalStats Results Complete in : ' + str(dt.now() - start) - - if accum_type != 'Point': + basins = "%s/shps/allBasins.shp" % (FRAMEWORK) + stats = PointInPoly(points, basins, pct_full, "UID", summaryfield) + + print("ZonalStats Results Complete in : " + str(dt.now() - start)) + + if accum_type != "Point": b = pd.DataFrame() for zone in rpus.keys(): for rpu in rpus[zone]: - b_ = dbf2DF('%s/rasters/wsheds/wtshds_%s.tif.vat.dbf' % (frame, + b_ = dbf2DF("%s/rasters/wsheds/wtshds_%s.tif.vat.dbf" % (FRAMEWORK, rpu)) - b_['BSNAREASQKM'] = (b_.COUNT * 900) * 1e-6 - b_ = b_[['VALUE', 'BSNAREASQKM', 'COUNT']] - b_.columns = ['UID', 'AreaSqKm', 'COUNT'] + b_["BSNAREASQKM"] = (b_.COUNT * 900) * 1e-6 + b_ = b_[["VALUE", "BSNAREASQKM", "COUNT"]] + b_.columns = ["UID", "AreaSqKm", "COUNT"] b = pd.concat([b,b_]) - - - if accum_type == 'Categorical': + + if accum_type == "Categorical": stats = chkColumnLength(stats,LLyr) cols = stats.columns.tolist()[1:] - stats['AREA'] = stats[stats.columns.tolist()[1:]].sum(axis=1) - stats = pd.merge(b, stats, how='left', on='UID') - stats['PctFull'] = (((stats.AREA * 1e-6) / stats.AreaSqKm) * 100) - stats = stats[['UID', 'AreaSqKm'] + cols + ['PctFull']] + stats["AREA"] = stats[stats.columns.tolist()[1:]].sum(axis=1) + stats = pd.merge(b, stats, how="left", on="UID") + stats["PctFull"] = (((stats.AREA * 1e-6) / stats.AreaSqKm) * 100) + stats = stats[["UID", "AreaSqKm"] + cols + ["PctFull"]] cols = stats.columns[1:] - stats.columns = np.append('UID', 'Cat' + cols.values) + stats.columns = np.append("UID", "Cat" + cols.values) stats = stats.fillna(0) - - if accum_type == 'Continuous': - stats = pd.merge(b, stats, how='left', on='UID') - stats['CatPctFull'] = ((stats.COUNT_y / stats.COUNT_x) * 100) - if name == 'Elev': - stats = stats[['UID','AreaSqKm','COUNT_x','SUM', - 'MAX', 'MIN', 'CatPctFull']] - stats.columns = ['UID', 'CatAreaSqKm', 'CatCount', 'CatSum', - 'CatMax', 'CatMin', 'CatPctFull'] - else: - stats = stats[['UID','AreaSqKm','COUNT_x','SUM', 'CatPctFull']] - stats.columns = ['UID', 'CatAreaSqKm', 'CatCount', - 'CatSum', 'CatPctFull'] - stats.CatPctFull = stats.CatPctFull.fillna(0) + + if accum_type == "Continuous": + stats = pd.merge(b, stats, how="left", on="UID") + stats["CatPctFull"] = ((stats.COUNT_y / stats.COUNT_x) * 100) + if name == "Elev": + stats = stats[["UID","AreaSqKm","COUNT_x","SUM", + "MAX", "MIN", "CatPctFull"]] + stats.columns = ["UID", "CatAreaSqKm", "CatCount", "CatSum", + "CatMax", "CatMin", "CatPctFull"] + else: + stats = stats[["UID","AreaSqKm","COUNT_x","SUM", "CatPctFull"]] + stats.columns = ["UID", "CatAreaSqKm", "CatCount", + "CatSum", "CatPctFull"] + stats.CatPctFull = stats.CatPctFull.fillna(0) start2 = dt.now() - npy = '%s/LakeCat_npy' % frame - accum = np.load('%s/bastards/accum.npz' % npy) - up = Accumulation(stats, accum['comids'], - accum['lengths'], - accum['upstream'], - 'UpCat','UID') - accum = np.load('%s/children/accum.npz' % npy) - ws = Accumulation(stats, accum['comids'], - accum['lengths'], - accum['upstream'], - 'Ws','UID') - stats = pd.merge(stats, up, on='UID') - stats = pd.merge(stats, ws, on='UID') + npy = "%s/LakeCat_npy" % FRAMEWORK + accum = np.load("%s/bastards/accum.npz" % npy) + up = Accumulation(stats, accum["comids"], + accum["lengths"], + accum["upstream"], + "UpCat","UID") + accum = np.load("%s/children/accum.npz" % npy) + ws = Accumulation(stats, accum["comids"], + accum["lengths"], + accum["upstream"], + "Ws","UID") + stats = pd.merge(stats, up, on="UID") + stats = pd.merge(stats, ws, on="UID") cols = stats.columns[1:].tolist() # goto StreamCat to get On-Net-work lake results from assoc. COMIDs - stats['inStreamCat'] = 0 - # Join UID to COMID for final deliverable.. - lks = dbf2DF('%s/off-network.dbf' % frame)[['COMID','UID']] - off = pd.merge(lks,stats,on='UID',how='right') - off.drop('UID',axis=1,inplace=True) - on = getOnNetLakes2(name, StreamCat, - '%s/joinTables' % frame , - '%s/onNet_LakeCat.npz' % npy, - NHD_dir) - on['inStreamCat'] = 1 - print "Length of on_Net: " + str(len(on)) + stats["inStreamCat"] = 0 + # Join UID to COMID for final deliverable + lks = dbf2DF("%s/off-network.dbf" % FRAMEWORK)[["COMID","UID"]] + off = pd.merge(lks,stats,on="UID",how="right") + off.drop("UID",axis=1,inplace=True) + on = getOnNetLakes2(name, STREAMCAT_DIR, + "%s/joinTables" % FRAMEWORK , + "%s/onNet_LakeCat.npz" % npy, + NHD_DIR) + on["inStreamCat"] = 1 + print("Length of on_Net: " + str(len(on))) tot = pd.concat([off, on]) - tot.to_csv('%s/%s.csv' % (out_dir, name), index=False) - print 'Accumulation Results Complete in : ' + str(dt.now() - start2) + tot.to_csv("%s/%s.csv" % (OUT_DIR, name), index=False) + print("Accumulation Results Complete in : " + str(dt.now() - start2)) diff --git a/lake_cat_config.py.template b/lake_cat_config.py.template new file mode 100644 index 0000000..4e45830 --- /dev/null +++ b/lake_cat_config.py.template @@ -0,0 +1,35 @@ + + +# location of the landscape layers to perform statistics on +LYR_DIR = 'C:/path/to/landscape/layers' + +# path to the framework created for LakeCat +FRAMEWORK = ("L:/Priv/CORFiles/Geospatial_Library_Projects/LakeCat/" + "LakeCat_Framework") + +# path to Allocated StreamCat files +STREAMCAT_DIR = ("L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/" + "Allocation_and_Accumulation") + +# location of the NHDPlus, indicate the top-level directory +NHD_DIR = 'D:/NHDPlusV21' + +# TIGER shapefile is needed for calculaitng the PctFUll values of Point type +# metrics as well as organizing the final tables into separate files for states. +STATES_FILE = "path/to/file/tl_2008_us_state.shp" + +# location to write out accumulated StreamCat data <- this is intermediate +# these files will hold statistics for... +# $Cat -> statistics for each catchment +# $UpCat -> the accumulated upstream catchment statistics +# $Ws -> statistics for the entire watershed +OUT_DIR = ('C:/path/to/write/out/files/to') + +# location for the final tables +FINAL_DIR = "L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/FTP_Staging/Hydroregions" + +# files that hold the pct_full data, created from ??? +pct_full_file = "L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/ALL_BORDER_CATS.csv" +pct_full_file_RP100 = "L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/ALL_BORDER_CATS_Rp100.csv" + +#final_tables_dir L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/FTP_Staging/StreamCat/HydroRegions From b613c91fdf6fc883b82827a2a065f09c6b7be2c2 Mon Sep 17 00:00:00 2001 From: rickD Date: Thu, 3 Dec 2020 23:11:32 -0800 Subject: [PATCH 2/4] update final tables --- ControlTable_LakeCat.csv | 128 +++++++++++++++++++------------------ LakeCat.py | 2 +- LakeCat_functions.py | 18 +++--- MakeFinalTables_LakeCat.py | 53 ++++++++------- 4 files changed, 100 insertions(+), 101 deletions(-) diff --git a/ControlTable_LakeCat.csv b/ControlTable_LakeCat.csv index b3df048..43aae07 100644 --- a/ControlTable_LakeCat.csv +++ b/ControlTable_LakeCat.csv @@ -1,45 +1,21 @@ FullTableName,accum_type,MetricName,AppendMetric,LandscapeLayer,summaryfield,Final_Table_Name,MetricType,Conversion,by_RPU,run,notes -BFI,Continuous,BFI,none,bfi.tif,,BFI,Mean,1,0,0, -Clay,Continuous,Clay,none,clay.tif,,STATSGO_Set1,Mean,0.01,0,0, -PctImp2006,Continuous,PctImp2006,none,imp2006.tif,,ImperviousSurfaces2006,Mean,1,0,0, -Om,Continuous,Om,none,om.tif,,STATSGO_Set2,Mean,0.01,0,0, -Perm,Continuous,Perm,none,perm.tif,,STATSGO_Set2,Mean,0.01,0,0, -Rckdep,Continuous,Rckdep,none,rckdep.tif,,STATSGO_Set2,Mean,0.01,0,0, -RdDens,Continuous,RdDens,none,roadden.tif,,RoadDensity,Mean,1,0,0, -RdCrs,Continuous,RdCrs,none,rdstcrs.tif,,RoadStreamCrossings,Density,1,0,0, -Runoff,Continuous,Runoff,none,runoff.tif,,Runoff,Mean,1,0,0, -Sand,Continuous,Sand,none,sand.tif,,STATSGO_Set1,Mean,0.01,0,0, -WtDep,Continuous,WtDep,none,wtdep.tif,,STATSGO_Set2,Mean,0.01,0,0, -Elev,Continuous,Elev,none,elev_cm,,Elevation,Mean,0.01,1,0, -PopDen2010,Continuous,PopDen2010,none,POP_SQKM.tif,,USCensus2010,Mean,1,0,0, -HUDen2010,Continuous,HUDen2010,none,HU_SQKM.tif,,USCensus2010,Mean,1,0,0, -NH4_2008,Continuous,NH4_2008,none,dep_nh4_2008.tif,,NADP,Mean,1,0,0, -NO3_2008,Continuous,NO3_2008,none,dep_no3_2008.tif,,NADP,Mean,1,0,0, -InorgNWetDep_2008,Continuous,InorgNWetDep_2008,none,dep_totalN_2008.tif,,NADP,Mean,1,0,0, -SN_2008,Continuous,SN_2008,none,dep_splusn_2008.tif,,NADP,Mean,1,0,0, -tmin,Continuous,Tmin8110,none,tmin.tif,,PRISM_1981_2010,Mean,1,0,0, -tmean,Continuous,Tmean8110,none,tmean.tif,,PRISM_1981_2010,Mean,1,0,0, -tmax,Continuous,Tmax8110,none,tmax.tif,,PRISM_1981_2010,Mean,1,0,0, -precip,Continuous,Precip8110,none,precip.tif,,PRISM_1981_2010,Mean,1,0,0, +Ag2006HiSlp,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Ag2006HiSlp_lookup.csv,none,Ag2006HiSlp.tif,,AgMidHiSlopes,Percent,1,0,0, +Ag2006MidSlp,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Ag2006MidSlp_lookup.csv,none,Ag2006MidSlp.tif,,AgMidHiSlopes,Percent,1,0,0, +AgDrain,Categorical,lookup/AgDrain_lookup.csv,none,AgDrain_stlvl_FINAL.tif,,AgDrain,Percent,1,0,0, AgKffact,Continuous,AgKffact,none,AgKffact.tif,,Kffact,Mean,0.01,0,0, -Kffact,Continuous,Kffact,none,kffact.tif,,Kffact,Mean,0.01,0,0, -CanalDensity,Continuous,CanalDens,none,CanalsDitches.tif,,CanalsDitches,Density,0.03,0,0, -Pestic97,Continuous,Pestic97,none,pestic.tif,,Pesticides97,Mean,1,0,0, Al2O3,Continuous,Al2O3,none,al20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +Aquifers,Categorical,lookup/Aquifer_Table_lookup.csv,none,us_aquifers_two.tif,,Aquifers,Percent,1,0,0, +BFI,Continuous,BFI,none,bfi.tif,,BFI,Mean,1,0,0, +CanalDensity,Continuous,CanalDens,none,CanalsDitches.tif,,CanalsDitches,Density,0.03,0,0, CaO,Continuous,CaO,none,cao20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -Fe2O3,Continuous,Fe2O3,none,fe20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -K2O,Continuous,K2O,none,k20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -MgO,Continuous,MgO,none,mgo20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -Na2O,Continuous,Na2O,none,na20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -P2O5,Continuous,P2O5,none,p20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -S,Continuous,S,none,s20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -SiO2,Continuous,SiO2,none,si20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -N,Continuous,N,none,n20mar14.tif,,GeoChemPhys2,Mean,1,0,0, -HydrlCond,Continuous,HydrlCond,none,perm20mar14.tif,,GeoChemPhys3,Mean,1,0,0, -CompStrgth,Continuous,CompStrgth,none,ucs20mar14.tif,,GeoChemPhys4,Mean,1,0,0, CBNF,Continuous,CBNF,none,cbnf.tif,,AgriculturalNitrogen,Mean,1,0,0, +Clay,Continuous,Clay,none,clay.tif,,STATSGO_Set1,Mean,0.01,0,0, +CoalMines,Point,CoalMineDens,none,USTRAT.shp,,CoalMines,Density,1,0,0, +CompStrgth,Continuous,CompStrgth,none,ucs20mar14.tif,,GeoChemPhys4,Mean,1,0,0, +Dams,Point,DamDens,none,dams.shp,NIDStorM3;NrmStorM3,Dams,Density,1,0,0, +Elev,Continuous,Elev,none,elev_cm,,Elevation,Mean,0.01,1,0, +Fe2O3,Continuous,Fe2O3,none,fe20mar14.tif,,GeoChemPhys1,Mean,1,0,0, Fert,Continuous,Fert,none,fert.tif,,AgriculturalNitrogen,Mean,1,0,0, -Manure,Continuous,Manure,none,manure.tif,,AgriculturalNitrogen,Mean,1,0,0, Fire2000,Continuous,PctFire2000,none,fire2000.tif,,FirePerimeters,Mean,100,0,0, Fire2001,Continuous,PctFire2001,none,fire2001.tif,,FirePerimeters,Mean,100,0,0, Fire2002,Continuous,PctFire2002,none,fire2002.tif,,FirePerimeters,Mean,100,0,0, @@ -51,27 +27,15 @@ Fire2007,Continuous,PctFire2007,none,fire2007.tif,,FirePerimeters,Mean,100,0,0, Fire2008,Continuous,PctFire2008,none,fire2008.tif,,FirePerimeters,Mean,100,0,0, Fire2009,Continuous,PctFire2009,none,fire2009.tif,,FirePerimeters,Mean,100,0,0, Fire2010,Continuous,PctFire2010,none,fire2010.tif,,FirePerimeters,Mean,100,0,0, -PctNonAgIntrodManagVeg,Continuous,PctNonAgIntrodManagVeg,none,IntrodManagVeg.tif,,NonAgIntrodManagVeg,Mean,100,0,0, -PRISMppt_2008,Continuous,Precip08,none,PRISMppt_2008.tif,,PRISM_0809,Mean,1,0,0, -PRISMppt_2009,Continuous,Precip09,none,PRISMppt_2009.tif,,PRISM_0809,Mean,1,0,0, -PRISMtmean_2008,Continuous,Tmean08,none,PRISMtmean_2008.tif,,PRISM_0809,Mean,1,0,0, -PRISMtmean_2009,Continuous,Tmean09,none,PRISMtmean_2009.tif,,PRISM_0809,Mean,1,0,0, -WetnessIndex,Continuous,WetIndex,none,cti_v3.tif,,WetIndx,Mean,1,0,0, -nlcd2006,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/NLCD2006_lookup.csv,none,nlcd2006.tif,,NLCD2006,Percent,1,0,0, -nlcd2011,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/NLCD2011_lookup.csv,none,nlcd2011.tif,,NLCD2011,Percent,1,0,0, +HUDen2010,Continuous,HUDen2010,none,HU_SQKM.tif,,USCensus2010,Mean,1,0,0, +HydrlCond,Continuous,HydrlCond,none,perm20mar14.tif,,GeoChemPhys3,Mean,1,0,0, +InorgNWetDep_2008,Continuous,InorgNWetDep_2008,none,dep_totalN_2008.tif,,NADP,Mean,1,0,0, +K2O,Continuous,K2O,none,k20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +Kffact,Continuous,Kffact,none,kffact.tif,,Kffact,Mean,0.01,0,0, lith,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Lithology_lookup.csv,none,us_lithology_1km_dd83.tif,,Lithology,Percent,1,0,0, -Ag2006HiSlp,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Ag2006HiSlp_lookup.csv,none,Ag2006HiSlp.tif,,AgMidHiSlopes,Percent,1,0,0, -Ag2006MidSlp,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Ag2006MidSlp_lookup.csv,none,Ag2006MidSlp.tif,,AgMidHiSlopes,Percent,1,0,0, -PctFrstLossByYear,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/ForestLossByYear_lookup.csv,none,lossyr.tif,,ForestLossByYear0013,Percent,1,0,0, -NABD,Point,NABD_Dens,none,NABD.shp,NIDStorM3;NrmStorM3,NABD,Density,1,0,0, -Dams,Point,DamDens,none,dams.shp,NIDStorM3;NrmStorM3,Dams,Density,1,0,0, +Manure,Continuous,Manure,none,manure.tif,,AgriculturalNitrogen,Mean,1,0,0, +MgO,Continuous,MgO,none,mgo20mar14.tif,,GeoChemPhys1,Mean,1,0,0, Mine,Point,MineDens,none,mines.shp,,Mines,Density,1,0,0, -NPDES,Point,NPDESDens,none,NPDES_Major.shp,,EPA_FRS,Density,1,0,0, -Superfund,Point,SuperfundDens,none,Superfund.shp,,EPA_FRS,Density,1,0,0, -TRI,Point,TRIDens,none,TRI.shp,,EPA_FRS,Density,1,0,0, -CoalMines,Point,CoalMineDens,none,USTRAT.shp,,CoalMines,Density,1,0,0, -PctImp2011,Continuous,PctImp2011,none,imp2011.tif,,ImperviousSurfaces2011,Mean,1,0,0, -PADUS,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/GAP_Status_lookup.csv,none,gap_sts.tif,,PADUS,Percent,1,0,0, MODIS_Ir_Ag_2002,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_02.tif,,MODIS_IrrigAg,Percent,1,0,0, MODIS_Ir_Ag_2007,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_07.tif,,MODIS_IrrigAg,Percent,1,0,0, MODIS_Ir_Ag_2012,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_12.tif,,MODIS_IrrigAg,Percent,1,0,0, @@ -108,17 +72,55 @@ MTBS_Severity_2013,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/Stre MTBS_Severity_2014,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2014.tif,,MTBS_Severity_2014,Percent,1,0,0, MTBS_Severity_2015,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2015.tif,,MTBS_Severity_2015,Percent,1,0,0, MTBS_Severity_2016,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2016.tif,,MTBS_Severity_2016,Percent,1,0,0, -US_Level_III_Ecoregions,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/US_Level_III_Ecoregions_lookup.csv,none,US_Level_III_Ecoregions.tif,,US_Level_III_Ecoregions,Percent,1,0,0, -nlcd2001,Categorical,lookup/NLCD2001_lookup.csv,none,NLCD_2001_Land_Cover_L48_20190424.tif,,NLCD2001,Percent,1,0,1, -nlcd2001_RipBuf100,Categorical,lookup/NLCD2001_lookup.csv,Rp100,NLCD_2001_Land_Cover_L48_20190424.tif,,NLCD2001RipBuf100,Percent,1,0,0, +N,Continuous,N,none,n20mar14.tif,,GeoChemPhys2,Mean,1,0,0, +Na2O,Continuous,Na2O,none,na20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +NABD,Point,NABD_Dens,none,NABD.shp,NIDStorM3;NrmStorM3,NABD,Density,1,0,0, +NH4_2008,Continuous,NH4_2008,none,dep_nh4_2008.tif,,NADP,Mean,1,0,0, +nlcd2001,Categorical,lookup/NLCD2001_lookup.csv,none,NLCD_2001_Land_Cover_L48_20190424.tif,,NLCD2001,Percent,1,0,0, nlcd2004,Categorical,lookup/NLCD2004_lookup.csv,none,NLCD_2004_Land_Cover_L48_20190424.tif,,NLCD2004,Percent,1,0,0, nlcd2006,Categorical,lookup/NLCD2006_lookup.csv,none,NLCD_2006_Land_Cover_L48_20190424.tif,,NLCD2006,Percent,1,0,0, -nlcd2006_HiSlp,Categorical,lookup/NLCD2006_lookup.csv,Slp20,NLCD_2006_Land_Cover_L48_20190424.tif,,NLCD2006HiSlope,Percent,1,0,0, -nlcd2006_MidSlp,Categorical,lookup/NLCD2006_lookup.csv,Slp10,NLCD_2006_Land_Cover_L48_20190424.tif,,NLCD2006MidSlope,Percent,1,0,0, -nlcd2006_RipBuf100,Categorical,lookup/NLCD2006_lookup.csv,Rp100,NLCD_2006_Land_Cover_L48_20190424.tif,,NLCD2006RipBuf100,Percent,1,0,0, nlcd2008,Categorical,lookup/NLCD2008_lookup.csv,none,NLCD_2008_Land_Cover_L48_20190424.tif,,NLCD2008,Percent,1,0,0, nlcd2011,Categorical,lookup/NLCD2011_lookup.csv,none,NLCD_2011_Land_Cover_L48_20190424.tif,,NLCD2011,Percent,1,0,0, -nlcd2011_RipBuf100,Categorical,lookup/NLCD2011_lookup.csv,Rp100,NLCD_2011_Land_Cover_L48_20190424.tif,,NLCD2011RipBuf100,Percent,1,0,0, nlcd2013,Categorical,lookup/NLCD2013_lookup.csv,none,NLCD_2013_Land_Cover_L48_20190424.tif,,NLCD2013,Percent,1,0,0, nlcd2016,Categorical,lookup/NLCD2016_lookup.csv,none,NLCD_2016_Land_Cover_L48_20190424.tif,,NLCD2016,Percent,1,0,0, -nlcd2016_RipBuf100,Categorical,lookup/NLCD2016_lookup.csv,Rp100,NLCD_2016_Land_Cover_L48_20190424.tif,,NLCD2016RipBuf100,Percent,1,0,0, +NO3_2008,Continuous,NO3_2008,none,dep_no3_2008.tif,,NADP,Mean,1,0,0, +NPDES,Point,NPDESDens,none,NPDES_Major.shp,,EPA_FRS,Density,1,0,0, +Om,Continuous,Om,none,om.tif,,STATSGO_Set2,Mean,0.01,0,0, +P2O5,Continuous,P2O5,none,p20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +PADUS,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/GAP_Status_lookup.csv,none,gap_sts.tif,,PADUS,Percent,1,0,0, +PctFrstLossByYear,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/ForestLossByYear_lookup.csv,none,lossyr.tif,,ForestLossByYear0013,Percent,1,0,0, +PctImp2001,Continuous,PctImp2001,none,NLCD_2001_Impervious_descriptor_L48_20190405.tif,,ImperviousSurfaces2001,Mean,1,0,0, +PctImp2006,Continuous,PctImp2006,none,NLCD_2006_Impervious_descriptor_L48_20190405.tif,,ImperviousSurfaces2006,Mean,1,0,0, +PctImp2011,Continuous,PctImp2011,none,NLCD_2011_Impervious_descriptor_L48_20190405.tif,,ImperviousSurfaces2011,Mean,1,0,0, +PctImp2016,Continuous,PctImp2016,none,NLCD_2016_Impervious_descriptor_L48_20190405.tif,,ImperviousSurfaces2016,Mean,1,0,0, +PctNonAgIntrodManagVeg,Continuous,PctNonAgIntrodManagVeg,none,IntrodManagVeg.tif,,NonAgIntrodManagVeg,Mean,100,0,0, +Perm,Continuous,Perm,none,perm.tif,,STATSGO_Set2,Mean,0.01,0,0, +Pestic97,Continuous,Pestic97,none,pestic.tif,,Pesticides97,Mean,1,0,0, +PopDen2010,Continuous,PopDen2010,none,POP_SQKM.tif,,USCensus2010,Mean,1,0,0, +precip,Continuous,Precip8110,none,precip.tif,,PRISM_1981_2010,Mean,1,0,0, +Precip_Minus_EVT,Continuous,Precip_Minus_EVT,none,USAavgPeriod_pptSurp_1994to2016.tif,,Precip_Minus_EVT,Mean,1,0,0, +PRISMppt_2008,Continuous,Precip08,none,PRISMppt_2008.tif,,PRISM_0809,Mean,1,0,0, +PRISMppt_2009,Continuous,Precip09,none,PRISMppt_2009.tif,,PRISM_0809,Mean,1,0,0, +PRISMtmean_2008,Continuous,Tmean08,none,PRISMtmean_2008.tif,,PRISM_0809,Mean,1,0,0, +PRISMtmean_2009,Continuous,Tmean09,none,PRISMtmean_2009.tif,,PRISM_0809,Mean,1,0,0, +Rckdep,Continuous,Rckdep,none,rckdep.tif,,STATSGO_Set2,Mean,0.01,0,0, +RdCrs,Continuous,RdCrs,none,rdstcrs.tif,,RoadStreamCrossings,Density,1,0,0, +RdDens,Continuous,RdDens,none,roadden.tif,,RoadDensity,Mean,1,0,0, +RockN,Continuous,RockN,none,RockN_USA_USGSproj_1km_kgkm2.tif,,RockN,Mean,1,0,0, +Runoff,Continuous,Runoff,none,runoff.tif,,Runoff,Mean,1,0,0, +S,Continuous,S,none,s20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +Sand,Continuous,Sand,none,sand.tif,,STATSGO_Set1,Mean,0.01,0,0, +SiO2,Continuous,SiO2,none,si20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +SN_2008,Continuous,SN_2008,none,dep_splusn_2008.tif,,NADP,Mean,1,0,0, +Superfund,Point,SuperfundDens,none,Superfund.shp,,EPA_FRS,Density,1,0,0, +sw_flux,Continuous,sw_flux,none,TN_load_px.tif,,sw_flux,Mean,1,0,0, +tmax,Continuous,Tmax8110,none,tmax.tif,,PRISM_1981_2010,Mean,1,0,0, +tmean,Continuous,Tmean8110,none,tmean.tif,,PRISM_1981_2010,Mean,1,0,0, +tmin,Continuous,Tmin8110,none,tmin.tif,,PRISM_1981_2010,Mean,1,0,0, +TRI,Point,TRIDens,none,TRI.shp,,EPA_FRS,Density,1,0,0, +US_Level_III_Ecoregions,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/US_Level_III_Ecoregions_lookup.csv,none,US_Level_III_Ecoregions.tif,,US_Level_III_Ecoregions,Percent,1,0,0, +WetnessIndex,Continuous,WetIndex,none,cti_v3.tif,,WetIndx,Mean,1,0,0, +WtDep,Continuous,WtDep,none,wtdep.tif,,STATSGO_Set2,Mean,0.01,0,0, +WWTPAll,Point,WWTPAllDens,none,WWTP_All_CWA_Active_2013_CONUS.shp,,WWTP,Density,1,0,0, +WWTPMajor,Point,WWTPMajorDens,none,WWTP_Major_CWA_Active_2013_CONUS.shp,,WWTP,Density,1,0,0, +WWTPMinor,Point,WWTPMinorDens,none,WWTP_Minor_CWA_Active_2013_CONUS.shp,,WWTP,Density,1,0,0, diff --git a/LakeCat.py b/LakeCat.py index 43dadb9..193cbb2 100644 --- a/LakeCat.py +++ b/LakeCat.py @@ -31,7 +31,7 @@ lls = [line for line in ctl.index if ctl.run[line] == 1] for ll in lls: # loop through each FullTableName in control table - print("running....%s" % ctl.LandscapeLayer[ll]) + print("running....%s" % ctl.FullTableName[ll]) accum_type = ctl.accum_type[ll] LLyr = "%s/%s" % (LYR_DIR, ctl.LandscapeLayer[ll]) metric = ctl.MetricName[ll] diff --git a/LakeCat_functions.py b/LakeCat_functions.py index 7ec3be3..156c4bb 100644 --- a/LakeCat_functions.py +++ b/LakeCat_functions.py @@ -1131,15 +1131,15 @@ def main (nhd, out): os.mkdir("%s/shps" % out) os.mkdir("%s/joinTables" % out) os.mkdir("%s/LakeCat_npy" % out) - - -# NHDbounds = gpd.read_file( -# "%s/NHDPlusGlobalData/BoundaryUnit.shp" % nhd).drop( -# ['AreaSqKM','DrainageID','Shape_Area', -# 'Shape_Leng','UnitName'], axis=1) -# if not os.path.exists("%s/Lake_QA.csv" % out): -# NHDtblMerge(nhd, NHDbounds, out) -# makeBasins(nhd, NHDbounds, out) + + + NHDbounds = gpd.read_file( + "%s/NHDPlusGlobalData/BoundaryUnit.shp" % nhd).drop( + ['AreaSqKM','DrainageID','Shape_Area', + 'Shape_Leng','UnitName'], axis=1) + if not os.path.exists("%s/Lake_QA.csv" % out): + NHDtblMerge(nhd, NHDbounds, out) + makeBasins(nhd, NHDbounds, out) makeNParrays('%s' % out) ############################################################################## diff --git a/MakeFinalTables_LakeCat.py b/MakeFinalTables_LakeCat.py index d9b3480..95ab925 100644 --- a/MakeFinalTables_LakeCat.py +++ b/MakeFinalTables_LakeCat.py @@ -7,37 +7,32 @@ # import sys, os +import zipfile import pandas as pd -#from collections import OrderedDict -ctl = pd.read_csv(sys.argv[1]) #ctl = pd.read_csv('D:/Projects/LakeCat_scrap/ControlTable_LakeCat_RD.csv') -ctl = pd.read_csv(r'F:/GitProjects/LakeCat/ControlTable_LakeCat.csv') -ctl = pd.read_csv('F:/GitProjects/NARS/Landscape Metrics/ControlTable_LakeCat_NLA17.csv') -#inputs = OrderedDict([('10U','MS'),('10L','MS'),('07','MS'),('11','MS'),('06','MS'),('05','MS'),('08','MS'),\ -# ('01','NE'),('02','MA'),('03N','SA'),('03S','SA'),('03W','SA'),('04','GL'),('09','SR'),\ -# ('12','TX'),('13','RG'),('14','CO'),('15','CO'),('16','GB'),('17','PN'),('18','CA')]) -inDir = ctl.DirectoryLocations.values[2] -outDir = ctl.DirectoryLocations.values[6] -tables = dict() -for row in range(len(ctl.Final_Table_Name)): - if ctl.run[row] == 1 and len(ctl.Final_Table_Name[row]): - tables[ctl.Final_Table_Name[row]] = ctl.FullTableName.loc[ctl.Final_Table_Name == ctl.Final_Table_Name[row]].tolist() - tables[ctl.Final_Table_Name[row]].sort() + +from lake_cat_config import FINAL_DIR, OUT_DIR + +ctl = pd.read_csv("ControlTable_LakeCat.csv") + +runners = ctl.query("run == 1").groupby("Final_Table_Name") +tables = runners["FullTableName"].unique().to_dict() missing = [] -for table in tables: - for var in range(len(tables[table])): - if not os.path.exists(inDir + '/%s.csv'%(tables[table][var])): - missing.append(tables[table][var] + '.csv') +for table, metrics in tables.items(): + for metric in metrics: + accumulated_file = OUT_DIR + "/{}.csv".format(metric) + if not os.path.exists(accumulated_file): + missing.append(metric) + if len(missing) > 0: for miss in missing: - print 'Missing ' + miss - print 'Check output from LakeCat.py' + print('Missing ' + miss) + print('Check output from LakeCat.py') sys.exit() allStats = pd.DataFrame() for table in tables: - if not os.path.exists(outDir +'/' + table + '.csv'): + if not os.path.exists(FINAL_DIR +'/' + table + '.csv'): print 'Running ' + table + ' .....' for var in range(len(tables[table])): - print var accum = ctl.accum_type.loc[ctl.Final_Table_Name == table].any() metricName = ctl.MetricName.loc[ctl.FullTableName == tables[table][var]].item() metricType = ctl.MetricType.loc[ctl.FullTableName == tables[table][var]].item() @@ -45,7 +40,7 @@ if appendMetric == 'none': appendMetric = '' conversion = float(ctl.Conversion.loc[ctl.FullTableName == tables[table][var]].values[0]) - tbl = pd.read_csv(inDir + '/%s.csv'%(tables[table][var])) + tbl = pd.read_csv(OUT_DIR + '/%s.csv'%(tables[table][var])) frontCols = [title for title in tbl.columns for x in ['COMID','AreaSqKm','PctFull','inStreamCat'] if x in title and not 'Up' in title] catArea = frontCols[1] catPct = frontCols[2] @@ -125,12 +120,14 @@ 'MIN': [final[c].min()], 'MAX':[final[c].max()]})]) allStats = pd.concat([allStats,statTbl]) + print(statTbl) final = final.set_index('COMID').fillna('NA') final = final[final.columns.tolist()[:5] + [x for x in final.columns[5:] if 'Cat' in x] + [x for x in final.columns[5:] if 'Ws' in x]].fillna('NA') - final.to_csv('%s/%s.csv' % (outDir, table)) - + out_file = '%s/%s.csv' % (FINAL_DIR, table) + final.to_csv(out_file) + # zip up the file.... + zf = zipfile.ZipFile("{}/zips/{}.zip".format(FINAL_DIR, table), mode="w") + zf.write(out_file, "{}.csv".format(table), compress_type=zipfile.ZIP_DEFLATED) + zf.close() print 'All Done.....' - -# if summaryfield != None: -# off.columns = [col.replace('M3','') for col in off.columns] From 4810301607e73eb8ba6e18eb8377b9dfea20aecd Mon Sep 17 00:00:00 2001 From: rickD Date: Fri, 29 Jan 2021 12:30:11 -0800 Subject: [PATCH 3/4] add metrics to ControlTable, enforce UID dtype for stats table --- ControlTable_LakeCat.csv | 24 +++++++++++++++++++++--- LakeCat.py | 1 + 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ControlTable_LakeCat.csv b/ControlTable_LakeCat.csv index 43aae07..597b969 100644 --- a/ControlTable_LakeCat.csv +++ b/ControlTable_LakeCat.csv @@ -34,11 +34,12 @@ K2O,Continuous,K2O,none,k20mar14.tif,,GeoChemPhys1,Mean,1,0,0, Kffact,Continuous,Kffact,none,kffact.tif,,Kffact,Mean,0.01,0,0, lith,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Lithology_lookup.csv,none,us_lithology_1km_dd83.tif,,Lithology,Percent,1,0,0, Manure,Continuous,Manure,none,manure.tif,,AgriculturalNitrogen,Mean,1,0,0, +MercDep,Continuous,MercDep,none,Hg_dep_2011.tif,,MercDep,Mean,1,0,0, MgO,Continuous,MgO,none,mgo20mar14.tif,,GeoChemPhys1,Mean,1,0,0, Mine,Point,MineDens,none,mines.shp,,Mines,Density,1,0,0, -MODIS_Ir_Ag_2002,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_02.tif,,MODIS_IrrigAg,Percent,1,0,0, -MODIS_Ir_Ag_2007,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_07.tif,,MODIS_IrrigAg,Percent,1,0,0, -MODIS_Ir_Ag_2012,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_12.tif,,MODIS_IrrigAg,Percent,1,0,0, +MODIS_Ir_Ag_2002,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_02.tif,,,Percent,1,0,0, +MODIS_Ir_Ag_2007,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_07.tif,,,Percent,1,0,0, +MODIS_Ir_Ag_2012,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_12.tif,,,Percent,1,0,0, MTBS_Severity_1984,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1984.tif,,MTBS_Severity_1984,Percent,1,0,0, MTBS_Severity_1985,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1985.tif,,MTBS_Severity_1985,Percent,1,0,0, MTBS_Severity_1986,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1986.tif,,MTBS_Severity_1986,Percent,1,0,0, @@ -76,6 +77,11 @@ N,Continuous,N,none,n20mar14.tif,,GeoChemPhys2,Mean,1,0,0, Na2O,Continuous,Na2O,none,na20mar14.tif,,GeoChemPhys1,Mean,1,0,0, NABD,Point,NABD_Dens,none,NABD.shp,NIDStorM3;NrmStorM3,NABD,Density,1,0,0, NH4_2008,Continuous,NH4_2008,none,dep_nh4_2008.tif,,NADP,Mean,1,0,0, +NH4_2014,Continuous,NH4_2014,none,NH4_dep_2014.tif,,NADP_2014_2018,Mean,1,0,0, +NH4_2015,Continuous,NH4_2015,none,NH4_dep_2015.tif,,NADP_2014_2018,Mean,1,0,0, +NH4_2016,Continuous,NH4_2016,none,NH4_dep_2016.tif,,NADP_2014_2018,Mean,1,0,0, +NH4_2017,Continuous,NH4_2017,none,NH4_dep_2017.tif,,NADP_2014_2018,Mean,1,0,0, +NH4_2018,Continuous,NH4_2018,none,NH4_dep_2018.tif,,NADP_2014_2018,Mean,1,0,0, nlcd2001,Categorical,lookup/NLCD2001_lookup.csv,none,NLCD_2001_Land_Cover_L48_20190424.tif,,NLCD2001,Percent,1,0,0, nlcd2004,Categorical,lookup/NLCD2004_lookup.csv,none,NLCD_2004_Land_Cover_L48_20190424.tif,,NLCD2004,Percent,1,0,0, nlcd2006,Categorical,lookup/NLCD2006_lookup.csv,none,NLCD_2006_Land_Cover_L48_20190424.tif,,NLCD2006,Percent,1,0,0, @@ -84,6 +90,11 @@ nlcd2011,Categorical,lookup/NLCD2011_lookup.csv,none,NLCD_2011_Land_Cover_L48_20 nlcd2013,Categorical,lookup/NLCD2013_lookup.csv,none,NLCD_2013_Land_Cover_L48_20190424.tif,,NLCD2013,Percent,1,0,0, nlcd2016,Categorical,lookup/NLCD2016_lookup.csv,none,NLCD_2016_Land_Cover_L48_20190424.tif,,NLCD2016,Percent,1,0,0, NO3_2008,Continuous,NO3_2008,none,dep_no3_2008.tif,,NADP,Mean,1,0,0, +NO3_2014,Continuous,NO3_2014,none,NO3_dep_2014.tif,,NADP_2014_2018,Mean,1,0,0, +NO3_2015,Continuous,NO3_2015,none,NO3_dep_2015.tif,,NADP_2014_2018,Mean,1,0,0, +NO3_2016,Continuous,NO3_2016,none,NO3_dep_2016.tif,,NADP_2014_2018,Mean,1,0,0, +NO3_2017,Continuous,NO3_2017,none,NO3_dep_2017.tif,,NADP_2014_2018,Mean,1,0,0, +NO3_2018,Continuous,NO3_2018,none,NO3_dep_2018.tif,,NADP_2014_2018,Mean,1,0,0, NPDES,Point,NPDESDens,none,NPDES_Major.shp,,EPA_FRS,Density,1,0,0, Om,Continuous,Om,none,om.tif,,STATSGO_Set2,Mean,0.01,0,0, P2O5,Continuous,P2O5,none,p20mar14.tif,,GeoChemPhys1,Mean,1,0,0, @@ -94,8 +105,10 @@ PctImp2006,Continuous,PctImp2006,none,NLCD_2006_Impervious_descriptor_L48_201904 PctImp2011,Continuous,PctImp2011,none,NLCD_2011_Impervious_descriptor_L48_20190405.tif,,ImperviousSurfaces2011,Mean,1,0,0, PctImp2016,Continuous,PctImp2016,none,NLCD_2016_Impervious_descriptor_L48_20190405.tif,,ImperviousSurfaces2016,Mean,1,0,0, PctNonAgIntrodManagVeg,Continuous,PctNonAgIntrodManagVeg,none,IntrodManagVeg.tif,,NonAgIntrodManagVeg,Mean,100,0,0, +PCVPY_2017,Continuous,PCVPY_2017,none,PCVPY.tif,,PRISM_2017,Mean,1,0,0, Perm,Continuous,Perm,none,perm.tif,,STATSGO_Set2,Mean,0.01,0,0, Pestic97,Continuous,Pestic97,none,pestic.tif,,Pesticides97,Mean,1,0,0, +PIP_2017,Continuous,PIP_2017,none,PIP.tif,,PRISM_2017,Mean,1,0,0, PopDen2010,Continuous,PopDen2010,none,POP_SQKM.tif,,USCensus2010,Mean,1,0,0, precip,Continuous,Precip8110,none,precip.tif,,PRISM_1981_2010,Mean,1,0,0, Precip_Minus_EVT,Continuous,Precip_Minus_EVT,none,USAavgPeriod_pptSurp_1994to2016.tif,,Precip_Minus_EVT,Mean,1,0,0, @@ -103,6 +116,8 @@ PRISMppt_2008,Continuous,Precip08,none,PRISMppt_2008.tif,,PRISM_0809,Mean,1,0,0, PRISMppt_2009,Continuous,Precip09,none,PRISMppt_2009.tif,,PRISM_0809,Mean,1,0,0, PRISMtmean_2008,Continuous,Tmean08,none,PRISMtmean_2008.tif,,PRISM_0809,Mean,1,0,0, PRISMtmean_2009,Continuous,Tmean09,none,PRISMtmean_2009.tif,,PRISM_0809,Mean,1,0,0, +PSUM6_2017,Continuous,PSUM6_2017,none,PSUM6.tif,,PRISM_2017,Mean,1,0,0, +PSUMPY_2017,Continuous,PSUMPY_2017,none,PSUMPY.tif,,PRISM_2017,Mean,1,0,0, Rckdep,Continuous,Rckdep,none,rckdep.tif,,STATSGO_Set2,Mean,0.01,0,0, RdCrs,Continuous,RdCrs,none,rdstcrs.tif,,RoadStreamCrossings,Density,1,0,0, RdDens,Continuous,RdDens,none,roadden.tif,,RoadDensity,Mean,1,0,0, @@ -114,8 +129,11 @@ SiO2,Continuous,SiO2,none,si20mar14.tif,,GeoChemPhys1,Mean,1,0,0, SN_2008,Continuous,SN_2008,none,dep_splusn_2008.tif,,NADP,Mean,1,0,0, Superfund,Point,SuperfundDens,none,Superfund.shp,,EPA_FRS,Density,1,0,0, sw_flux,Continuous,sw_flux,none,TN_load_px.tif,,sw_flux,Mean,1,0,0, +TIP_2017,Continuous,PIP_2017,none,TIP.tif,,PRISM_2017,Mean,1,0,0, tmax,Continuous,Tmax8110,none,tmax.tif,,PRISM_1981_2010,Mean,1,0,0, tmean,Continuous,Tmean8110,none,tmean.tif,,PRISM_1981_2010,Mean,1,0,0, +TMEANPW_2017,Continuous,TMEANPW_2017,none,TMEANPW.tif,,PRISM_2017,Mean,1,0,0, +TMEANPY_2017,Continuous,TMEANPY_2017,none,TMEANPY.tif,,PRISM_2017,Mean,1,0,0, tmin,Continuous,Tmin8110,none,tmin.tif,,PRISM_1981_2010,Mean,1,0,0, TRI,Point,TRIDens,none,TRI.shp,,EPA_FRS,Density,1,0,0, US_Level_III_Ecoregions,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/US_Level_III_Ecoregions_lookup.csv,none,US_Level_III_Ecoregions.tif,,US_Level_III_Ecoregions,Percent,1,0,0, diff --git a/LakeCat.py b/LakeCat.py index 193cbb2..19dd5d7 100644 --- a/LakeCat.py +++ b/LakeCat.py @@ -65,6 +65,7 @@ tbl = dbf2DF(out) tbl.rename(columns={"VALUE":"UID"},inplace=True) stats = pd.concat([stats, tbl]) + stats.UID = stats.UID.astype(np.int64) stats.to_csv(csv, index=False) if accum_type == "Point": From 6855ebd44f8253ab82168173af248a140c6b3ba6 Mon Sep 17 00:00:00 2001 From: rickD Date: Fri, 26 Mar 2021 09:42:15 -0700 Subject: [PATCH 4/4] update control table MTBS records --- ControlTable_LakeCat.csv | 143 ++++++++++++++++++++++++--------------- 1 file changed, 90 insertions(+), 53 deletions(-) diff --git a/ControlTable_LakeCat.csv b/ControlTable_LakeCat.csv index 597b969..7d2c972 100644 --- a/ControlTable_LakeCat.csv +++ b/ControlTable_LakeCat.csv @@ -1,21 +1,19 @@ FullTableName,accum_type,MetricName,AppendMetric,LandscapeLayer,summaryfield,Final_Table_Name,MetricType,Conversion,by_RPU,run,notes +AgDrain,Categorical,lookup/AgDrain_lookup.csv,none,AgDrain_stlvl_FINAL.tif,,AgDrain,Percent,1,0,0, Ag2006HiSlp,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Ag2006HiSlp_lookup.csv,none,Ag2006HiSlp.tif,,AgMidHiSlopes,Percent,1,0,0, Ag2006MidSlp,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Ag2006MidSlp_lookup.csv,none,Ag2006MidSlp.tif,,AgMidHiSlopes,Percent,1,0,0, -AgDrain,Categorical,lookup/AgDrain_lookup.csv,none,AgDrain_stlvl_FINAL.tif,,AgDrain,Percent,1,0,0, -AgKffact,Continuous,AgKffact,none,AgKffact.tif,,Kffact,Mean,0.01,0,0, -Al2O3,Continuous,Al2O3,none,al20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +CBNF,Continuous,CBNF,none,cbnf.tif,,AgriculturalNitrogen,Mean,1,0,0, +Fert,Continuous,Fert,none,fert.tif,,AgriculturalNitrogen,Mean,1,0,0, +Manure,Continuous,Manure,none,manure.tif,,AgriculturalNitrogen,Mean,1,0,0, Aquifers,Categorical,lookup/Aquifer_Table_lookup.csv,none,us_aquifers_two.tif,,Aquifers,Percent,1,0,0, BFI,Continuous,BFI,none,bfi.tif,,BFI,Mean,1,0,0, CanalDensity,Continuous,CanalDens,none,CanalsDitches.tif,,CanalsDitches,Density,0.03,0,0, -CaO,Continuous,CaO,none,cao20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -CBNF,Continuous,CBNF,none,cbnf.tif,,AgriculturalNitrogen,Mean,1,0,0, -Clay,Continuous,Clay,none,clay.tif,,STATSGO_Set1,Mean,0.01,0,0, CoalMines,Point,CoalMineDens,none,USTRAT.shp,,CoalMines,Density,1,0,0, -CompStrgth,Continuous,CompStrgth,none,ucs20mar14.tif,,GeoChemPhys4,Mean,1,0,0, Dams,Point,DamDens,none,dams.shp,NIDStorM3;NrmStorM3,Dams,Density,1,0,0, Elev,Continuous,Elev,none,elev_cm,,Elevation,Mean,0.01,1,0, -Fe2O3,Continuous,Fe2O3,none,fe20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -Fert,Continuous,Fert,none,fert.tif,,AgriculturalNitrogen,Mean,1,0,0, +NPDES,Point,NPDESDens,none,NPDES_Major.shp,,EPA_FRS,Density,1,0,0, +Superfund,Point,SuperfundDens,none,Superfund.shp,,EPA_FRS,Density,1,0,0, +TRI,Point,TRIDens,none,TRI.shp,,EPA_FRS,Density,1,0,0, Fire2000,Continuous,PctFire2000,none,fire2000.tif,,FirePerimeters,Mean,100,0,0, Fire2001,Continuous,PctFire2001,none,fire2001.tif,,FirePerimeters,Mean,100,0,0, Fire2002,Continuous,PctFire2002,none,fire2002.tif,,FirePerimeters,Mean,100,0,0, @@ -27,19 +25,63 @@ Fire2007,Continuous,PctFire2007,none,fire2007.tif,,FirePerimeters,Mean,100,0,0, Fire2008,Continuous,PctFire2008,none,fire2008.tif,,FirePerimeters,Mean,100,0,0, Fire2009,Continuous,PctFire2009,none,fire2009.tif,,FirePerimeters,Mean,100,0,0, Fire2010,Continuous,PctFire2010,none,fire2010.tif,,FirePerimeters,Mean,100,0,0, -HUDen2010,Continuous,HUDen2010,none,HU_SQKM.tif,,USCensus2010,Mean,1,0,0, -HydrlCond,Continuous,HydrlCond,none,perm20mar14.tif,,GeoChemPhys3,Mean,1,0,0, -InorgNWetDep_2008,Continuous,InorgNWetDep_2008,none,dep_totalN_2008.tif,,NADP,Mean,1,0,0, +PctFrstLossByYear,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/ForestLossByYear_lookup.csv,none,lossyr.tif,,ForestLossByYear0013,Percent,1,0,0, +Al2O3,Continuous,Al2O3,none,al20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +CaO,Continuous,CaO,none,cao20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +Fe2O3,Continuous,Fe2O3,none,fe20mar14.tif,,GeoChemPhys1,Mean,1,0,0, K2O,Continuous,K2O,none,k20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +MgO,Continuous,MgO,none,mgo20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +Na2O,Continuous,Na2O,none,na20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +P2O5,Continuous,P2O5,none,p20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +S,Continuous,S,none,s20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +SiO2,Continuous,SiO2,none,si20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +N,Continuous,N,none,n20mar14.tif,,GeoChemPhys2,Mean,1,0,0, +HydrlCond,Continuous,HydrlCond,none,perm20mar14.tif,,GeoChemPhys3,Mean,1,0,0, +CompStrgth,Continuous,CompStrgth,none,ucs20mar14.tif,,GeoChemPhys4,Mean,1,0,0, +PctImp2001,Continuous,PctImp2001,none,NLCD_2001_Impervious_descriptor_L48_20190405.tif,,ImperviousSurfaces2001,Mean,1,0,0, +PctImp2006,Continuous,PctImp2006,none,NLCD_2006_Impervious_descriptor_L48_20190405.tif,,ImperviousSurfaces2006,Mean,1,0,0, +PctImp2011,Continuous,PctImp2011,none,NLCD_2011_Impervious_descriptor_L48_20190405.tif,,ImperviousSurfaces2011,Mean,1,0,0, +PctImp2016,Continuous,PctImp2016,none,NLCD_2016_Impervious_descriptor_L48_20190405.tif,,ImperviousSurfaces2016,Mean,1,0,0, +AgKffact,Continuous,AgKffact,none,AgKffact.tif,,Kffact,Mean,0.01,0,0, Kffact,Continuous,Kffact,none,kffact.tif,,Kffact,Mean,0.01,0,0, lith,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/Lithology_lookup.csv,none,us_lithology_1km_dd83.tif,,Lithology,Percent,1,0,0, -Manure,Continuous,Manure,none,manure.tif,,AgriculturalNitrogen,Mean,1,0,0, MercDep,Continuous,MercDep,none,Hg_dep_2011.tif,,MercDep,Mean,1,0,0, -MgO,Continuous,MgO,none,mgo20mar14.tif,,GeoChemPhys1,Mean,1,0,0, Mine,Point,MineDens,none,mines.shp,,Mines,Density,1,0,0, -MODIS_Ir_Ag_2002,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_02.tif,,,Percent,1,0,0, -MODIS_Ir_Ag_2007,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_07.tif,,,Percent,1,0,0, -MODIS_Ir_Ag_2012,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_12.tif,,,Percent,1,0,0, +MTBS_1984,Continuous,MTBS_1984,none,MTBS_1984.tif,,MTBS,Mean,100,0,0, +MTBS_1985,Continuous,MTBS_1985,none,MTBS_1985.tif,,MTBS,Mean,100,0,0, +MTBS_1986,Continuous,MTBS_1986,none,MTBS_1986.tif,,MTBS,Mean,100,0,0, +MTBS_1987,Continuous,MTBS_1987,none,MTBS_1987.tif,,MTBS,Mean,100,0,0, +MTBS_1988,Continuous,MTBS_1988,none,MTBS_1988.tif,,MTBS,Mean,100,0,0, +MTBS_1989,Continuous,MTBS_1989,none,MTBS_1989.tif,,MTBS,Mean,100,0,0, +MTBS_1990,Continuous,MTBS_1990,none,MTBS_1990.tif,,MTBS,Mean,100,0,0, +MTBS_1991,Continuous,MTBS_1991,none,MTBS_1991.tif,,MTBS,Mean,100,0,0, +MTBS_1992,Continuous,MTBS_1992,none,MTBS_1992.tif,,MTBS,Mean,100,0,0, +MTBS_1993,Continuous,MTBS_1993,none,MTBS_1993.tif,,MTBS,Mean,100,0,0, +MTBS_1994,Continuous,MTBS_1994,none,MTBS_1994.tif,,MTBS,Mean,100,0,0, +MTBS_1995,Continuous,MTBS_1995,none,MTBS_1995.tif,,MTBS,Mean,100,0,0, +MTBS_1996,Continuous,MTBS_1996,none,MTBS_1996.tif,,MTBS,Mean,100,0,0, +MTBS_1997,Continuous,MTBS_1997,none,MTBS_1997.tif,,MTBS,Mean,100,0,0, +MTBS_1998,Continuous,MTBS_1998,none,MTBS_1998.tif,,MTBS,Mean,100,0,0, +MTBS_1999,Continuous,MTBS_1999,none,MTBS_1999.tif,,MTBS,Mean,100,0,0, +MTBS_2000,Continuous,MTBS_2000,none,MTBS_2000.tif,,MTBS,Mean,100,0,0, +MTBS_2001,Continuous,MTBS_2001,none,MTBS_2001.tif,,MTBS,Mean,100,0,0, +MTBS_2002,Continuous,MTBS_2002,none,MTBS_2002.tif,,MTBS,Mean,100,0,0, +MTBS_2003,Continuous,MTBS_2003,none,MTBS_2003.tif,,MTBS,Mean,100,0,0, +MTBS_2004,Continuous,MTBS_2004,none,MTBS_2004.tif,,MTBS,Mean,100,0,0, +MTBS_2005,Continuous,MTBS_2005,none,MTBS_2005.tif,,MTBS,Mean,100,0,0, +MTBS_2006,Continuous,MTBS_2006,none,MTBS_2006.tif,,MTBS,Mean,100,0,0, +MTBS_2007,Continuous,MTBS_2007,none,MTBS_2007.tif,,MTBS,Mean,100,0,0, +MTBS_2008,Continuous,MTBS_2008,none,MTBS_2008.tif,,MTBS,Mean,100,0,0, +MTBS_2009,Continuous,MTBS_2009,none,MTBS_2009.tif,,MTBS,Mean,100,0,0, +MTBS_2010,Continuous,MTBS_2010,none,MTBS_2010.tif,,MTBS,Mean,100,0,0, +MTBS_2011,Continuous,MTBS_2011,none,MTBS_2011.tif,,MTBS,Mean,100,0,0, +MTBS_2012,Continuous,MTBS_2012,none,MTBS_2012.tif,,MTBS,Mean,100,0,0, +MTBS_2013,Continuous,MTBS_2013,none,MTBS_2013.tif,,MTBS,Mean,100,0,0, +MTBS_2014,Continuous,MTBS_2014,none,MTBS_2014.tif,,MTBS,Mean,100,0,0, +MTBS_2015,Continuous,MTBS_2015,none,MTBS_2015.tif,,MTBS,Mean,100,0,0, +MTBS_2016,Continuous,MTBS_2016,none,MTBS_2016.tif,,MTBS,Mean,100,0,0, +MTBS_2017,Continuous,MTBS_2017,none,MTBS_2017.tif,,MTBS,Mean,100,0,0, +MTBS_2018,Continuous,MTBS_2018,none,MTBS_2018.tif,,MTBS,Mean,100,0,0, MTBS_Severity_1984,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1984.tif,,MTBS_Severity_1984,Percent,1,0,0, MTBS_Severity_1985,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1985.tif,,MTBS_Severity_1985,Percent,1,0,0, MTBS_Severity_1986,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_1986.tif,,MTBS_Severity_1986,Percent,1,0,0, @@ -73,15 +115,23 @@ MTBS_Severity_2013,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/Stre MTBS_Severity_2014,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2014.tif,,MTBS_Severity_2014,Percent,1,0,0, MTBS_Severity_2015,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2015.tif,,MTBS_Severity_2015,Percent,1,0,0, MTBS_Severity_2016,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2016.tif,,MTBS_Severity_2016,Percent,1,0,0, -N,Continuous,N,none,n20mar14.tif,,GeoChemPhys2,Mean,1,0,0, -Na2O,Continuous,Na2O,none,na20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +MTBS_Severity_2017,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2017.tif,,MTBS_Severity_2017,Percent,1,0,0, +MTBS_Severity_2018,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MTBS_severity_lookup.csv,none,MTBS_Severity_2018.tif,,MTBS_Severity_2018,Percent,1,0,0, NABD,Point,NABD_Dens,none,NABD.shp,NIDStorM3;NrmStorM3,NABD,Density,1,0,0, +InorgNWetDep_2008,Continuous,InorgNWetDep_2008,none,dep_totalN_2008.tif,,NADP,Mean,1,0,0, NH4_2008,Continuous,NH4_2008,none,dep_nh4_2008.tif,,NADP,Mean,1,0,0, +NO3_2008,Continuous,NO3_2008,none,dep_no3_2008.tif,,NADP,Mean,1,0,0, +SN_2008,Continuous,SN_2008,none,dep_splusn_2008.tif,,NADP,Mean,1,0,0, NH4_2014,Continuous,NH4_2014,none,NH4_dep_2014.tif,,NADP_2014_2018,Mean,1,0,0, NH4_2015,Continuous,NH4_2015,none,NH4_dep_2015.tif,,NADP_2014_2018,Mean,1,0,0, NH4_2016,Continuous,NH4_2016,none,NH4_dep_2016.tif,,NADP_2014_2018,Mean,1,0,0, NH4_2017,Continuous,NH4_2017,none,NH4_dep_2017.tif,,NADP_2014_2018,Mean,1,0,0, NH4_2018,Continuous,NH4_2018,none,NH4_dep_2018.tif,,NADP_2014_2018,Mean,1,0,0, +NO3_2014,Continuous,NO3_2014,none,NO3_dep_2014.tif,,NADP_2014_2018,Mean,1,0,0, +NO3_2015,Continuous,NO3_2015,none,NO3_dep_2015.tif,,NADP_2014_2018,Mean,1,0,0, +NO3_2016,Continuous,NO3_2016,none,NO3_dep_2016.tif,,NADP_2014_2018,Mean,1,0,0, +NO3_2017,Continuous,NO3_2017,none,NO3_dep_2017.tif,,NADP_2014_2018,Mean,1,0,0, +NO3_2018,Continuous,NO3_2018,none,NO3_dep_2018.tif,,NADP_2014_2018,Mean,1,0,0, nlcd2001,Categorical,lookup/NLCD2001_lookup.csv,none,NLCD_2001_Land_Cover_L48_20190424.tif,,NLCD2001,Percent,1,0,0, nlcd2004,Categorical,lookup/NLCD2004_lookup.csv,none,NLCD_2004_Land_Cover_L48_20190424.tif,,NLCD2004,Percent,1,0,0, nlcd2006,Categorical,lookup/NLCD2006_lookup.csv,none,NLCD_2006_Land_Cover_L48_20190424.tif,,NLCD2006,Percent,1,0,0, @@ -89,56 +139,43 @@ nlcd2008,Categorical,lookup/NLCD2008_lookup.csv,none,NLCD_2008_Land_Cover_L48_20 nlcd2011,Categorical,lookup/NLCD2011_lookup.csv,none,NLCD_2011_Land_Cover_L48_20190424.tif,,NLCD2011,Percent,1,0,0, nlcd2013,Categorical,lookup/NLCD2013_lookup.csv,none,NLCD_2013_Land_Cover_L48_20190424.tif,,NLCD2013,Percent,1,0,0, nlcd2016,Categorical,lookup/NLCD2016_lookup.csv,none,NLCD_2016_Land_Cover_L48_20190424.tif,,NLCD2016,Percent,1,0,0, -NO3_2008,Continuous,NO3_2008,none,dep_no3_2008.tif,,NADP,Mean,1,0,0, -NO3_2014,Continuous,NO3_2014,none,NO3_dep_2014.tif,,NADP_2014_2018,Mean,1,0,0, -NO3_2015,Continuous,NO3_2015,none,NO3_dep_2015.tif,,NADP_2014_2018,Mean,1,0,0, -NO3_2016,Continuous,NO3_2016,none,NO3_dep_2016.tif,,NADP_2014_2018,Mean,1,0,0, -NO3_2017,Continuous,NO3_2017,none,NO3_dep_2017.tif,,NADP_2014_2018,Mean,1,0,0, -NO3_2018,Continuous,NO3_2018,none,NO3_dep_2018.tif,,NADP_2014_2018,Mean,1,0,0, -NPDES,Point,NPDESDens,none,NPDES_Major.shp,,EPA_FRS,Density,1,0,0, -Om,Continuous,Om,none,om.tif,,STATSGO_Set2,Mean,0.01,0,0, -P2O5,Continuous,P2O5,none,p20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -PADUS,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/GAP_Status_lookup.csv,none,gap_sts.tif,,PADUS,Percent,1,0,0, -PctFrstLossByYear,Categorical,L:/Priv/CORFiles/Geospatial_Library/Data/Project/StreamCat/ControlTables/ForestLossByYear_lookup.csv,none,lossyr.tif,,ForestLossByYear0013,Percent,1,0,0, -PctImp2001,Continuous,PctImp2001,none,NLCD_2001_Impervious_descriptor_L48_20190405.tif,,ImperviousSurfaces2001,Mean,1,0,0, -PctImp2006,Continuous,PctImp2006,none,NLCD_2006_Impervious_descriptor_L48_20190405.tif,,ImperviousSurfaces2006,Mean,1,0,0, -PctImp2011,Continuous,PctImp2011,none,NLCD_2011_Impervious_descriptor_L48_20190405.tif,,ImperviousSurfaces2011,Mean,1,0,0, -PctImp2016,Continuous,PctImp2016,none,NLCD_2016_Impervious_descriptor_L48_20190405.tif,,ImperviousSurfaces2016,Mean,1,0,0, PctNonAgIntrodManagVeg,Continuous,PctNonAgIntrodManagVeg,none,IntrodManagVeg.tif,,NonAgIntrodManagVeg,Mean,100,0,0, -PCVPY_2017,Continuous,PCVPY_2017,none,PCVPY.tif,,PRISM_2017,Mean,1,0,0, -Perm,Continuous,Perm,none,perm.tif,,STATSGO_Set2,Mean,0.01,0,0, +PADUS,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/GAP_Status_lookup.csv,none,gap_sts.tif,,PADUS,Percent,1,0,0, Pestic97,Continuous,Pestic97,none,pestic.tif,,Pesticides97,Mean,1,0,0, -PIP_2017,Continuous,PIP_2017,none,PIP.tif,,PRISM_2017,Mean,1,0,0, -PopDen2010,Continuous,PopDen2010,none,POP_SQKM.tif,,USCensus2010,Mean,1,0,0, -precip,Continuous,Precip8110,none,precip.tif,,PRISM_1981_2010,Mean,1,0,0, Precip_Minus_EVT,Continuous,Precip_Minus_EVT,none,USAavgPeriod_pptSurp_1994to2016.tif,,Precip_Minus_EVT,Mean,1,0,0, PRISMppt_2008,Continuous,Precip08,none,PRISMppt_2008.tif,,PRISM_0809,Mean,1,0,0, PRISMppt_2009,Continuous,Precip09,none,PRISMppt_2009.tif,,PRISM_0809,Mean,1,0,0, PRISMtmean_2008,Continuous,Tmean08,none,PRISMtmean_2008.tif,,PRISM_0809,Mean,1,0,0, PRISMtmean_2009,Continuous,Tmean09,none,PRISMtmean_2009.tif,,PRISM_0809,Mean,1,0,0, +precip,Continuous,Precip8110,none,precip.tif,,PRISM_1981_2010,Mean,1,0,0, +tmax,Continuous,Tmax8110,none,tmax.tif,,PRISM_1981_2010,Mean,1,0,0, +tmean,Continuous,Tmean8110,none,tmean.tif,,PRISM_1981_2010,Mean,1,0,0, +tmin,Continuous,Tmin8110,none,tmin.tif,,PRISM_1981_2010,Mean,1,0,0, +PCVPY_2017,Continuous,PCVPY_2017,none,PCVPY.tif,,PRISM_2017,Mean,1,0,0, +PIP_2017,Continuous,PIP_2017,none,PIP.tif,,PRISM_2017,Mean,1,0,0, PSUM6_2017,Continuous,PSUM6_2017,none,PSUM6.tif,,PRISM_2017,Mean,1,0,0, PSUMPY_2017,Continuous,PSUMPY_2017,none,PSUMPY.tif,,PRISM_2017,Mean,1,0,0, -Rckdep,Continuous,Rckdep,none,rckdep.tif,,STATSGO_Set2,Mean,0.01,0,0, -RdCrs,Continuous,RdCrs,none,rdstcrs.tif,,RoadStreamCrossings,Density,1,0,0, +TIP_2017,Continuous,PIP_2017,none,TIP.tif,,PRISM_2017,Mean,1,0,0, +TMEANPW_2017,Continuous,TMEANPW_2017,none,TMEANPW.tif,,PRISM_2017,Mean,1,0,0, +TMEANPY_2017,Continuous,TMEANPY_2017,none,TMEANPY.tif,,PRISM_2017,Mean,1,0,0, RdDens,Continuous,RdDens,none,roadden.tif,,RoadDensity,Mean,1,0,0, +RdCrs,Continuous,RdCrs,none,rdstcrs.tif,,RoadStreamCrossings,Density,1,0,0, RockN,Continuous,RockN,none,RockN_USA_USGSproj_1km_kgkm2.tif,,RockN,Mean,1,0,0, Runoff,Continuous,Runoff,none,runoff.tif,,Runoff,Mean,1,0,0, -S,Continuous,S,none,s20mar14.tif,,GeoChemPhys1,Mean,1,0,0, +Clay,Continuous,Clay,none,clay.tif,,STATSGO_Set1,Mean,0.01,0,0, Sand,Continuous,Sand,none,sand.tif,,STATSGO_Set1,Mean,0.01,0,0, -SiO2,Continuous,SiO2,none,si20mar14.tif,,GeoChemPhys1,Mean,1,0,0, -SN_2008,Continuous,SN_2008,none,dep_splusn_2008.tif,,NADP,Mean,1,0,0, -Superfund,Point,SuperfundDens,none,Superfund.shp,,EPA_FRS,Density,1,0,0, +Om,Continuous,Om,none,om.tif,,STATSGO_Set2,Mean,0.01,0,0, +Perm,Continuous,Perm,none,perm.tif,,STATSGO_Set2,Mean,0.01,0,0, +Rckdep,Continuous,Rckdep,none,rckdep.tif,,STATSGO_Set2,Mean,0.01,0,0, +WtDep,Continuous,WtDep,none,wtdep.tif,,STATSGO_Set2,Mean,0.01,0,0, sw_flux,Continuous,sw_flux,none,TN_load_px.tif,,sw_flux,Mean,1,0,0, -TIP_2017,Continuous,PIP_2017,none,TIP.tif,,PRISM_2017,Mean,1,0,0, -tmax,Continuous,Tmax8110,none,tmax.tif,,PRISM_1981_2010,Mean,1,0,0, -tmean,Continuous,Tmean8110,none,tmean.tif,,PRISM_1981_2010,Mean,1,0,0, -TMEANPW_2017,Continuous,TMEANPW_2017,none,TMEANPW.tif,,PRISM_2017,Mean,1,0,0, -TMEANPY_2017,Continuous,TMEANPY_2017,none,TMEANPY.tif,,PRISM_2017,Mean,1,0,0, -tmin,Continuous,Tmin8110,none,tmin.tif,,PRISM_1981_2010,Mean,1,0,0, -TRI,Point,TRIDens,none,TRI.shp,,EPA_FRS,Density,1,0,0, US_Level_III_Ecoregions,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/US_Level_III_Ecoregions_lookup.csv,none,US_Level_III_Ecoregions.tif,,US_Level_III_Ecoregions,Percent,1,0,0, +HUDen2010,Continuous,HUDen2010,none,HU_SQKM.tif,,USCensus2010,Mean,1,0,0, +PopDen2010,Continuous,PopDen2010,none,POP_SQKM.tif,,USCensus2010,Mean,1,0,0, WetnessIndex,Continuous,WetIndex,none,cti_v3.tif,,WetIndx,Mean,1,0,0, -WtDep,Continuous,WtDep,none,wtdep.tif,,STATSGO_Set2,Mean,0.01,0,0, WWTPAll,Point,WWTPAllDens,none,WWTP_All_CWA_Active_2013_CONUS.shp,,WWTP,Density,1,0,0, WWTPMajor,Point,WWTPMajorDens,none,WWTP_Major_CWA_Active_2013_CONUS.shp,,WWTP,Density,1,0,0, WWTPMinor,Point,WWTPMinorDens,none,WWTP_Minor_CWA_Active_2013_CONUS.shp,,WWTP,Density,1,0,0, +MODIS_Ir_Ag_2002,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_02.tif,,,Percent,1,0,0, +MODIS_Ir_Ag_2007,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_07.tif,,,Percent,1,0,0, +MODIS_Ir_Ag_2012,Categorical,L:/Priv/CORFiles/Geospatial_Library_Projects/StreamCat/ControlTables/MODIS_IrAg_lookup.csv,none,mirad250_12.tif,,,Percent,1,0,0,