-
Notifications
You must be signed in to change notification settings - Fork 2
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
Clarify mechanism to get asset links #34
Comments
I think siphon takes the names from either of these results: I don't know why THREDDS answers To me, it looks like whatever THREDDS does additionally when it receives the |
Interesting ! Didn't realize this was there. |
I also found that |
The only issue I got with the |
I remember you had mentioned something about that before. I think you found startup to be too slow when |
But, I do agree, it would be nicer if the |
What I could propose is a stand-alone function that takes a URL and returns the same thing as our |
Another option is to submit an issue to siphon and see where that takes us. |
Do you mean a catalog URL or a catalog URL with query parameters? |
Straight URL with no parameters, to avoid the issue you mentioned about not all servers supporting this.
|
I might be getting confused with all the ncml/thredds stuff, but I think that's what we are currently doing... |
Yes, the only difference is just that I'd be bypassing siphon and putting all the logic in the same function. This would let us test STAC item creation independently from the THREDDSLoader. |
Okay, but I don't think it's possible to bypass siphon for the reason that if the THREDDS server is old (https://psl.noaa.gov/thredds/catalog/Datasets/catalog.html) then without siphon, we can't interrogate the access URLs of the item. |
replace the html with xml |
In test_standalone_stac_item, we be able to replace
by |
STAC Assets creation depends on an attribute called
access_urls
, which holds the various endpoints served by THREDDS. At the moment, we get these endpoints byxncml.Dataset.to_cf_dict
-> attrsattrs["access_urls"]
withsiphon.catalog.Dataset.access_urls
These look like this:
This is done by
THREDDSLoader.extract_metadata
.I think a cleaner solution would be to rely on the THREDDS response itself for those access urls instead of the siphon implementation.
We can get the THREDDS access points by sending a get request to the same NcML service, but with parameters:
requests.get(url, params={"catalog": catalog, "dataset": dataset})
withWith this modified request url, the response includes the following additional group
THREDDSMetadata
:This yields an id, and a list of services (note the keys are not the same as above, underlining the fact that the siphon implementation may be arbitrarily assigning names).
My feeling is that the function
STAC_item_from_metadata
should rely on the latter instead of the former, so it doesn't depend on custom logic hidden in theTHREDDSLoader.extract_metadata
.The other bit of additional logic that we should get rid of is
attrs["attributes"] = numpy_to_python_datatypes(attrs["attributes"])
. I think this could be implemented intoto_cf_dict
, and I'm willing to make anxncml
release with this in case you agree with the changes proposed here.The text was updated successfully, but these errors were encountered: