Problems to untar file with MODIS PAR L3 images

Please enter here to ask a question about any NASA Science related topics!
Post Reply
laurare
Posts: 2
Joined: Wed Aug 04, 2021 1:36 pm America/New_York

Problems to untar file with MODIS PAR L3 images

by laurare » Wed Aug 04, 2021 1:52 pm America/New_York

Hello,

last week I tried to download daily MODIS PAR l3 images from https://oceancolor.gsfc.nasa.gov/l3/
I clicked on "extract or download l3 data" bottom to reduce the region and period of time. I got the order I wanted with the manifest.txt file, and I did the same as last time when I downloaded MODIS chla data with Python:

# Download PAR data
import wget
import tarfile

output_directory = '/Users/laurare/OneDrive - cima.fcen.uba.ar/PICT-2017-2386_Cele/PAR_modis'

url = 'https://oceandata.sci.gsfc.nasa.gov/cgi ... sted_files'

file = wget.download(url,output_directory)
tar = tarfile.open(file,'r:*')
tar.extractall(path = '/Users/laurare/OneDrive - cima.fcen.uba.ar/OneDrive - cima.fcen.uba.ar/PICT-2017-2386_Cele/PAR_modis/')
tar.close()

However, this time I couldn't open the tar file. I thought it may be a mac problem, so I asked a colleague to try in linux, then on ubuntu and I also tried using wget and tar on linux terminal instead of python. I even reduced the period of time, hoping that the problem was related with the size of the file, and nothing worked.
I also thought that I wasn't downloading the file properly and I tried to use the appkey:

url = 'https://oceandata.sci.gsfc.nasa.gov/cgi ... 3bd4174e9f'

Any help is welcome. Thank you!
Laura

Tags:

OB.DAAC - amscott
User Services
User Services
Posts: 100
Joined: Mon Jun 22, 2020 5:24 pm America/New_York
Answers: 1

Re: Problems to untar file with MODIS PAR L3 images

by OB.DAAC - amscott » Tue Sep 21, 2021 12:33 pm America/New_York

Hello,

This post scrolled past before we saw it to respond. Did you resolve this issue or can we still help you with something?
You can also look here for search and data download methods:
https://oceancolor.gsfc.nasa.gov/data/download_methods/

laurare
Posts: 2
Joined: Wed Aug 04, 2021 1:36 pm America/New_York

Re: Problems to untar file with MODIS PAR L3 images

by laurare » Tue Sep 21, 2021 5:07 pm America/New_York

I still have problems. I've tried

echo "machine urs.earthdata.nasa.gov login USERNAME password PASSWD" > ~/.netrc ; > ~/.urs_cookies
chmod 0600 ~/.netrc

on linux terminal, where I replaced USERNAME and PASSWD with my credentials. Then, I wrote the following and nothing happened:

wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --auth-no-challenge=on --no-check-certificate --content-disposition -i https://oceandata.sci.gsfc.nasa.gov/cgi ... sted_files

I have a question about the netrc file, do I have to do it once? or everytime that I want to download data?

OB.DAAC - SeanBailey
User Services
User Services
Posts: 1225
Joined: Wed Sep 18, 2019 6:15 pm America/New_York
Answers: 1

Re: Problems to untar file with MODIS PAR L3 images

by OB.DAAC - SeanBailey » Wed Sep 22, 2021 9:24 am America/New_York

Laura,
The .netrc set up is only needed once (unless you change your password or delete the .netrc file)

Since you are using python, I would recommend using the requests module to accomplish the file retrieval, rather than wget.

You could also just grab the obdaac_download script (available from the webpage Alicia mentioned) - it uses the requests module, but also has some other niceties for data retrieval options from our distribution servers.

Sean

Post Reply