digitalearthpacific / dep-tools

Processing tools for Digital Earth Pacific
MIT License
1 stars 0 forks source link

Use catalog as the variable not the Client #52

Closed alexgleith closed 6 months ago

alexgleith commented 6 months ago

Most controversial here is taking a catalog string instead of a complete Client object.

I just think it makes more sense!

jessjaco commented 6 months ago

I know we've argued about this before, but I pass the client because you should pass a kw arg ("modifier") to .client when using the PC. I'm trying to avoid a situation where we need to pass another kwargs-type argument to the constructor, or shadow existing functionality with our own parameters.

Why do you think it makes more sense?

alexgleith commented 6 months ago

Hey @jessjaco I wasn't aware of the modifier argument.

So I guess you're doing this:

catalog = Client.open(
   'https://planetarycomputer.microsoft.com/api/stac/v1',
   modifier=planetary_computer.sign_inplace,
)

The way I sign the URLs is by passing the function into the Loader:

    loader = OdcLoader(
        crs=3832,
        resolution=output_resolution,
        ...
        patch_url=sign_url,  # this is planetary_computer.sign_url
    )

Both methods are reasonably similar, so I don't really mind.

If you'd prefer your way, that's fine, we can close this PR.

jessjaco commented 6 months ago

Oh interesting stackstac doesn't allow signing but I guess you could do it after the search is returned. Hmm let me think about this

alexgleith commented 6 months ago

Closing this, it's replaced by #53