Skip to main content

Build Status

This code provides enhancements to the pydap client package:

  1. An updated pydap client that uses the requests package to handle Central Authentication Services (such as ESGF).

  2. A (partial) compatibility layer with netcdf4-python.

Frederic Laliberte University of Toronto, 2016

Documentation

ESGF

  1. Register at https://pcmdi.llnl.gov/user/add/?next=https://pcmdi.llnl.gov/projects/esgf-llnl/. When registering, you will create a password and receive an openid.

  2. Go to https://pcmdi.llnl.gov/esg-orp/home.htm and login with your openid using your password.

  3. Go to https://pcmdi.llnl.gov/esg-orp/registration-request.htm?resource=http%3A%2F%2Fpcmdi.llnl.gov%2Fthredds%2FfileServer%2Fesg_testroot%2Fregister%2Fcmip5_research.nc. Your browser will likely ask you to trust some certificates. CLICK ALWAYS ALLOW. If you don’t do this, it won’t work.

  4. Register for CMIP5 Research. You do not need to download data.

  5. Connect to OPeNDAP links as follows:

    import matplotlib.pyplot as plt
    import numpy as np
    
    import netcdf4_pydap
    import netcdf4_pydap.cas.esgf as esgf
    openid = YOUROPENID
    password = YOURPASSWORD
    
    credentials={
                  'password' : password,
                  'authentication_url' : esgf._uri(openid)}
    
    url = ('http://cordexesg.dmi.dk/thredds/dodsC/cordex_general/cordex/'
           'output/EUR-11/DMI/ICHEC-EC-EARTH/historical/r3i1p1/DMI-HIRHAM5/'
           'v1/day/pr/v20131119/'
           'pr_EUR-11_ICHEC-EC-EARTH_historical_r3i1p1_DMI-HIRHAM5_v1_day_19960101-20001231.nc')
    
    with netcdf4_pydap.Dataset(url,**credentials) as dataset:
        data = dataset.variables['pr'][0,:,:]
        plt.contourf(np.squeeze(data))
        plt.show()
  6. If using https://ceda.ac.uk instead of https://pcmdi.llnl.gov, your username must be passed along with your credentials use:

    credentials={
                  'username' : YOURCEDAUSERNAME,
                  'password' : password,
                  'authentication_url' : esgf._uri(openid)}

URS NASA Earthdata

There are a few steps required to connect to NASA Earthdata:

  1. Create an account at https://urs.earthdata.nasa.gov

  2. Authorize the data to see your profile (NASA calls this adding an app, a la Facebook). Follow http://disc.sci.gsfc.nasa.gov/registration/authorizing-desidsc-data-access-in-earthdata_login

  3. Load OPeNDAP data:

    import matplotlib.pyplot as plt
    import numpy as np
    import netcdf4_pydap
    
    credentials={'username': YOURUSERNAME,
                 'password': YOURPASSWORD,
                 'authentication_url':'https://urs.earthdata.nasa.gov/'}
    url = ('http://goldsmr3.gesdisc.eosdis.nasa.gov:80/opendap/'
           'MERRA_MONTHLY/MAIMCPASM.5.2.0/1979/MERRA100.prod.assim.instM_3d_asm_Cp.197901.hdf')
    
    with netcdf4_pydap.Dataset(url, **credentials) as dataset:
        data = dataset.variables['SLP'][0,:,:]
        plt.contourf(np.squeeze(data))
        plt.show()

Version History

0.2.6: Another bug fix when getting cookies.

0.2.5: Bug fix when getting cookies.

0.2.4: Bug fix for ESGF.

0.2.3: New authentication method. Support URS NASA Earthdata

0.2.2: Pydap 3.1.1 is now a requirement.

0.2.1: Removed support for NASA Earthdata.

0.2: Travis-CI integration. Limited test suite. Code reorganization.

0.1.4: Bug fix and more robust error handling.

0.1.1: Added special Dataset class to mimic wget.

0.1 : Initial commit.

Metadata

Release files for netcdf4_pydap 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netcdf4_pydap 0.2.6
File Size Uploaded Provenance Actions
netcdf4_pydap-0.2.6.tar.gz 15.4 kB Without provenance Details for netcdf4_pydap-0.2.6.tar.gz

Release files / netcdf4_pydap-0.2.6.tar.gz

Download URL netcdf4_pydap-0.2.6.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c293dd659c72bad6411d6edc8fb58da4972474a7e9bc109581102388b6833953
BLAKE2b-256 checksum
How to use checksums
18f00861cc482afdedb7428b1a7ae3e1f646f7ac054d4b1d4382a45c3df60e6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for netcdf4_pydap 0.2.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page