Downloading level 4 ccmp data files via podaacpy

Downloading level 4 ccmp data files via podaacpy

Postby stephaniehopkins » Thu Jul 25, 2019 5:29 am

So I am having difficulty getting podaacpy to download the data once the data list is populated. But I ultimately want to download the full data set for this series so I can work with it. Unfortunately, I have very limited programming skills as I am just learning python so this is rather complicated. But, I usually use R-Studio for everything if not ArcGIS. I have attached a copy of my script which is a slightly modified version of the tutorial for using podaacpy to interact with podaac drive.
--------------------------------------------------------------------

# Import the libraries we require

from pprint import pprint
from podaac import podaac as podaac
from podaac import podaac_utils as utils
from podaac import drive as drive

--------------------------------------------------------------------

# Create instances of the classes...podaac_signin.ini is username,
# website url, and password not shown here

p = podaac.Podaac()
u = utils.PodaacUtils()
d = drive.Drive('podaac_signin.ini', None, None)

--------------------------------------------------------------------

# Discover PO.DAAC CCMP3.5a Ocean Wind data for Europe Using # specific parameters to confine the discovery space, opt for full # metadata record in atom format

ds_result = p.dataset_search(keyword='CCMP',
start_time='1987-07-05T00:00:00Z',
end_time='2011-12-27T24:59:59Z',
short_name='CCMP_MEASURES_ATLAS_L4_OW_L3_5A_5DAY_WIND_VECTORS_FLK',
process_level='4',
bbox='-44.14,71.84,-22.2,64.4',
pretty='True',
format='atom',
full='True')
print(ds_result)

--------------------------------------------------------------------

# Because we requested the Full response, we can actually extract
# the PO.DAAC Drive URL for all granules contained within this # dataset.

search_str = 'https://podaac-tools.jpl.nasa.gov/drive/files/'
drive_path = [ str(i) for i in ds_result.strip().split() if search_str in i ][0]
print(drive_path[5:])

--------------------------------------------------------------------

# Search for Granules of interest relating to the above discovery # operation. Execute a search for specific granules from the # following dataset...based upon temporal (start and end) and # spatial constraints.

result = p.granule_search(dataset_id='PODAAC-CCF35-01AD5',
start_time='1987-07-05T00:00:00Z',
end_time='2011-12-27T24:59:59Z',
bbox='-44.14,71.84,-22.2,64.4',
sort_by='timeAsc',
items_per_page='400',
format='atom',
pretty='True')
print(result)

searchStr = 'totalResults'
numResultsStr = [ str(i) for i in result.strip().split() if searchStr in i ]
print(numResultsStr)

--------------------------------------------------------------------

# The actual granule names

pprint(u.mine_granules_from_granule_search(granule_search_response=str(result)))

--------------------------------------------------------------------

# Simply need to reproduce the Drive URL's for the above granules.
# This unfortunately does not list the files like in the tutorial # video though it seems to work otherwise.

granules = d.mine_drive_urls_from_granule_search(granule_search_response=(str(result)))
pprint(granules)

--------------------------------------------------------------------

# Retrieve these granules from PO.DAAC Drive.
# Note that the download_granules function actually decompresses
# and removes the compressed archive files locally for us. This seems to be as far as I can get.

d.download_granules(granule_collection=granules, path='http://localhost:8888/tree/GitHub.respository/podaacpy/Projects/CCMP_Winspeed')
stephaniehopkins
 
Posts: 1
Joined: Thu Jul 25, 2019 4:59 am

Re: Downloading level 4 ccmp data files via podaacpy

Postby yiboj » Tue Jul 30, 2019 8:26 am

Hi,

Thanks for the inquiry.
The current podaac.ini or podaac_signin.ini file is set to the demo user only for podaacdemo who has limited access to the Drive. User has to modify the podaac.ini file to his/her own credential in order to access and download files from Drive.

Hope this helps.

Regards,

PODAAC DE
yiboj
 
Posts: 93
Joined: Mon Mar 30, 2015 11:22 am

Re: Downloading level 4 ccmp data files via podaacpy

Postby lmcgibbn » Mon Aug 05, 2019 1:55 pm

@stephaniehopkins are you still having an issue here?
lmcgibbn
 
Posts: 56
Joined: Wed Feb 17, 2016 9:36 pm


Return to PO.DAAC Drive