Quero poder automatizar ou fazer download em lote de dados do Sentinel (em particular o S2).
Estou tentando usar o protocolo OData, conforme descrito no guia do usuário do Sentinels Scientific Data Hub sobre APIs e scripts em lote . Como exemplo, tento baixar um produto completo usando o wget:
wget --no-check-certificate --user=username --password=usrpass "https://scihub.copernicus.eu/apihub/odata/v1/Products('18f7993d-eae1-4f7f-9d81-d7cf19c18378')/$value"
(Com um nome de usuário e senha registrados), mas eu apenas recebo o index.html:
<?xml version='1.0' encoding='utf-8'?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://scihub.copernicus.eu/dhus/odata/v1/"><id>https://scihub.copernicus.eu/dhus/odata/v1/Products('18f7993d-eae1-4f7f-9d81-d7cf19c18378')</id><title type="text">S1A_IW_SLC__1SDV_20141023T172123_20141023T172150_002960_0035D1_9743</title><updated>2014-12-07T17:06:00.324Z</updated><category term="DHuS.Product" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/><link href="Products('18f7993d-eae1-4f7f-9d81-d7cf19c18378')" rel="edit" title="Product"/><link href="Products('18f7993d-eae1-4f7f-9d81-d7cf19c18378')/$value" rel="edit-media" type="application/octet-stream"/><link href="Products('18f7993d-eae1-4f7f-9d81-d7cf19c18378')/Products" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products" title="Products" type="application/atom+xml;type=feed"/><link href="Products('18f7993d-eae1-4f7f-9d81-d7cf19c18378')/Nodes" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Nodes" title="Nodes" type="application/atom+xml;type=feed"/><link href="Products('18f7993d-eae1-4f7f-9d81-d7cf19c18378')/Attributes" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attributes" title="Attributes" type="application/atom+xml;type=feed"/><link href="Products('18f7993d-eae1-4f7f-9d81-d7cf19c18378')/Class" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Class" title="Class" type="application/atom+xml;type=entry"/><content type="application/octet-stream" src="Products('18f7993d-eae1-4f7f-9d81-d7cf19c18378')/$value"/><m:properties><d:Id>18f7993d-eae1-4f7f-9d81-d7cf19c18378</d:Id><d:Name>S1A_IW_SLC__1SDV_20141023T172123_20141023T172150_002960_0035D1_9743</d:Name><d:ContentType>application/octet-stream</d:ContentType><d:ContentLength>8544532822</d:ContentLength><d:ChildrenNumber>2</d:ChildrenNumber><d:Value m:null="true"/><d:CreationDate>2014-12-07T17:06:00.324</d:CreationDate><d:IngestionDate>2014-12-07T17:06:00.324</d:IngestionDate><d:EvictionDate m:null="true"/><d:ContentDate m:type="DHuS.TimeRange"><d:Start>2014-10-23T17:21:23.23</d:Start><d:End>2014-10-23T17:21:50.495</d:End></d:ContentDate><d:Checksum m:type="DHuS.Checksum"><d:Algorithm>MD5</d:Algorithm><d:Value>C4415763B3198B7A2874C2A60B2CDCDC</d:Value></d:Checksum><d:ContentGeometry><gml:Polygon srsName="http://www.opengis.net/gml/srs/epsg.xml#4326" xmlns:gml="http://www.opengis.net/gml">
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>41.289764,6.891860 41.685265,9.900283 40.048470,10.244140 39.652199,7.311233 41.289764,6.891860</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon></d:ContentGeometry><d:Metalink><metalink xmlns="urn:ietf:params:xml:ns:metalink"><file name ="S1A_IW_SLC__1SDV_20141023T172123_20141023T172150_002960_0035D1_9743.zip"><url>https://scihub.copernicus.eu/dhus/odata/v1/Products('18f7993d-eae1-4f7f-9d81-d7cf19c18378')/$value</url></file></metalink></d:Metalink></m:properties></entry>
No entanto, se eu colocar a consulta URI https://scihub.copernicus.eu/dhus/odata/v1/Products%28'18f7993d-eae1-4f7f-9d81-d7cf19c18378'%29/$value
diretamente no navegador, ela fará o download do arquivo zip do produto.
Eu também tentei usar curl como descrito em uma resposta a esta pergunta
curl -u username:usrpass -JO "https://scihub.copernicus.eu/dhus/odata/v1/Products('18f7993d-eae1-4f7f-9d81-d7cf19c18378')/$value"
mas eu recebo o erro
Aviso: o nome do arquivo remoto não tem tamanho!
Ainda não consigo acessar o APIhub, apenas o hub de ciências (embora um colega com acesso ao APIhub também tenha tentado isso e tenha o mesmo problema). Sou capaz de usar o gui do hub científico para fazer o download interativo de dados, mas gostaria de poder automatizar o processo. Existem scripts python e shell scripts de terceiros, mas muitos usam o hub da API e eu gostaria de entender o que estou fazendo para desenvolver scripts específicos.