376
376
}
377
377
}
378
378
}
379
+ }
380
+ }
381
+ },
382
+ "intermediate" : {
383
+ "type" : "directory" ,
384
+ "contents" : {
385
+ "clipped_lulc.tif" : {
386
+ "about" : "Aligned and clipped copy of LULC input." ,
387
+ "bands" : {1 : {"type" : "integer" }}
379
388
},
380
- "intermediate" : {
381
- "type" : "directory" ,
382
- "contents" : {
383
- "clipped_lulc.tif" : {
384
- "about" : "Aligned and clipped copy of LULC input." ,
385
- "bands" : {1 : {"type" : "integer" }}
386
- },
387
- "depth_to_root_rest_layer.tif" : {
388
- "about" : (
389
- "Aligned and clipped copy of root restricting "
390
- "layer depth input." ),
391
- "bands" : {
392
- 1 : {"type" : "number" , "units" : u .millimeter }
393
- }
394
- },
395
- "eto.tif" : {
396
- "about" : "Aligned and clipped copy of ET0 input." ,
397
- "bands" : {
398
- 1 : {"type" : "number" , "units" : u .millimeter }
399
- }
400
- },
401
- "kc_raster.tif" : {
402
- "about" : "Map of KC values." ,
403
- "bands" : {
404
- 1 : {"type" : "number" , "units" : u .none }
405
- }
406
- },
407
- "pawc.tif" : {
408
- "about" : "Aligned and clipped copy of PAWC input." ,
409
- "bands" : {1 : {"type" : "ratio" }},
410
- },
411
- "pet.tif" : {
412
- "about" : "Map of potential evapotranspiration." ,
413
- "bands" : {
414
- 1 : {"type" : "number" , "units" : u .millimeter }
415
- }
416
- },
417
- "precip.tif" : {
418
- "about" : "Aligned and clipped copy of precipitation input." ,
419
- "bands" : {
420
- 1 : {"type" : "number" , "units" : u .millimeter }
421
- }
422
- },
423
- "root_depth.tif" : {
424
- "about" : "Map of root depth." ,
425
- "bands" : {
426
- 1 : {"type" : "number" , "units" : u .millimeter }
427
- }
428
- },
429
- "veg.tif" : {
430
- "about" : "Map of vegetated state." ,
431
- "bands" : {1 : {"type" : "integer" }},
432
- }
389
+ "depth_to_root_rest_layer.tif" : {
390
+ "about" : (
391
+ "Aligned and clipped copy of root restricting "
392
+ "layer depth input." ),
393
+ "bands" : {
394
+ 1 : {"type" : "number" , "units" : u .millimeter }
395
+ }
396
+ },
397
+ "eto.tif" : {
398
+ "about" : "Aligned and clipped copy of ET0 input." ,
399
+ "bands" : {
400
+ 1 : {"type" : "number" , "units" : u .millimeter }
433
401
}
402
+ },
403
+ "kc_raster.tif" : {
404
+ "about" : "Map of KC values." ,
405
+ "bands" : {
406
+ 1 : {"type" : "number" , "units" : u .none }
407
+ }
408
+ },
409
+ "pawc.tif" : {
410
+ "about" : "Aligned and clipped copy of PAWC input." ,
411
+ "bands" : {1 : {"type" : "ratio" }},
412
+ },
413
+ "pet.tif" : {
414
+ "about" : "Map of potential evapotranspiration." ,
415
+ "bands" : {
416
+ 1 : {"type" : "number" , "units" : u .millimeter }
417
+ }
418
+ },
419
+ "precip.tif" : {
420
+ "about" : "Aligned and clipped copy of precipitation input." ,
421
+ "bands" : {
422
+ 1 : {"type" : "number" , "units" : u .millimeter }
423
+ }
424
+ },
425
+ "root_depth.tif" : {
426
+ "about" : "Map of root depth." ,
427
+ "bands" : {
428
+ 1 : {"type" : "number" , "units" : u .millimeter }
429
+ }
430
+ },
431
+ "veg.tif" : {
432
+ "about" : "Map of vegetated state." ,
433
+ "bands" : {1 : {"type" : "integer" }},
434
434
}
435
435
}
436
436
},
@@ -576,8 +576,12 @@ def execute(args):
576
576
wyield_path = os .path .join (
577
577
per_pixel_output_dir , f'wyield{ file_suffix } .tif' )
578
578
aet_path = os .path .join (per_pixel_output_dir , f'aet{ file_suffix } .tif' )
579
-
580
579
demand_path = os .path .join (intermediate_dir , f'demand{ file_suffix } .tif' )
580
+ veg_raster_path = os .path .join (intermediate_dir , f'veg{ file_suffix } .tif' )
581
+ root_raster_path = os .path .join (
582
+ intermediate_dir , f'root_depth{ file_suffix } .tif' )
583
+ kc_raster_path = os .path .join (
584
+ intermediate_dir , f'kc_raster{ file_suffix } .tif' )
581
585
582
586
watersheds_path = args ['watersheds_path' ]
583
587
watershed_results_vector_path = os .path .join (
@@ -694,39 +698,35 @@ def execute(args):
694
698
'table_name' : 'Biophysical' }
695
699
# Create Kc raster from table values to use in future calculations
696
700
LOGGER .info ("Reclassifying temp_Kc raster" )
697
- tmp_Kc_raster_path = os .path .join (intermediate_dir , 'kc_raster.tif' )
698
701
create_Kc_raster_task = graph .add_task (
699
702
func = utils .reclassify_raster ,
700
- args = ((clipped_lulc_path , 1 ), Kc_dict , tmp_Kc_raster_path ,
703
+ args = ((clipped_lulc_path , 1 ), Kc_dict , kc_raster_path ,
701
704
gdal .GDT_Float32 , nodata_dict ['out_nodata' ],
702
705
reclass_error_details ),
703
- target_path_list = [tmp_Kc_raster_path ],
706
+ target_path_list = [kc_raster_path ],
704
707
dependent_task_list = [align_raster_stack_task ],
705
708
task_name = 'create_Kc_raster' )
706
709
707
710
# Create root raster from table values to use in future calculations
708
711
LOGGER .info ("Reclassifying tmp_root raster" )
709
- tmp_root_raster_path = os .path .join (
710
- intermediate_dir , 'root_depth.tif' )
711
712
create_root_raster_task = graph .add_task (
712
713
func = utils .reclassify_raster ,
713
- args = ((clipped_lulc_path , 1 ), root_dict , tmp_root_raster_path ,
714
+ args = ((clipped_lulc_path , 1 ), root_dict , root_raster_path ,
714
715
gdal .GDT_Float32 , nodata_dict ['out_nodata' ],
715
716
reclass_error_details ),
716
- target_path_list = [tmp_root_raster_path ],
717
+ target_path_list = [root_raster_path ],
717
718
dependent_task_list = [align_raster_stack_task ],
718
719
task_name = 'create_root_raster' )
719
720
720
721
# Create veg raster from table values to use in future calculations
721
722
# of determining which AET equation to use
722
723
LOGGER .info ("Reclassifying tmp_veg raster" )
723
- tmp_veg_raster_path = os .path .join (intermediate_dir , 'veg.tif' )
724
724
create_veg_raster_task = graph .add_task (
725
725
func = utils .reclassify_raster ,
726
- args = ((clipped_lulc_path , 1 ), vegetated_dict , tmp_veg_raster_path ,
726
+ args = ((clipped_lulc_path , 1 ), vegetated_dict , veg_raster_path ,
727
727
gdal .GDT_Float32 , nodata_dict ['out_nodata' ],
728
728
reclass_error_details ),
729
- target_path_list = [tmp_veg_raster_path ],
729
+ target_path_list = [veg_raster_path ],
730
730
dependent_task_list = [align_raster_stack_task ],
731
731
task_name = 'create_veg_raster' )
732
732
@@ -737,7 +737,7 @@ def execute(args):
737
737
func = pygeoprocessing .raster_map ,
738
738
kwargs = dict (
739
739
op = numpy .multiply , # PET = ET0 * KC
740
- rasters = [eto_path , tmp_Kc_raster_path ],
740
+ rasters = [eto_path , kc_raster_path ],
741
741
target_path = tmp_pet_path ,
742
742
target_nodata = nodata_dict ['out_nodata' ]),
743
743
target_path_list = [tmp_pet_path ],
@@ -747,8 +747,8 @@ def execute(args):
747
747
748
748
# List of rasters to pass into the vectorized fractp operation
749
749
raster_list = [
750
- tmp_Kc_raster_path , eto_path , precip_path , tmp_root_raster_path ,
751
- depth_to_root_rest_layer_path , pawc_path , tmp_veg_raster_path ]
750
+ kc_raster_path , eto_path , precip_path , root_raster_path ,
751
+ depth_to_root_rest_layer_path , pawc_path , veg_raster_path ]
752
752
753
753
LOGGER .debug ('Performing fractp operation' )
754
754
calculate_fractp_task = graph .add_task (
0 commit comments