Skip to content

Commit

Permalink
Updated the layer files with correct catalog names. Also refactored s…
Browse files Browse the repository at this point in the history
…ome of the layer files; flux model contextual layers all start with the same string so they're together. Ready to test locally.
  • Loading branch information
dagibbs22 committed Dec 4, 2023
1 parent 5033f94 commit 0d1cdd8
Show file tree
Hide file tree
Showing 36 changed files with 269 additions and 162 deletions.
4 changes: 4 additions & 0 deletions src/main/resources/raster-catalog-default.json
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@
{
"name":"gfw_forest_flux_gross_emissions_node_codes",
"source_uri": "s3://gfw-data-lake/gfw_forest_flux_gross_emissions_node_codes/v20231114/raster/epsg-4326/{grid_size}/{row_count}/category/geotiff/{tile_id}.tif"
},
{
"name":"gfw_forest_flux_planted_forest_type",
"source_uri": "s3://gfw-data-lake/gfw_planted_forests/v20230911/raster/epsg-4326/{grid_size}/{row_count}/simpleName/geotiff/{tile_id}.tif"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.globalforestwatch.layers
import org.globalforestwatch.grids.GridTile

case class AbovegroundBiomass2000(gridTile: GridTile, kwargs: Map[String, Any]) extends DoubleLayer with OptionalDLayer {

val datasetName = "whrc_aboveground_biomass_density_2000"
val uri: String = uriForGrid(gridTile, kwargs)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ case class AbovegroundCarbon2000(gridTile: GridTile, model: String = "standard",
extends FloatLayer
with OptionalFLayer {

val datasetName = "gfw_aboveground_carbon"
val datasetName = "gfw_aboveground_carbon_stock_2000"

val uri: String =
uriForGrid(gridTile, kwargs)


// // For carbonflux package run only
// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"
//
// val model_suffix: String = if (model == "standard") "standard" else s"$model"
// val uri: String =
// s"s3://gfw-files/flux_1_2_3/agc_2000/$model_suffix/${gridTile.tileId}.tif"
// s"s3://gfw-data-lake/gfw_aboveground_carbon_stock_2000/v20230222/raster/epsg-4326/{grid_size}/{row_count}/Mg_C_ha-1/geotiff/{tile_id}.tif"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ case class AbovegroundCarbonEmisYear(gridTile: GridTile, model: String = "standa
extends FloatLayer
with OptionalFLayer {

val datasetName = "Na"
val datasetName = "gfw_forest_flux_aboveground_carbon_stock_in_emissions_year"

val model_suffix: String = if (model == "standard") "standard" else s"$model"
val uri: String =
s"s3://gfw-files/flux_1_2_3/agc_emis_year/$model_suffix/${gridTile.tileId}.tif"
uriForGrid(gridTile, kwargs)

// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"

// val model_suffix: String = if (model == "standard") "standard" else s"$model"
// val uri: String =
// s"s3://gfw-data-lake/gfw_forest_flux_aboveground_carbon_stock_in_emissions_year/v20231114/raster/epsg-4326/{grid_size}/{row_count}/Mg_C_ha-1/geotiff/{tile_id}.tif"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ case class AnnualAbovegroundRemovalFactorCarbon(gridTile: GridTile, model: Strin
extends FloatLayer
with OptionalFLayer {

val datasetName = "Na"
val datasetName = "gfw_forest_flux_full_extent_removal_factor_aboveground"

val model_suffix: String = if (model == "standard") "standard" else s"$model"
val uri: String =
s"s3://gfw-files/flux_1_2_3/annual_removal_factor_AGC_all_forest_types/$model_suffix/${gridTile.tileId}.tif"
uriForGrid(gridTile, kwargs)

// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"
//
// val model_suffix: String = if (model == "standard") "standard" else s"$model"
// val uri: String =
// s"s3://gfw-data-lake/gfw_forest_flux_full_extent_removal_factor_aboveground/v20231114/raster/epsg-4326/{grid_size}/{row_count}/Mg_C_ha-1_yr-1/geotiff/{tile_id}.tif"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ case class AnnualBelowgroundRemovalFactorCarbon(gridTile: GridTile, model: Strin
extends FloatLayer
with OptionalFLayer {

val datasetName = "Na"
val datasetName = "gfw_forest_flux_full_extent_removal_factor_belowground"

val model_suffix: String = if (model == "standard") "standard" else s"$model"
val uri: String =
s"s3://gfw-files/flux_1_2_3/annual_removal_factor_BGC_all_forest_types/$model_suffix/${gridTile.tileId}.tif"
uriForGrid(gridTile, kwargs)

// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"
// val model_suffix: String = if (model == "standard") "standard" else s"$model"
// val uri: String =
// s"s3://gfw-data-lake/gfw_forest_flux_full_extent_removal_factor_belowground/v20231114/raster/epsg-4326/{grid_size}/{row_count}/Mg_C_ha-1_yr-1/geotiff/{tile_id}.tif"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ case class BelowgroundCarbon2000(gridTile: GridTile, model: String = "standard",
extends FloatLayer
with OptionalFLayer {

val datasetName = "gfw_belowground_carbon"
val datasetName = "gfw_belowground_carbon_stock_2000"

val uri: String =
uriForGrid(gridTile, kwargs)


// // For carbonflux package run only
// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"
//
// val model_suffix: String = if (model == "standard") "standard" else s"$model"
// val uri: String =
// s"s3://gfw-files/flux_1_2_3/bgc_2000/$model_suffix/${gridTile.tileId}.tif"
// s"s3://gfw-data-lake/gfw_belowground_carbon_stock_2000/v20230222/raster/epsg-4326/{grid_size}/{row_count}/Mg_C_ha-1/geotiff/{tile_id}.tif"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ case class BelowgroundCarbonEmisYear(gridTile: GridTile, model: String = "standa
extends FloatLayer
with OptionalFLayer {

val datasetName = "Na"
val datasetName = "gfw_forest_flux_belowground_carbon_stock_in_emissions_year"

val model_suffix: String = if (model == "standard") "standard" else s"$model"
val uri: String =
s"s3://gfw-files/flux_1_2_3/bgc_emis_year/$model_suffix/${gridTile.tileId}.tif"
uriForGrid(gridTile, kwargs)

// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"
// val model_suffix: String = if (model == "standard") "standard" else s"$model"
// val uri: String =
// s"s3://gfw-data-lake/gfw_forest_flux_belowground_carbon_stock_in_emissions_year/v20231114/raster/epsg-4326/{grid_size}/{row_count}/Mg_C_ha-1/geotiff/{tile_id}.tif"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ case class DeadwoodCarbon2000(gridTile: GridTile, model: String = "standard", kw
extends FloatLayer
with OptionalFLayer {

// val datasetName = "gfw_deadwood_carbon"
//
// val uri: String =
// uriForGrid(gridTile, kwargs)
val datasetName = "gfw_deadwood_carbon_stock_2000"

val uri: String =
uriForGrid(gridTile, kwargs)

// For carbonflux package run only
val datasetName = "Na"

val model_suffix: String = if (model == "standard") "standard" else s"$model"
val uri: String =
s"s3://gfw-files/flux_1_2_3/deadwood_carbon_2000/$model_suffix/${gridTile.tileId}.tif"
// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"
//
// val model_suffix: String = if (model == "standard") "standard" else s"$model"
// val uri: String =
// s"s3://gfw-data-lake/gfw_deadwood_carbon_stock_2000/v20230222/raster/epsg-4326/{grid_size}/{row_count}/Mg_C_ha-1/geotiff/{tile_id}.tif"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ case class DeadwoodCarbonEmisYear(gridTile: GridTile, model: String = "standard"
extends FloatLayer
with OptionalFLayer {

val datasetName = "Na"
val datasetName = "gfw_forest_flux_deadwood_carbon_stock_in_emissions_year"

val model_suffix: String = if (model == "standard") "standard" else s"$model"
val uri: String =
s"s3://gfw-files/flux_1_2_3/deadwood_emis_year/$model_suffix/${gridTile.tileId}.tif"
uriForGrid(gridTile, kwargs)

// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"
// val model_suffix: String = if (model == "standard") "standard" else s"$model"
// val uri: String =
// s"s3://gfw-data-lake/gfw_forest_flux_deadwood_carbon_stock_in_emissions_year/v20231114/raster/epsg-4326/{grid_size}/{row_count}/Mg_C_ha-1/geotiff/{tile_id}.tif"
}
14 changes: 0 additions & 14 deletions src/main/scala/org/globalforestwatch/layers/FluxModelExtent.scala

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.globalforestwatch.layers

import org.globalforestwatch.grids.GridTile

case class ForestFluxModelAgeCategory(gridTile: GridTile, model: String = "standard", kwargs: Map[String, Any])
extends StringLayer
with OptionalILayer {

val datasetName = "gfw_forest_flux_forest_age_category"

val uri: String =
uriForGrid(gridTile, kwargs)


// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"
//
// val model_suffix: String = if (model == "standard") "standard" else s"$model"
// val uri: String =
// s"s3://gfw-data-lake/gfw_forest_flux_forest_age_category/v20231114/raster/epsg-4326/{grid_size}/{row_count}/ageCategory/geotiff/{tile_id}.tif"

override val externalNoDataValue = "Not applicable"

def lookup(value: Int): String = value match {
case 1 => "Secondary forest <=20 years"
case 2 => "Secondary forest >20 years"
case 3 => "Primary forest"
case _ => "Unknown"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.globalforestwatch.layers

import org.globalforestwatch.grids.GridTile

case class ForestFluxModelExtent(gridTile: GridTile, model: String = "standard", kwargs: Map[String, Any])
extends BooleanLayer
with OptionalILayer {

val datasetName = "gfw_forest_flux_model_extent"

val uri: String =
uriForGrid(gridTile, kwargs)


// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"
//
// val model_suffix: String = if (model == "standard") "standard" else s"$model"
// val uri: String =
// s"s3://gfw-data-lake/gfw_forest_flux_model_extent/v20231114/raster/epsg-4326/{grid_size}/{row_count}/ha/geotiff/{tile_id}.tif"
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
package org.globalforestwatch.layers

import org.globalforestwatch.grids.GridTile

case class GrossEmissionsNodeCodes(gridTile: GridTile, model: String = "standard", kwargs: Map[String, Any])
case class ForestFluxModelGrossEmissionsNodeCodes(gridTile: GridTile, model: String = "standard", kwargs: Map[String, Any])
extends StringLayer
with OptionalILayer {

val datasetName = "Na"
val datasetName = "gfw_forest_flux_gross_emissions_node_codes"

val model_suffix: String = if (model == "standard") "standard" else s"$model"
val uri: String =
s"s3://gfw-files/flux_1_2_3/gross_emissions_node_codes/$model_suffix/${gridTile.tileId}.tif"
uriForGrid(gridTile, kwargs)

// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"
//
// val model_suffix: String = if (model == "standard") "standard" else s"$model"
// val uri: String =
// s"s3://gfw-data-lake/gfw_forest_flux_gross_emissions_node_codes/v20231114/raster/epsg-4326/{grid_size}/{row_count}/category/geotiff/{tile_id}.tif"

override val externalNoDataValue = "Not applicable"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.globalforestwatch.layers

import org.globalforestwatch.grids.GridTile

case class ForestFluxModelPlantedForestType(gridTile: GridTile, kwargs: Map[String, Any])
extends StringLayer
with OptionalILayer {

val datasetName = "gfw_forest_flux_planted_forest_type"

val uri: String =
uriForGrid(gridTile, kwargs)


// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"
//
// val model_suffix: String = if (model == "standard") "standard" else s"$model"
//// val uri: String =
//// s"s3://gfw-data-lake/gfw_planted_forests/v20230911/raster/epsg-4326/{grid_size}/{row_count}/simpleName/geotiff/{tile_id}.tif"

override val externalNoDataValue = "Not applicable"

def lookup(value: Int): String = value match {
case 1 => "Oil palm"
case 2 => "Wood fiber"
case 3 => "Other"
case _ => "Unknown"
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
package org.globalforestwatch.layers

import org.globalforestwatch.grids.GridTile

case class RemovalForestType(gridTile: GridTile, model: String = "standard", kwargs: Map[String, Any])
case class ForestFluxModelRemovalForestType(gridTile: GridTile, model: String = "standard", kwargs: Map[String, Any])
extends StringLayer
with OptionalILayer {

val datasetName = "Na"

val model_suffix: String = if (model == "standard") "standard" else s"$model"
val datasetName = "gfw_forest_flux_removal_forest_type"

val uri: String =
s"s3://gfw-files/flux_1_2_3/removal_forest_type/$model_suffix/${gridTile.tileId}.tif"
uriForGrid(gridTile, kwargs)


// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"
//
// val model_suffix: String = if (model == "standard") "standard" else s"$model"
//// val uri: String =
//// s"s3://gfw-data-lake/gfw_forest_flux_removal_forest_type/v20231114/v20231114/raster/epsg-4326/{grid_size}/{row_count}/source/geotiff/{tile_id}.tif"

override val externalNoDataValue = "Not applicable"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ case class GrossCumulAbovegroundRemovalsCo2(gridTile: GridTile, model: String =
extends FloatLayer
with OptionalFLayer {

val datasetName = "gfw_full_extent_aboveground_gross_removals"
val datasetName = "gfw_forest_flux_full_extent_gross_removals_aboveground"

val uri: String =
uriForGrid(gridTile, kwargs)

// // For carbonflux package run only

// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"
//
// val model_suffix: String = if (model == "standard") "standard" else s"$model"
// val uri: String =
// s"s3://gfw-files/flux_1_2_3/gross_removals_AGCO2_all_forest_types/$model_suffix/${gridTile.tileId}.tif"
// s"s3://gfw-data-lake/gfw_forest_flux_full_extent_gross_removals_aboveground/v20231114/raster/epsg-4326/{grid_size}/{row_count}/Mg_CO2_ha-1/geotiff/{tile_id}.tif"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ case class GrossCumulBelowgroundRemovalsCo2(gridTile: GridTile, model: String =
extends FloatLayer
with OptionalFLayer {

val datasetName = "gfw_full_extent_belowground_gross_removals"
val datasetName = "gfw_forest_flux_full_extent_gross_removals_belowground"

val uri: String =
uriForGrid(gridTile, kwargs)


// // For carbonflux package run only
// // For carbon_sensitivity run only (but not currently functional)
// val datasetName = "Na"
//
// val model_suffix: String = if (model == "standard") "standard" else s"$model"
// val uri: String =
// s"s3://gfw-files/flux_1_2_3/gross_removals_BGCO2_all_forest_types/$model_suffix/${gridTile.tileId}.tif"
// s"s3://gfw-data-lake/gfw_forest_flux_full_extent_gross_removals_belowground/v20231114/raster/epsg-4326/{grid_size}/{row_count}/Mg_CO2_ha-1/geotiff/{tile_id}.tif"
}
Loading

0 comments on commit 0d1cdd8

Please sign in to comment.