NASA-DEVELOP / dnppy

DEVELOP National Program Python package for use with NASA data and GIS!
https://nasa-develop.github.io/dnppy/
Other
82 stars 40 forks source link

fetch_MPE pass fail and not recognizing zipped files. #41

Open lancewatkins opened 9 years ago

lancewatkins commented 9 years ago

The function successfully downloads files with the "nws_precip_conus_yyyymmdd.nc" file name based on date range defined by the user. However, I'm realizing it's not shooting back an error when files requested do not exist. For example, I requested a range Jan 1st 2002 through Jan 1st 2014. It downloaded all these files and it appears they are netcdf files. However, when you look at the actually ftp there is only data for 2005 onward. If I try and read in the downloaded files prior to 2005 the file format isn't recognized as a NetCDF.

Additionally, some of the "nws_precip_conus_yyyymmdd.nc" files on the ftp are double zipped as .tar.gz. However, when the fetch_MPE downloads the files they appear as just the nc file but still can't be read in. There didn't appear to be code within the fetch_MPE for checking to see if the file is zipped and if so unzipping the file.

Jwely commented 9 years ago

the empty netcdf issue should now be fixed, but the fact that this function may sometimes need to download files with a tar.gz extension and extract them still needs to be addressed.