Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements on parsing time from tiffs. #296

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Improvements on parsing time from tiffs. #296

wants to merge 2 commits into from

Conversation

alxmrs
Copy link
Collaborator

@alxmrs alxmrs commented Feb 16, 2023

Fixes and improved codepath for parsing time from Tiffs. Useful for performing round-trip tests.

@alxmrs alxmrs requested review from deepgabani8, mahrsee1997 and j9sh264 and removed request for deepgabani8 February 16, 2023 22:44
@alxmrs alxmrs marked this pull request as ready for review February 16, 2023 23:40
Copy link
Collaborator

@mahrsee1997 mahrsee1997 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good ... just a minor feedback point.

weather_mv/loader_pipeline/sinks.py Show resolved Hide resolved
weather_mv/loader_pipeline/sinks.py Outdated Show resolved Hide resolved
@alxmrs
Copy link
Collaborator Author

alxmrs commented Mar 13, 2023

Thanks for the feedback. The changes are now updated.

Copy link
Collaborator

@mahrsee1997 mahrsee1997 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@@ -175,18 +175,22 @@ def _get_band_data(i):
raise RuntimeError("Wrong regex passed in --forecast_time_regex.")
ds.attrs['start_time'] = start_time
ds.attrs['end_time'] = end_time
elif 'start_time' in ds.attrs and 'end_time' in ds.attrs:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 points

  • Our tiff files do not preserve attrs so reading them with xr.open_dataset(file.tiff, engine='rasterio') will have empty ds.attrs.
  • 'start_time' and 'end_time' in dataset attrs is in 2021-01-01T00:00:00Z format so we need to parse it into datetime.datetime() for below datetime_value_s variable to initialize.
  • start_time is not being used. Can be skipped.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good points Deep.
May be we can pick this #159 (comment) next & restructure _preprocess_tif altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants