使用Java脚本使并行服务器请求THREDDS OPeNDAP [英] Using Javascript to make parallel server requests THREDDS OPeNDAP

查看:319
本文介绍了使用Java脚本使并行服务器请求THREDDS OPeNDAP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于以下THREDDS OPeNDAP服务器:

For the following THREDDS OPeNDAP server:

http://data.nodc.noaa.gov/thredds/catalog/ghrsst/L2P/MODIS_T/JPL/2015/294/catalog.html

我想指出其中每个文件的四个属性.这些属性是: 最北纬度最东端的纬度;最西端的纬度;最南端的纬度.这些可以在全局"属性下找到:

I would like to note four Attributes of every file in there. The attributes are: northernmost lattitude; easternmost lattitude; westernmost lattitude; southernmost lattitude. These can be found under the Global attributes under:

http://data.nodc.noaa.gov/thredds/dodsC/ghrsst/L2P/MODIS_T/JPL/2015/294/20151021-MODIS_T-JPL-L2P-T2015294235500.L2_LAC_GHRSST_N-v01.nc.bz2.html

起初,我使用MATLAB进行了尝试.问题是:服务器上的所有netcdf文件都被编译为.bz2文件.这使得调用Global属性大约需要15秒钟(服务器正在提取文件).我希望javascript并行运行这些服务器请求,以节省时间.我总共需要90,000个文件.

At first I tried this with MATLAB. Problem is: all the netcdf files on the server are compiled to .bz2 files. This makes calling for the Global attributes take around 15 seconds (the server is extracting the file). I would like javascript to run these server requests parallel to save me time. In total I need 90,000 files.

有没有一种方法可以使用javascript进行编码?

Is there a way to code this using javascript?

推荐答案

您可以使用THREDDS DAS服务.

You can use the THREDDS DAS service. DAS

更改上面的OPenDAP链接,以.das替换.html扩展名 这是一个小型文本文件,其中包含有关该文件的元数据,可以使用javascript轻松解析该文件,其中包括具有全局属性的部分:

Change the OPenDAP link you have above replacing the .html extension with .das This is a small text file with metadata about the file which could be easily parsed with javascript and includes a section with the global attributes:

 NC_GLOBAL {
    . . .
    Float32 northernmost_latitude 89.9942;
    Float32 southernmost_latitude 66.9853;
    Float32 easternmost_longitude -121.445;
    Float32 westernmost_longitude 76.7485;
    . . .
  }

此元数据由THREDDS缓存,并且上面的DAS链接会立即响应.

This metadata is cached by THREDDS and the above DAS link responds instantly.

回复:下面的正确注释(仅在第一个请求之后才存在缓存),一种替代方法是在NASA JPL OPeNDAP服务器(Hyrax)上使用源数据:

Re: the correct comments below, (cache exists only after the first request) one alternative might be to use the source data at the NASA JPL OPeNDAP Server (Hyrax): http://podaac-opendap.jpl.nasa.gov/opendap/allData/ghrsst/data/L2P/MODIS_T/JPL/

我的浏览器仅测试(即主观)似乎表明随机DAS响应比15秒要快.

My browser only tests (i.e. subjective) seem to show that a random DAS responses are quicker, than 15 seconds.

查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆