哥白尼海洋数据下载方式

发布时间 2023-04-14 19:16:07作者: dan-chen

哥白尼官方网站:https://marine.copernicus.eu/

OPeNDAP远程使用

https://help.marine.copernicus.eu/en/articles/6522070-what-is-opendap-and-how-to-access-copernicus-marine-data

用matlab使用OPeNDAP:https://help.marine.copernicus.eu/en/articles/6380431-how-to-access-and-subset-a-dataset-via-opendap-in-matlab

USERNAME = 'xxxx';
PASSWORD = 'xxxx';
datasetID = "cmems_mod_glo_phy_my_0.083_P1M-m";

fid = strcat('https://',USERNAME,':', PASSWORD,...
    '@my.cmems-du.eu/thredds/dodsC/',datasetID);

ncdisp(fid)

% 接下来就可以直接读取了

MOTU下载

https://help.marine.copernicus.eu/en/articles/4682997-what-are-the-advantages-of-the-motu-subsetting-download-service
需要下载motu插件,再进行下载,可以在conda里找到motu,然后就根据选好的数据集对应的脚本下载即可。
以下是循环下载的一个例子

#!/bin/bash

# set start date and end date
start_yyyy=2000
end_yyyy=2001
start_mm=1
end_mm=12

for(( year=$start_yyyy; year<=$end_yyyy; year++ )); do
  for(( month=$start_mm; month<=$end_mm; month++ )); do
    out_name=$(printf "glorys_monthly_%04d%02d" $year $month)
    python -m motuclient --motu https://my.cmems-du.eu/motu-web/Motu \
      --service-id GLOBAL_MULTIYEAR_PHY_001_030-TDS \
      --product-id cmems_mod_glo_phy_my_0.083_P1M-m \
      --longitude-min 50.00 --longitude-max 200.00 \
      --latitude-min -50.00 --latitude-max 70.00 \
      --date-min "$year-$month-01 00:00:00" \
      --date-max "$year-$month-31 00:00:00" \
      --depth-min 0.00 --depth-max 6000.00 \
      --variable so \
      --variable uo \
      --variable vo \
      --variable zos \
      --variable thetao \
      --out-dir ./ \
      --out-name $out_name \
      --user xxxx --pwd xxxx
  done
done�

github上也有一个get_mercator的插件,是根据motu编写的,可以在windows上安装交互界面

FTP下载

https://help.marine.copernicus.eu/en/articles/4521873-how-to-download-a-dataset-from-ftp-server#h_46df8497e7

  1. 可以用mac-finder直接链接
    "Finder" --> "Go" --> "Connect to Server" --> “ftp://my.cmems-du.eu” --> 输入用户名、密码即可
  2. 可以用ncftp链接下载
# 没有ncftp的话可以用homebrew下载
brew install ncftp

# 打开ncftp
ncftp
> open -u <copernicus_marine_username> -p <your_password> my.cmems-du.eu 
> dir
> cd Core/GLOBAL_MULTIYEAR_PHY_001_030/cmems_mod_glo_phy_my_0.083-climatology_P1M-m/
> dir
> get mercatorglorys12v1_gl12_mean_1993_2016_01.nc

# 如果已经知道路径和文件名,也可以直接在终端上调用ncftpget进行下载
ncftpget -u <copernicus_marine_username> -p <your_password> my.cmems-du.eu ./ Core/GLOBAL_MULTIYEAR_PHY_001_030/cmems_mod_glo_phy_my_0.083-climatology_P1M-m/mercatorglorys12v1_gl12_mean_1993_2016_11.nc
# ncftpget -u 用户名 -p 密码 my.cmems-du.eu 本地保存路径 远程路径文件
  1. matlab也支持ftp,尝试过,失败了,不想找原因了,先以上几种用着吧....