GithubHelp home page GithubHelp logo

Comments (2)

jm-cook avatar jm-cook commented on August 16, 2024

Might be related to #114

However that was fixed?

from siphon.

jm-cook avatar jm-cook commented on August 16, 2024

I looked some more into this since I was curious as to why the fix to #114 does not solve my issue. I ran my little test on the oceandata opendap catalog link in #114 (now updated to https://oceandata.sci.gsfc.nasa.gov/opendap/SeaWiFS/L3SMI/2000/0101/catalog.xml) and see the same issue, ie opendap/hyrax is not inserted into the url.

What is happening is that when access_urls is constructed in make_access_urls(), the server_base url is correctly constructed as 'https://oceandata.sci.gsfc.nasa.gov/opendap/hyrax', the url_path is obtained as the absolute path /SeaWiFS/L3SMI/2000/0101/SEASTAR_SEAWIFS_GAC.20000101.L3m.DAY.CHL.chlor_a.9km.nc but then on the next line

                    access_urls[subservice.service_type] = urljoin(server_base,  self.url_path)

urljoin will create the absolute url, so the opendap/hyrax part of the server_base url is lost.

This seems to be how hyrax is presenting the paths (ie with a leading slash).

According to the documentation here: https://docs.unidata.ucar.edu/tds/5.2/userguide/basic_client_catalog.html, the service base, urlPath, and dataset should be concatenated together.

The code below shows the incorrectly constructed access_urls (the urls created cannot be accessed):

from siphon.catalog import TDSCatalog
cat_url = "https://oceandata.sci.gsfc.nasa.gov/opendap/SeaWiFS/L3SMI/2000/0101/catalog.xml"
cat = TDSCatalog(cat_url)
for cds in cat.datasets:
    url = cat.datasets[cds].access_urls['dap']
    print(f'access url = {url}')

from siphon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.