CEDA OPeNDAP: scripted interactions

As the CEDA Archive has various data access controls in place users wishing to interact with the CEDA OPeNDAP service will need to do so using security certificates. The following instructions will guide you through how to :

Further how-to guides will follow in due course covering the steps needed for Windows users and additional functions such as parameter sub-setting and including these calls within common scripting languages such as Python, IDL and MatLab.

Getting Started

  • First create a directory where you will download the scripts to generate the security certificates you'll be using later
mkdir ~/ceda_pydap_cert_code
  • Switch to that directory
cd ~/ceda_pydap_cert_code
  • Next you'll need to download the code from the following Git Hub repository:
git clone https://github.com/cedadev/online_ca_client
  • Then navigate to the scripts directory:
cd online_ca_client/contrail/security/onlineca/client/sh/
  • Finally, run the following command to get a folder full of trustroots - these will be needed later when we generate your temporary certificate:
./onlineca-get-trustroots-wget.sh -U https://slcs.ceda.ac.uk/onlineca/trustroots/ -c ~/trustroots

Getting a Security Certificate.

Having obtained the necessary code from the git hub repository you now need a certificate associated with your myCEDA account in order to access restricted datasets

  • Run the following command to get your temporary (3 day) certificate (remember to replace your ceda username below!:
./onlineca-get-cert-wget.sh -U  https://slcs.ceda.ac.uk/onlineca/certificate/ -c ~/trustroots -l <ceda username> -S > creds.pem
  • NOTE - You'll need to input your password after you submit the command
  • This will pipe the output (your certificate) into a file of your choosing (above it will be a local file creds.pem), you can alter this if you wish e.g.  ~/tmp/temp_cert.pem.

Downloading a file via WGET

  • Use your certificate as a parameter to wget to retrieve something from PyDAP.
wget --certificate creds.pem http://data.ceda.ac.uk/badc/ukmo-midas/data/GL/yearly_files/midas_glblwx-africa_197401-197412.txt --no-check-certificate

Still need help? Contact Us Contact Us