wri / gfw_forest_loss_geotrellis

Global Tree Cover Loss Analysis using Geotrellis and SPARK
MIT License
10 stars 8 forks source link

Use iso year instead of normal year for alert__year #204

Closed jterry64 closed 10 months ago

jterry64 commented 10 months ago

Pull request checklist

Please check if your PR fulfills the following requirements:

Pull request type

Please check the type of change your PR introduces:

What is the current behavior?

For extracting alertweek from alertdate in the VIIRS analysis, we use a function that returns the iso week. The iso week can sometimes extend across years to keep week definitions consistent (e.g. December 2020 has a week 53 that extends into January 2021).

For the corresponding alert__year value, we're using a normal year function, not the iso year function. So in the case above, January 1st 2021 will return 2021 instead of 2020. So the date will be return as week 53 of 2021, when it should be week 53 of 2020.

Issue Number: GTC-2644

What is the new behavior?

Use a new extraction function that gets the iso year from the date.

Does this introduce a breaking change?