Last active
April 8, 2020 09:41
-
-
Save gmaze/bac541644b3b0341b0fc93741c8948dd to your computer and use it in GitHub Desktop.
Compare_time_response_erddap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
# -*coding: UTF-8 -*- | |
import requests | |
import time | |
# Request full data: | |
t0 = time.time() | |
url = 'http://www.ifremer.fr/erddap/tabledap/ArgoFloats.csv?data_mode,latitude,longitude,position_qc,time,time_qc,direction,platform_number,cycle_number,pres,temp,psal,pres_qc,temp_qc,psal_qc,pres_adjusted,temp_adjusted,psal_adjusted,pres_adjusted_qc,temp_adjusted_qc,psal_adjusted_qc,pres_adjusted_error,temp_adjusted_error,psal_adjusted_error&platform_number=~"5900446"&distinct()&orderBy("time,pres")' | |
requests.get(url) | |
t1 = time.time() | |
print("Time to request one float data from 'ArgoFloats': %0.2f secs" % float(t1-t0)) | |
# Request the index: | |
t0 = time.time() | |
url = 'http://www.ifremer.fr/erddap/tabledap/ArgoFloats-index.csv?file,date,longitude,latitude,ocean,profiler_type,institution,date_update&file=~"(.*)(R|D)(5900446)(_.*)"&distinct()&orderBy("date")' | |
requests.get(url) | |
t1 = time.time() | |
print("Time to request one float data from 'ArgoFloats-index': %0.2f secs" % float(t1-t0)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment