How to download CMEMS SLTAC products from the CMEMS ftp server ?

some python imports


In [2]:
from ftplib import FTP
import os
import numpy as np

init the connection to the ftp server


In [2]:
ftp = FTP('ftp.sltac.cls.fr') 
ftp.login('pprandi','PierreCMEMS2017')


Out[2]:
'230 Login successful.'

What is in the current directory ?


In [3]:
ftp.retrlines('LIST')


drwxr-xr-x   38 ftp      ftp             0 Apr 19 11:12 Core
Out[3]:
'226 Directory send OK.'

change to the directory of level 4 delayed-time global maps, and list the content. Grids are organized as subdirs following years


In [4]:
ftp.cwd('Core/SEALEVEL_GLO_PHY_L4_REP_OBSERVATIONS_008_047/dataset-duacs-rep-global-merged-allsat-phy-l4-v3/2016/')


Out[4]:
'250 Directory successfully changed.'

In [5]:
ftp.retrlines('LIST')


-rw-r--r--    1 ftp      ftp       8851297 Jan 12 14:50 dt_global_allsat_phy_l4_20160101_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8848408 Jan 12 14:50 dt_global_allsat_phy_l4_20160102_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8842312 Jan 12 14:50 dt_global_allsat_phy_l4_20160103_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8838765 Jan 12 14:50 dt_global_allsat_phy_l4_20160104_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8833329 Jan 12 14:50 dt_global_allsat_phy_l4_20160105_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8829465 Jan 12 14:50 dt_global_allsat_phy_l4_20160106_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8828093 Jan 12 14:50 dt_global_allsat_phy_l4_20160107_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8827358 Jan 12 14:50 dt_global_allsat_phy_l4_20160108_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8826801 Jan 12 14:50 dt_global_allsat_phy_l4_20160109_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8819359 Jan 12 14:50 dt_global_allsat_phy_l4_20160110_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8816331 Jan 12 14:50 dt_global_allsat_phy_l4_20160111_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8813683 Jan 12 14:50 dt_global_allsat_phy_l4_20160112_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8811474 Jan 12 14:50 dt_global_allsat_phy_l4_20160113_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8805752 Jan 12 14:50 dt_global_allsat_phy_l4_20160114_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8803383 Jan 12 14:50 dt_global_allsat_phy_l4_20160115_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8802889 Jan 12 14:50 dt_global_allsat_phy_l4_20160116_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8804540 Jan 12 14:50 dt_global_allsat_phy_l4_20160117_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8804590 Jan 12 14:50 dt_global_allsat_phy_l4_20160118_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8800795 Jan 12 14:50 dt_global_allsat_phy_l4_20160119_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8800664 Jan 12 14:50 dt_global_allsat_phy_l4_20160120_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8800383 Jan 12 14:50 dt_global_allsat_phy_l4_20160121_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8803581 Jan 12 14:50 dt_global_allsat_phy_l4_20160122_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8806735 Jan 12 14:50 dt_global_allsat_phy_l4_20160123_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8806299 Jan 12 14:50 dt_global_allsat_phy_l4_20160124_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8810163 Jan 12 14:50 dt_global_allsat_phy_l4_20160125_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8812270 Jan 12 14:50 dt_global_allsat_phy_l4_20160126_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8812612 Jan 12 14:50 dt_global_allsat_phy_l4_20160127_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8813082 Jan 12 14:50 dt_global_allsat_phy_l4_20160128_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8812077 Jan 12 14:50 dt_global_allsat_phy_l4_20160129_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8809640 Jan 12 14:50 dt_global_allsat_phy_l4_20160130_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8809638 Jan 12 14:50 dt_global_allsat_phy_l4_20160131_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8807964 Jan 12 14:50 dt_global_allsat_phy_l4_20160201_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8804610 Jan 12 14:50 dt_global_allsat_phy_l4_20160202_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8804568 Jan 12 14:50 dt_global_allsat_phy_l4_20160203_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8802658 Jan 12 14:50 dt_global_allsat_phy_l4_20160204_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8800820 Jan 12 14:50 dt_global_allsat_phy_l4_20160205_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8801237 Jan 12 14:50 dt_global_allsat_phy_l4_20160206_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8799400 Jan 12 14:50 dt_global_allsat_phy_l4_20160207_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8801300 Jan 12 14:50 dt_global_allsat_phy_l4_20160208_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8800805 Jan 12 14:50 dt_global_allsat_phy_l4_20160209_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8800633 Jan 12 14:50 dt_global_allsat_phy_l4_20160210_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8802659 Jan 12 14:50 dt_global_allsat_phy_l4_20160211_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8801613 Jan 12 14:50 dt_global_allsat_phy_l4_20160212_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8803186 Jan 12 14:50 dt_global_allsat_phy_l4_20160213_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8802852 Jan 12 14:50 dt_global_allsat_phy_l4_20160214_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8801997 Jan 12 14:50 dt_global_allsat_phy_l4_20160215_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8805607 Jan 12 14:50 dt_global_allsat_phy_l4_20160216_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8807325 Jan 12 14:50 dt_global_allsat_phy_l4_20160217_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8808800 Jan 12 14:50 dt_global_allsat_phy_l4_20160218_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8810573 Jan 12 14:50 dt_global_allsat_phy_l4_20160219_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8813838 Jan 12 14:50 dt_global_allsat_phy_l4_20160220_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8816440 Jan 12 14:50 dt_global_allsat_phy_l4_20160221_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8818386 Jan 12 14:50 dt_global_allsat_phy_l4_20160222_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8815303 Jan 12 14:50 dt_global_allsat_phy_l4_20160223_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8814018 Jan 12 14:50 dt_global_allsat_phy_l4_20160224_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8812031 Jan 12 14:50 dt_global_allsat_phy_l4_20160225_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8810634 Jan 12 14:50 dt_global_allsat_phy_l4_20160226_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8807671 Jan 12 14:50 dt_global_allsat_phy_l4_20160227_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8808638 Jan 12 14:50 dt_global_allsat_phy_l4_20160228_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8807774 Jan 12 14:50 dt_global_allsat_phy_l4_20160229_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8808064 Jan 12 14:50 dt_global_allsat_phy_l4_20160301_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8809619 Jan 12 14:50 dt_global_allsat_phy_l4_20160302_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8809023 Jan 12 14:50 dt_global_allsat_phy_l4_20160303_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8807898 Jan 12 14:50 dt_global_allsat_phy_l4_20160304_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8804759 Jan 12 14:50 dt_global_allsat_phy_l4_20160305_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8801564 Jan 12 14:50 dt_global_allsat_phy_l4_20160306_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8797868 Jan 12 14:50 dt_global_allsat_phy_l4_20160307_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8795810 Jan 12 14:50 dt_global_allsat_phy_l4_20160308_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8794878 Jan 12 14:50 dt_global_allsat_phy_l4_20160309_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8796552 Jan 12 14:50 dt_global_allsat_phy_l4_20160310_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8795489 Jan 12 14:50 dt_global_allsat_phy_l4_20160311_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8795082 Jan 12 14:50 dt_global_allsat_phy_l4_20160312_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8797551 Jan 12 14:50 dt_global_allsat_phy_l4_20160313_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8801668 Jan 12 14:50 dt_global_allsat_phy_l4_20160314_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8800340 Jan 12 14:50 dt_global_allsat_phy_l4_20160315_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8798902 Jan 12 14:50 dt_global_allsat_phy_l4_20160316_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8802125 Jan 12 14:50 dt_global_allsat_phy_l4_20160317_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8797325 Jan 12 14:50 dt_global_allsat_phy_l4_20160318_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8797146 Jan 12 14:50 dt_global_allsat_phy_l4_20160319_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8796817 Jan 12 14:50 dt_global_allsat_phy_l4_20160320_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8792478 Jan 12 14:50 dt_global_allsat_phy_l4_20160321_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8791516 Jan 12 14:50 dt_global_allsat_phy_l4_20160322_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8791016 Jan 12 14:50 dt_global_allsat_phy_l4_20160323_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8793862 Jan 12 14:50 dt_global_allsat_phy_l4_20160324_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8797074 Jan 12 14:50 dt_global_allsat_phy_l4_20160325_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8795794 Jan 12 14:50 dt_global_allsat_phy_l4_20160326_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8796655 Jan 12 14:50 dt_global_allsat_phy_l4_20160327_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8796394 Jan 12 14:50 dt_global_allsat_phy_l4_20160328_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8795929 Jan 12 14:50 dt_global_allsat_phy_l4_20160329_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8793781 Jan 12 14:50 dt_global_allsat_phy_l4_20160330_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8789078 Jan 12 14:50 dt_global_allsat_phy_l4_20160331_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8791175 Jan 12 14:50 dt_global_allsat_phy_l4_20160401_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8790175 Jan 12 14:50 dt_global_allsat_phy_l4_20160402_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8787938 Jan 12 14:50 dt_global_allsat_phy_l4_20160403_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8783136 Jan 12 14:50 dt_global_allsat_phy_l4_20160404_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8781574 Jan 12 14:50 dt_global_allsat_phy_l4_20160405_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8782255 Jan 12 14:50 dt_global_allsat_phy_l4_20160406_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8784930 Jan 12 14:50 dt_global_allsat_phy_l4_20160407_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8785174 Jan 12 14:50 dt_global_allsat_phy_l4_20160408_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8783449 Jan 12 14:50 dt_global_allsat_phy_l4_20160409_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8781194 Jan 12 14:50 dt_global_allsat_phy_l4_20160410_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8777865 Jan 12 14:50 dt_global_allsat_phy_l4_20160411_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8774195 Jan 12 14:50 dt_global_allsat_phy_l4_20160412_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8772459 Jan 12 14:50 dt_global_allsat_phy_l4_20160413_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8772699 Jan 12 14:50 dt_global_allsat_phy_l4_20160414_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8776102 Jan 12 14:50 dt_global_allsat_phy_l4_20160415_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8775436 Jan 12 14:50 dt_global_allsat_phy_l4_20160416_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8772709 Jan 12 14:50 dt_global_allsat_phy_l4_20160417_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8776340 Jan 12 14:50 dt_global_allsat_phy_l4_20160418_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8777584 Jan 12 14:50 dt_global_allsat_phy_l4_20160419_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8778377 Jan 12 14:50 dt_global_allsat_phy_l4_20160420_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8783100 Jan 12 14:50 dt_global_allsat_phy_l4_20160421_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8782924 Jan 12 14:50 dt_global_allsat_phy_l4_20160422_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8788789 Jan 12 14:50 dt_global_allsat_phy_l4_20160423_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8792553 Jan 12 14:50 dt_global_allsat_phy_l4_20160424_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8796007 Jan 12 14:50 dt_global_allsat_phy_l4_20160425_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8796773 Jan 12 14:50 dt_global_allsat_phy_l4_20160426_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8795817 Jan 12 14:50 dt_global_allsat_phy_l4_20160427_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8793049 Jan 12 14:50 dt_global_allsat_phy_l4_20160428_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8793484 Jan 12 14:50 dt_global_allsat_phy_l4_20160429_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8789468 Jan 12 14:50 dt_global_allsat_phy_l4_20160430_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8791446 Jan 12 14:50 dt_global_allsat_phy_l4_20160501_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8798039 Jan 12 14:50 dt_global_allsat_phy_l4_20160502_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8800717 Jan 12 14:50 dt_global_allsat_phy_l4_20160503_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8804240 Jan 12 14:50 dt_global_allsat_phy_l4_20160504_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8807931 Jan 12 14:50 dt_global_allsat_phy_l4_20160505_20170110.nc.gz
-rw-r--r--    1 ftp      ftp       8813866 Mar 30 12:25 dt_global_allsat_phy_l4_20160506_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8822924 Mar 30 12:25 dt_global_allsat_phy_l4_20160507_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8830155 Mar 30 12:25 dt_global_allsat_phy_l4_20160508_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8839008 Mar 30 12:25 dt_global_allsat_phy_l4_20160509_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8847915 Mar 30 12:25 dt_global_allsat_phy_l4_20160510_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8853740 Mar 30 12:26 dt_global_allsat_phy_l4_20160511_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8854035 Mar 30 12:26 dt_global_allsat_phy_l4_20160512_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8855910 Mar 30 12:26 dt_global_allsat_phy_l4_20160513_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8849395 Mar 30 12:26 dt_global_allsat_phy_l4_20160514_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8846706 Mar 30 12:26 dt_global_allsat_phy_l4_20160515_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8845596 Mar 30 12:26 dt_global_allsat_phy_l4_20160516_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8848839 Mar 30 12:26 dt_global_allsat_phy_l4_20160517_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8850697 Mar 30 12:27 dt_global_allsat_phy_l4_20160518_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8852115 Mar 30 12:27 dt_global_allsat_phy_l4_20160519_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8854869 Mar 30 12:27 dt_global_allsat_phy_l4_20160520_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8856044 Mar 30 12:27 dt_global_allsat_phy_l4_20160521_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8862584 Mar 30 12:27 dt_global_allsat_phy_l4_20160522_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8869244 Mar 30 12:27 dt_global_allsat_phy_l4_20160523_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8877593 Mar 30 12:27 dt_global_allsat_phy_l4_20160524_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8885509 Mar 30 12:27 dt_global_allsat_phy_l4_20160525_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8891859 Mar 30 12:28 dt_global_allsat_phy_l4_20160526_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8895797 Mar 30 12:28 dt_global_allsat_phy_l4_20160527_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8899030 Mar 30 12:28 dt_global_allsat_phy_l4_20160528_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8898514 Mar 30 12:28 dt_global_allsat_phy_l4_20160529_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8901007 Mar 30 12:28 dt_global_allsat_phy_l4_20160530_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8906793 Mar 30 12:28 dt_global_allsat_phy_l4_20160531_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8906661 Mar 30 12:28 dt_global_allsat_phy_l4_20160601_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8910021 Mar 30 12:28 dt_global_allsat_phy_l4_20160602_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8913041 Mar 30 12:28 dt_global_allsat_phy_l4_20160603_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8911190 Mar 30 12:29 dt_global_allsat_phy_l4_20160604_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8907866 Mar 30 12:29 dt_global_allsat_phy_l4_20160605_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8902868 Mar 30 12:29 dt_global_allsat_phy_l4_20160606_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8894834 Mar 30 12:29 dt_global_allsat_phy_l4_20160607_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8886625 Mar 30 12:29 dt_global_allsat_phy_l4_20160608_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8878946 Mar 30 12:29 dt_global_allsat_phy_l4_20160609_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8869819 Mar 30 12:29 dt_global_allsat_phy_l4_20160610_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8864932 Mar 30 12:29 dt_global_allsat_phy_l4_20160611_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8861544 Mar 30 12:29 dt_global_allsat_phy_l4_20160612_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8861548 Mar 30 12:30 dt_global_allsat_phy_l4_20160613_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8862002 Mar 30 12:30 dt_global_allsat_phy_l4_20160614_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8863142 Mar 30 12:30 dt_global_allsat_phy_l4_20160615_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8862397 Mar 30 12:30 dt_global_allsat_phy_l4_20160616_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8860369 Mar 30 12:30 dt_global_allsat_phy_l4_20160617_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8857303 Mar 30 12:30 dt_global_allsat_phy_l4_20160618_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8847051 Mar 30 12:30 dt_global_allsat_phy_l4_20160619_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8841455 Mar 30 12:30 dt_global_allsat_phy_l4_20160620_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8836488 Mar 30 12:31 dt_global_allsat_phy_l4_20160621_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8838653 Mar 30 12:31 dt_global_allsat_phy_l4_20160622_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8831895 Mar 30 12:31 dt_global_allsat_phy_l4_20160623_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8828582 Mar 30 12:31 dt_global_allsat_phy_l4_20160624_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8823059 Mar 30 12:31 dt_global_allsat_phy_l4_20160625_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8818941 Mar 30 12:31 dt_global_allsat_phy_l4_20160626_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8815167 Mar 30 12:31 dt_global_allsat_phy_l4_20160627_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8813493 Mar 30 12:31 dt_global_allsat_phy_l4_20160628_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8814911 Mar 30 12:31 dt_global_allsat_phy_l4_20160629_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8815709 Mar 30 12:31 dt_global_allsat_phy_l4_20160630_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8813787 Mar 30 12:32 dt_global_allsat_phy_l4_20160701_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8811726 Mar 30 12:32 dt_global_allsat_phy_l4_20160702_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8808280 Mar 30 12:32 dt_global_allsat_phy_l4_20160703_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8805715 Mar 30 12:32 dt_global_allsat_phy_l4_20160704_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8798412 Mar 30 12:32 dt_global_allsat_phy_l4_20160705_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8793864 Mar 30 12:32 dt_global_allsat_phy_l4_20160706_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8784951 Mar 30 12:32 dt_global_allsat_phy_l4_20160707_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8780847 Mar 30 12:32 dt_global_allsat_phy_l4_20160708_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8773865 Mar 30 12:32 dt_global_allsat_phy_l4_20160709_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8767465 Mar 30 12:33 dt_global_allsat_phy_l4_20160710_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8764478 Mar 30 12:33 dt_global_allsat_phy_l4_20160711_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8761368 Mar 30 12:33 dt_global_allsat_phy_l4_20160712_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8759852 Mar 30 12:33 dt_global_allsat_phy_l4_20160713_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8757001 Mar 30 12:33 dt_global_allsat_phy_l4_20160714_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8750485 Mar 30 12:33 dt_global_allsat_phy_l4_20160715_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8748728 Mar 30 12:33 dt_global_allsat_phy_l4_20160716_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8748857 Mar 30 12:33 dt_global_allsat_phy_l4_20160717_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8747328 Mar 30 12:33 dt_global_allsat_phy_l4_20160718_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8743258 Mar 30 12:34 dt_global_allsat_phy_l4_20160719_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8744687 Mar 30 12:34 dt_global_allsat_phy_l4_20160720_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8740102 Mar 30 12:34 dt_global_allsat_phy_l4_20160721_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8736229 Mar 30 12:34 dt_global_allsat_phy_l4_20160722_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8734602 Mar 30 12:34 dt_global_allsat_phy_l4_20160723_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8730671 Mar 30 12:34 dt_global_allsat_phy_l4_20160724_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8730108 Mar 30 12:34 dt_global_allsat_phy_l4_20160725_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8728621 Mar 30 12:34 dt_global_allsat_phy_l4_20160726_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8736142 Mar 30 12:34 dt_global_allsat_phy_l4_20160727_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8738473 Mar 30 12:35 dt_global_allsat_phy_l4_20160728_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8738895 Mar 30 12:35 dt_global_allsat_phy_l4_20160729_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8737671 Mar 30 12:35 dt_global_allsat_phy_l4_20160730_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8735994 Mar 30 12:35 dt_global_allsat_phy_l4_20160731_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8729706 Mar 30 12:35 dt_global_allsat_phy_l4_20160801_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8732630 Mar 30 12:35 dt_global_allsat_phy_l4_20160802_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8736713 Mar 30 12:35 dt_global_allsat_phy_l4_20160803_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8734851 Mar 30 12:35 dt_global_allsat_phy_l4_20160804_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8736423 Mar 30 12:35 dt_global_allsat_phy_l4_20160805_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8738137 Mar 30 12:35 dt_global_allsat_phy_l4_20160806_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8732336 Mar 30 12:36 dt_global_allsat_phy_l4_20160807_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8732476 Mar 30 12:36 dt_global_allsat_phy_l4_20160808_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8739606 Mar 30 12:36 dt_global_allsat_phy_l4_20160809_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8740132 Mar 30 12:36 dt_global_allsat_phy_l4_20160810_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8740023 Mar 30 12:36 dt_global_allsat_phy_l4_20160811_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8737046 Mar 30 12:36 dt_global_allsat_phy_l4_20160812_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8734608 Mar 30 12:36 dt_global_allsat_phy_l4_20160813_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8735356 Mar 30 12:36 dt_global_allsat_phy_l4_20160814_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8737329 Mar 30 12:37 dt_global_allsat_phy_l4_20160815_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8730171 Mar 30 12:37 dt_global_allsat_phy_l4_20160816_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8726966 Mar 30 12:37 dt_global_allsat_phy_l4_20160817_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8720845 Mar 30 12:37 dt_global_allsat_phy_l4_20160818_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8713824 Mar 30 12:37 dt_global_allsat_phy_l4_20160819_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8710378 Mar 30 12:37 dt_global_allsat_phy_l4_20160820_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8704098 Mar 30 12:37 dt_global_allsat_phy_l4_20160821_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8702594 Mar 30 12:37 dt_global_allsat_phy_l4_20160822_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8696689 Mar 30 12:37 dt_global_allsat_phy_l4_20160823_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8697117 Mar 30 12:38 dt_global_allsat_phy_l4_20160824_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8696158 Mar 30 12:38 dt_global_allsat_phy_l4_20160825_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8696488 Mar 30 12:38 dt_global_allsat_phy_l4_20160826_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8688477 Mar 30 12:38 dt_global_allsat_phy_l4_20160827_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8687653 Mar 30 12:38 dt_global_allsat_phy_l4_20160828_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8679841 Mar 30 12:38 dt_global_allsat_phy_l4_20160829_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8680574 Mar 30 12:38 dt_global_allsat_phy_l4_20160830_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8687111 Mar 30 12:38 dt_global_allsat_phy_l4_20160831_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8686815 Mar 30 12:38 dt_global_allsat_phy_l4_20160901_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8684415 Mar 30 12:39 dt_global_allsat_phy_l4_20160902_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8681739 Mar 30 12:39 dt_global_allsat_phy_l4_20160903_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8677375 Mar 30 12:39 dt_global_allsat_phy_l4_20160904_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8672784 Mar 30 12:39 dt_global_allsat_phy_l4_20160905_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8671740 Mar 30 12:39 dt_global_allsat_phy_l4_20160906_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8671541 Mar 30 12:39 dt_global_allsat_phy_l4_20160907_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8671060 Mar 30 12:39 dt_global_allsat_phy_l4_20160908_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8669233 Mar 30 12:39 dt_global_allsat_phy_l4_20160909_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8669204 Mar 30 12:39 dt_global_allsat_phy_l4_20160910_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8669927 Mar 30 12:40 dt_global_allsat_phy_l4_20160911_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8670901 Mar 30 12:40 dt_global_allsat_phy_l4_20160912_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8671370 Mar 30 12:40 dt_global_allsat_phy_l4_20160913_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8671348 Mar 30 12:40 dt_global_allsat_phy_l4_20160914_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8673432 Mar 30 12:40 dt_global_allsat_phy_l4_20160915_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8674490 Mar 30 12:40 dt_global_allsat_phy_l4_20160916_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8670984 Mar 30 12:40 dt_global_allsat_phy_l4_20160917_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8670405 Mar 30 12:40 dt_global_allsat_phy_l4_20160918_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8667747 Mar 30 12:40 dt_global_allsat_phy_l4_20160919_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8669620 Mar 30 12:41 dt_global_allsat_phy_l4_20160920_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8670963 Mar 30 12:41 dt_global_allsat_phy_l4_20160921_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8673444 Mar 30 12:41 dt_global_allsat_phy_l4_20160922_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8672203 Mar 30 12:41 dt_global_allsat_phy_l4_20160923_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8676829 Mar 30 12:41 dt_global_allsat_phy_l4_20160924_20170209.nc.gz
-rw-r--r--    1 ftp      ftp       8680390 Mar 30 12:41 dt_global_allsat_phy_l4_20160925_20170209.nc.gz
Out[5]:
'226 Directory send OK.'

get one file, and unzip it


In [6]:
filename="dt_global_allsat_phy_l4_20160925_20170209.nc.gz"
downloadDir = "/Users/pierre/Documents/Presentations/210706_CMEMSArctic/data_tmp"
fHandle = open("%s/%s" %(downloadDir, filename), "wb")
ftp.retrbinary("RETR " + filename , fHandle.write)
fHandle.close()

In [7]:
os.system("gzip -d %s/%s" %(downloadDir, filename))


Out[7]:
0

close the connection to the ftp server


In [8]:
ftp.quit()


Out[8]:
'221 Goodbye.'

Now we are going to download several files.

As an example here, every first and fifteenth of each month for five years are downloaded but you could build any combination thanks to Python.

However you can't use '*' to expand filenames in ftplib, so we have to list all files in the current directory first.


In [24]:
# get back to parent directory on the ftp server
ftp = FTP('ftp.sltac.cls.fr') 
ftp.login('pprandi','PierreCMEMS2017')
ftp.cwd('Core/SEALEVEL_GLO_PHY_L4_REP_OBSERVATIONS_008_047/dataset-duacs-rep-global-merged-allsat-phy-l4-v3')

# get two files a month for five years
for year in np.arange(2010, 2016, 1):
    ftp.cwd("%4i" %year)
    remoteFilesList = ftp.nlst()
    for month in np.arange(1, 13, 1):
        for day in [1, 15]:
            
            print("downloading year %s, month %s, day %s" %(year, month, day))
            pattern = "dt_global_allsat_phy_l4_%4i%02i%02i_" %(year, month, day)
            index = [i for i, elem in enumerate(remoteFilesList) if pattern in elem][0]
            remoteFilename = remoteFilesList[index]
            localFilename = "%s/dt_global_allsat_phy_l4_%4i%02i%02i.nc.gz" %(downloadDir, year, month, day)
            if not os.path.isfile(localFilename[0:-3]):
                fHandle = open("%s" %localFilename, "wb")
                ftp.retrbinary("RETR " + remoteFilename , fHandle.write)
                fHandle.close()
                os.system("gzip -d %s" %localFilename)
    ftp.cwd("..")
    
ftp.quit()


downloading year 2010, month 1, day 1
downloading year 2010, month 1, day 15
downloading year 2010, month 2, day 1
downloading year 2010, month 2, day 15
downloading year 2010, month 3, day 1
downloading year 2010, month 3, day 15
downloading year 2010, month 4, day 1
downloading year 2010, month 4, day 15
downloading year 2010, month 5, day 1
downloading year 2010, month 5, day 15
downloading year 2010, month 6, day 1
downloading year 2010, month 6, day 15
downloading year 2010, month 7, day 1
downloading year 2010, month 7, day 15
downloading year 2010, month 8, day 1
downloading year 2010, month 8, day 15
downloading year 2010, month 9, day 1
downloading year 2010, month 9, day 15
downloading year 2010, month 10, day 1
downloading year 2010, month 10, day 15
downloading year 2010, month 11, day 1
downloading year 2010, month 11, day 15
downloading year 2010, month 12, day 1
downloading year 2010, month 12, day 15
downloading year 2011, month 1, day 1
downloading year 2011, month 1, day 15
downloading year 2011, month 2, day 1
downloading year 2011, month 2, day 15
downloading year 2011, month 3, day 1
downloading year 2011, month 3, day 15
downloading year 2011, month 4, day 1
downloading year 2011, month 4, day 15
downloading year 2011, month 5, day 1
downloading year 2011, month 5, day 15
downloading year 2011, month 6, day 1
downloading year 2011, month 6, day 15
downloading year 2011, month 7, day 1
downloading year 2011, month 7, day 15
downloading year 2011, month 8, day 1
downloading year 2011, month 8, day 15
downloading year 2011, month 9, day 1
downloading year 2011, month 9, day 15
downloading year 2011, month 10, day 1
downloading year 2011, month 10, day 15
downloading year 2011, month 11, day 1
downloading year 2011, month 11, day 15
downloading year 2011, month 12, day 1
downloading year 2011, month 12, day 15
downloading year 2012, month 1, day 1
downloading year 2012, month 1, day 15
downloading year 2012, month 2, day 1
downloading year 2012, month 2, day 15
downloading year 2012, month 3, day 1
downloading year 2012, month 3, day 15
downloading year 2012, month 4, day 1
downloading year 2012, month 4, day 15
downloading year 2012, month 5, day 1
downloading year 2012, month 5, day 15
downloading year 2012, month 6, day 1
downloading year 2012, month 6, day 15
downloading year 2012, month 7, day 1
downloading year 2012, month 7, day 15
downloading year 2012, month 8, day 1
downloading year 2012, month 8, day 15
downloading year 2012, month 9, day 1
downloading year 2012, month 9, day 15
downloading year 2012, month 10, day 1
downloading year 2012, month 10, day 15
downloading year 2012, month 11, day 1
downloading year 2012, month 11, day 15
downloading year 2012, month 12, day 1
downloading year 2012, month 12, day 15
downloading year 2013, month 1, day 1
downloading year 2013, month 1, day 15
downloading year 2013, month 2, day 1
downloading year 2013, month 2, day 15
downloading year 2013, month 3, day 1
downloading year 2013, month 3, day 15
downloading year 2013, month 4, day 1
downloading year 2013, month 4, day 15
downloading year 2013, month 5, day 1
downloading year 2013, month 5, day 15
downloading year 2013, month 6, day 1
downloading year 2013, month 6, day 15
downloading year 2013, month 7, day 1
downloading year 2013, month 7, day 15
downloading year 2013, month 8, day 1
downloading year 2013, month 8, day 15
downloading year 2013, month 9, day 1
downloading year 2013, month 9, day 15
downloading year 2013, month 10, day 1
downloading year 2013, month 10, day 15
downloading year 2013, month 11, day 1
downloading year 2013, month 11, day 15
downloading year 2013, month 12, day 1
downloading year 2013, month 12, day 15
downloading year 2014, month 1, day 1
downloading year 2014, month 1, day 15
downloading year 2014, month 2, day 1
downloading year 2014, month 2, day 15
downloading year 2014, month 3, day 1
downloading year 2014, month 3, day 15
downloading year 2014, month 4, day 1
downloading year 2014, month 4, day 15
downloading year 2014, month 5, day 1
downloading year 2014, month 5, day 15
downloading year 2014, month 6, day 1
downloading year 2014, month 6, day 15
downloading year 2014, month 7, day 1
downloading year 2014, month 7, day 15
downloading year 2014, month 8, day 1
downloading year 2014, month 8, day 15
downloading year 2014, month 9, day 1
downloading year 2014, month 9, day 15
downloading year 2014, month 10, day 1
downloading year 2014, month 10, day 15
downloading year 2014, month 11, day 1
downloading year 2014, month 11, day 15
downloading year 2014, month 12, day 1
downloading year 2014, month 12, day 15
downloading year 2015, month 1, day 1
downloading year 2015, month 1, day 15
downloading year 2015, month 2, day 1
downloading year 2015, month 2, day 15
downloading year 2015, month 3, day 1
downloading year 2015, month 3, day 15
downloading year 2015, month 4, day 1
downloading year 2015, month 4, day 15
downloading year 2015, month 5, day 1
downloading year 2015, month 5, day 15
downloading year 2015, month 6, day 1
downloading year 2015, month 6, day 15
downloading year 2015, month 7, day 1
downloading year 2015, month 7, day 15
downloading year 2015, month 8, day 1
downloading year 2015, month 8, day 15
downloading year 2015, month 9, day 1
downloading year 2015, month 9, day 15
downloading year 2015, month 10, day 1
downloading year 2015, month 10, day 15
downloading year 2015, month 11, day 1
downloading year 2015, month 11, day 15
downloading year 2015, month 12, day 1
downloading year 2015, month 12, day 15
Out[24]:
'221 Goodbye.'

In [25]:
# download one along track file
ftp = FTP('ftp.sltac.cls.fr') 
ftp.login('pprandi','PierreCMEMS2017')
ftp.cwd('/Core/SEALEVEL_GLO_PHY_L3_REP_OBSERVATIONS_008_045/dataset-duacs-rep-global-alg-phy-l3-v3/2016/')
ftp.retrlines('LIST')

filename="dt_global_alg_phy_vfec_l3_20160925_20170209.nc.gz"
downloadDir = "/Users/pierre/Documents/Presentations/201706_CMEMSArctic/data_tmp"
fHandle = open("%s/%s" %(downloadDir, filename), "wb")
ftp.retrbinary("RETR " + filename , fHandle.write)
fHandle.close()

os.system("gzip -d %s/%s" %(downloadDir, filename))

ftp.quit()


-rw-r--r--    1 ftp      ftp        158145 May 02 10:15 dt_global_alg_phy_vfec_l3_20160704_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        322772 May 02 10:15 dt_global_alg_phy_vfec_l3_20160705_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        337258 May 02 10:15 dt_global_alg_phy_vfec_l3_20160706_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        339184 May 02 10:15 dt_global_alg_phy_vfec_l3_20160707_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        327062 May 02 10:15 dt_global_alg_phy_vfec_l3_20160708_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        336791 May 02 10:15 dt_global_alg_phy_vfec_l3_20160709_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        327939 May 02 10:15 dt_global_alg_phy_vfec_l3_20160710_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        339993 May 02 10:15 dt_global_alg_phy_vfec_l3_20160711_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        336228 May 02 10:15 dt_global_alg_phy_vfec_l3_20160712_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        330211 May 02 10:15 dt_global_alg_phy_vfec_l3_20160713_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        341562 May 02 10:15 dt_global_alg_phy_vfec_l3_20160714_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        336501 May 02 10:15 dt_global_alg_phy_vfec_l3_20160715_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        330793 May 02 10:15 dt_global_alg_phy_vfec_l3_20160716_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        342911 May 02 10:15 dt_global_alg_phy_vfec_l3_20160717_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        324702 May 02 10:15 dt_global_alg_phy_vfec_l3_20160718_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        343356 May 02 10:15 dt_global_alg_phy_vfec_l3_20160719_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        342852 May 02 10:15 dt_global_alg_phy_vfec_l3_20160720_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        325686 May 02 10:15 dt_global_alg_phy_vfec_l3_20160721_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        338276 May 02 10:15 dt_global_alg_phy_vfec_l3_20160722_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        339650 May 02 10:15 dt_global_alg_phy_vfec_l3_20160723_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        327352 May 02 10:15 dt_global_alg_phy_vfec_l3_20160724_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        337583 May 02 10:15 dt_global_alg_phy_vfec_l3_20160725_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        328088 May 02 10:15 dt_global_alg_phy_vfec_l3_20160726_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        337988 May 02 10:15 dt_global_alg_phy_vfec_l3_20160727_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        336913 May 02 10:15 dt_global_alg_phy_vfec_l3_20160728_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        329796 May 02 10:15 dt_global_alg_phy_vfec_l3_20160729_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        338384 May 02 10:15 dt_global_alg_phy_vfec_l3_20160730_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        337585 May 02 10:15 dt_global_alg_phy_vfec_l3_20160731_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        331001 May 02 10:15 dt_global_alg_phy_vfec_l3_20160801_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        342018 May 02 10:15 dt_global_alg_phy_vfec_l3_20160802_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        323712 May 02 10:15 dt_global_alg_phy_vfec_l3_20160803_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        342016 May 02 10:15 dt_global_alg_phy_vfec_l3_20160804_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        342129 May 02 10:15 dt_global_alg_phy_vfec_l3_20160805_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        325062 May 02 10:15 dt_global_alg_phy_vfec_l3_20160806_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        337188 May 02 10:15 dt_global_alg_phy_vfec_l3_20160807_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        341758 May 02 10:15 dt_global_alg_phy_vfec_l3_20160808_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        328853 May 02 10:15 dt_global_alg_phy_vfec_l3_20160809_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        337428 May 02 10:15 dt_global_alg_phy_vfec_l3_20160810_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        328754 May 02 10:15 dt_global_alg_phy_vfec_l3_20160811_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        342528 May 02 10:15 dt_global_alg_phy_vfec_l3_20160812_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        336946 May 02 10:15 dt_global_alg_phy_vfec_l3_20160813_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        329664 May 02 10:15 dt_global_alg_phy_vfec_l3_20160814_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        341076 May 02 10:15 dt_global_alg_phy_vfec_l3_20160815_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        339135 May 02 10:15 dt_global_alg_phy_vfec_l3_20160816_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        328619 May 02 10:15 dt_global_alg_phy_vfec_l3_20160817_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        343214 May 02 10:15 dt_global_alg_phy_vfec_l3_20160818_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        323022 May 02 10:15 dt_global_alg_phy_vfec_l3_20160819_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        341969 May 02 10:15 dt_global_alg_phy_vfec_l3_20160820_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        342754 May 02 10:15 dt_global_alg_phy_vfec_l3_20160821_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        329097 May 02 10:15 dt_global_alg_phy_vfec_l3_20160822_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        340957 May 02 10:15 dt_global_alg_phy_vfec_l3_20160823_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        340169 May 02 10:15 dt_global_alg_phy_vfec_l3_20160824_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        330823 May 02 10:15 dt_global_alg_phy_vfec_l3_20160825_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        337846 May 02 10:15 dt_global_alg_phy_vfec_l3_20160826_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        330054 May 02 10:15 dt_global_alg_phy_vfec_l3_20160827_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        341952 May 02 10:15 dt_global_alg_phy_vfec_l3_20160828_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        338802 May 02 10:15 dt_global_alg_phy_vfec_l3_20160829_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        331548 May 02 10:15 dt_global_alg_phy_vfec_l3_20160830_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        344622 May 02 10:15 dt_global_alg_phy_vfec_l3_20160831_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        342560 May 02 10:15 dt_global_alg_phy_vfec_l3_20160901_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        331453 May 02 10:15 dt_global_alg_phy_vfec_l3_20160902_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        344262 May 02 10:15 dt_global_alg_phy_vfec_l3_20160903_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        327792 May 02 10:15 dt_global_alg_phy_vfec_l3_20160904_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        344102 May 02 10:15 dt_global_alg_phy_vfec_l3_20160905_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        345300 May 02 10:15 dt_global_alg_phy_vfec_l3_20160906_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        331512 May 02 10:15 dt_global_alg_phy_vfec_l3_20160907_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        341998 May 02 10:15 dt_global_alg_phy_vfec_l3_20160908_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        341825 May 02 10:15 dt_global_alg_phy_vfec_l3_20160909_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        332460 May 02 10:15 dt_global_alg_phy_vfec_l3_20160910_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        340722 May 02 10:15 dt_global_alg_phy_vfec_l3_20160911_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        334257 May 02 10:15 dt_global_alg_phy_vfec_l3_20160912_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        345831 May 02 10:15 dt_global_alg_phy_vfec_l3_20160913_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        343777 May 02 10:15 dt_global_alg_phy_vfec_l3_20160914_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        336244 May 02 10:15 dt_global_alg_phy_vfec_l3_20160915_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        348231 May 02 10:15 dt_global_alg_phy_vfec_l3_20160916_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        330897 May 02 10:15 dt_global_alg_phy_vfec_l3_20160917_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        349059 May 02 10:15 dt_global_alg_phy_vfec_l3_20160918_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        347705 May 02 10:15 dt_global_alg_phy_vfec_l3_20160919_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        330118 May 02 10:15 dt_global_alg_phy_vfec_l3_20160920_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        345081 May 02 10:15 dt_global_alg_phy_vfec_l3_20160921_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        344641 May 02 10:15 dt_global_alg_phy_vfec_l3_20160922_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        333047 May 02 10:15 dt_global_alg_phy_vfec_l3_20160923_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        343056 May 02 10:15 dt_global_alg_phy_vfec_l3_20160924_20170209.nc.gz
-rw-r--r--    1 ftp      ftp        333531 May 02 10:15 dt_global_alg_phy_vfec_l3_20160925_20170209.nc.gz
Out[25]:
'221 Goodbye.'

In [ ]: