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

start_date/end_date matched to timestamp #44

Closed

Conversation

wouellette
Copy link
Contributor

If start_date and/or end_date defined for the resampling range are beyond the range of the eopatch.timestamp, match them to the first and/or last eopatch.timestamp. This will avoid empty arrays at the beginning and end of the resampled eopatch.

If start_date and/or end_date defined for the resampling range are beyond the range of the eopatch.timestamp, match them to the first and/or last eopatch.timestamp. This will avoid empty arrays at the beginning and end of the resampled eopatch.
@mlubej
Copy link
Contributor

mlubej commented Jan 30, 2019

Hmm, while I agree that the empty arrays are problematic, this way ensured that each date after the resampling was evaluated on the same day. It can happen that two eopatches in the same process have different start and end timestamps, so matching the edges of the resampling interval to the timestamp interval might introduce differences between different patches, because the resampled dates would be different and then the interpolation is evaluated at different times.

If you see a workaround, let me know.

@wouellette
Copy link
Contributor Author

The issue was already identified and discussed with @azupanc at Linear Interpolation Problem in overlapping DataTake areas using WCS requests .

For now I am handling it externally by narrowing down the "overall" time interval to the eopatches of my AOI which have the latest start_date and the earliest end_date in the following way:

start_date_interp = parser.parse(start_date)
end_date_interp = parser.parse(end_date)

for eopatch in eopatches:
     if start_date_interp < eopatch.timestamp[0]:
         start_date_interp = eopatch.timestamp[0]
     if end_date_interp > eopatch.timestamp[-1]:
         end_date_interp = eopatch.timestamp[-1]

resample_range = (start_date_interp, end_date_interp, interp_interval)

I don't have any wonder solution to handle this at the eopatch level rather than at the AOI level, but I think of something I'll shout :)

@mlubej
Copy link
Contributor

mlubej commented Feb 27, 2019

Hi @wouellette!

Can I close this PR or did you plan to extend it to bypass the problem? Perhaps it's too specific to be included in the official code because you need the info of the entire AOI?

Cheers,
Matic

@wouellette
Copy link
Contributor Author

You can close it for now yes. If I come up with some idea i'll re-open with a suggestion.

Regards

@mlubej mlubej closed this Feb 28, 2019
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.

None yet

2 participants