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

Added new class method to HLSCatalog #9

Closed

Conversation

jessjaco
Copy link

Sorry, should have put this on another branch?

Comment on lines +171 to +172
tiles = df.apply(lambda row: lookup.get_point_hls_tile_id(row.lat, row.lon), axis=1)
return self.from_tiles(tiles, years, bands, tile_lookup)
Copy link
Contributor

Choose a reason for hiding this comment

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

One of the (unstated) goals of this function was to retain metadata provided in the df parameter (such as training id). This isn't preserved here because from_tiles operates only on a series of tiles.

Also there are no years passed into from_point_pandas because it's required that the year is a column in the input df.

One way we can use your approach is:

  1. get the series of tiles for the points and add it as a column to the input df.
  2. sub-select two columns from df: year and tile
  3. remove duplicates the sub-df
  4. adapt from_tiles to accept a dataframe with tile+year rather than accepting tiles and years separately
  5. Call from_tiles on the sub-df in (3)
  6. Join the resulting dataset from from_tiles with the point dataframe on year/tile

This saves us duplicate computation for points with the same tile/year and means we can share code with from_bbox

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, I see now this didn't work. I really just wanted a from_tiles fxn to test with and wanted to reduce duplication, but....

Are you in a situation where you need different years of data for different points?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah one dataset has samples from different years

@jessjaco
Copy link
Author

Closing for now, non-essential

@jessjaco jessjaco closed this Dec 28, 2020
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.

2 participants