google / weather-tools

Tools to make weather data accessible and useful.
https://weather-tools.readthedocs.io/
Apache License 2.0
209 stars 39 forks source link

weather-mv ee: Add a couple of time-metrics to asset attributes #360

Closed deepgabani8 closed 1 year ago

deepgabani8 commented 1 year ago

Idea is to track how much time the pipeline took to process a single file to ingest in the earth engine.

How we can do this is by adding a couple of timestamps in the asset (image) attributes.

Benefit of these attributes is that, we can track down how much time the pipeline took to process a single file. It is an important stat especially for a real-time pipeline.

To the one who will use this metrics in the future...

ic = ee.ImageCollection(IMAGE_COLLECTION)

job_start_array = ic.aggregate_array('job_start_time').getInfo() ingestion_time_array = ic.aggregate_array('ingestion_time').getInfo() init_time_array = [t/1000. for t in hrrr.aggregate_array('system:time_start').getInfo()] valid_time_array = [t/1000. for t in hrrr.aggregate_array('system:time_end').getInfo()]