Switch to handling TZ like dataRetrieval does, for the most part. The way it's intended to work now:
The time zone listed in ActivityStartTime.TimeZoneCode is what we base our times off of. If DST is ignored, we ignore it too and use GMT offsets to achieve this
We produce:
harmonized_tz, which is in GMT offset format
harmonized_local_time, which is stripped to character class and does not contain the tz string (this is only in harmonized_tz now)
harmonized_utc, which usually has the same value as ActvityStartDateTime
We fill NA ActivityStartTime.TimeZoneCodes with a local time zone code obtained via lat/long
UTC and GMT ActivityStartTime.TimeZoneCodes are also ultimately paired to a new time zone, too, for local time calculation
We replace NA or "00:00:00" values of ActivityStartTime.Time with "11:59:59" in local time
So, e.g., if a record is "00:00:00" and provided with UTC for ActivityStartTime.TimeZoneCode it should be reassigned "11:59:59" AM local time first and then a new UTC time calculated
Let me know if I'm forgetting anything here @mishafredmeyer @matthewross07!
I also re-ran the pipeline to apply the changes/update the bookdown.
Thanks!
This PR follows up on https://github.com/AquaSat/AquaMatch_harmonize_WQP/pull/97. Here's the main points addressed (see
3_harmonize/src/clean_wqp_data.R
):ActivityStartTime.TimeZoneCode
is what we base our times off of. If DST is ignored, we ignore it too and use GMT offsets to achieve thisharmonized_tz
, which is in GMT offset formatharmonized_local_time
, which is stripped to character class and does not contain the tz string (this is only inharmonized_tz
now)harmonized_utc
, which usually has the same value asActvityStartDateTime
ActivityStartTime.TimeZoneCode
s with a local time zone code obtained via lat/longActivityStartTime.TimeZoneCode
s are also ultimately paired to a new time zone, too, for local time calculationActivityStartTime.Time
with "11:59:59" in local timeActivityStartTime.TimeZoneCode
it should be reassigned "11:59:59" AM local time first and then a new UTC time calculatedLet me know if I'm forgetting anything here @mishafredmeyer @matthewross07!
I also re-ran the pipeline to apply the changes/update the bookdown. Thanks!