<div dir="ltr">Hi all,<div><br></div><div>I'm coming back to that subject because the GPM datas are finally available since December 2014. The original data are stored in HDF5, which is supported by GDAL.</div><div>However, I had a problem with the geo-referencing of the data. It seems that the lat/long coordinates are flipped.</div><div>The problem seems to come from GDAL, as the HDF5 driver still don't support GPM data:</div><div><a href="http://www.gdal.org/frmt_hdf5.html" target="_blank">http://www.gdal.org/frmt_hdf5.html</a></div><div><br></div><div>I've actually downloaded a regional extracts the data in NetCDF from a NASA website, although I can't remember where exactly, as there are several services. Those data suffer from the same problem of inverted coordinates.</div><div><br></div><div>So I used the ncpdq from NCO package to fix the NetCDF directly, and a tiny Python script to batch process the files :</div><div><br></div><div>###</div><div>#!/usr/bin/env python<br></div><div><div>from os import listdir</div><div>import subprocess</div></div><div>for input_file in listdir(main_path):<br></div><div><div>    output_file = input_file + '_fixed'<br></div><div>    subprocess.call(['ncpdq','-a', 'lat,lon', input_file, output_file])</div></div><div>###</div><div><br></div><div>After batch import the data in GRASS, maintaining the original name including timestep, which looks like this:</div><div>3B-HHR.MS.MRG.3IMERG.20140619-S000000-E002959.0000.V03D<br></div><div><br></div><div>A Python script to register the maps in temporal framework:</div><div><br></div><div>#####</div><div>#!/usr/bin/env python<br></div><div>import grass.script as grass<br></div><div><div><br></div><div># retrieve the list of maps</div><div>maplist = grass.read_command('g.list', type = 'raster',</div><div>    pattern = '*IMERG*')</div><div><br></div><div># turn result in a list</div><div>maplist = maplist.split()</div><div><br></div><div>file_name = 'gpm_timestamp.txt'</div><div><br></div><div># creating the file containing the timepstamp</div><div>list_file = open(file_name,'w')</div><div><br></div><div># iterate through the maps</div><div>for input_map in maplist:</div><div>    # split line to keep only the timestamp</div><div>    raw_ts = input_map.split('.')[4]</div><div>    # isolate the date</div><div>    raw_mapdate = raw_ts.split('-')[0]</div><div>    # put the date in form</div><div>    mapdate = raw_mapdate[:4] + '-' + raw_mapdate[4:6] + \</div><div>        '-' + raw_mapdate[6:]</div><div>    # isolate the start time</div><div>    raw_start_time = raw_ts.split('-')[1]</div><div>    # put the date in form</div><div>    start_time = raw_start_time[1:3] + ':' + \</div><div>        raw_start_time[3:5] + ':' + raw_start_time[5:]</div><div>    # isolate the end time</div><div>    raw_end_time = raw_ts.split('-')[2]</div><div>    # put the end time in form</div><div>    end_time = raw_end_time[1:3] + ':' + \</div><div>        raw_end_time[3:5] + ':' + raw_end_time[5:]</div><div>    # put timestamp in form</div><div>    timestamp = mapdate + ' ' + start_time + '|' + mapdate + \</div><div>        ' ' + end_time</div><div><br></div><div>    # format the whole line</div><div>    line = input_map + '|' + timestamp + '\n'</div><div>    </div><div>    # write line to the file</div><div>    list_file.write(line)</div><div><br></div><div># close the file</div><div>list_file.close()</div><div><br></div><div># register the maps in grass space_time dataset</div><div>grass.run_command('t.register', input = 'GPM_ZMCM', file = file_name)</div></div><div><br></div><div>#####</div><div><br></div><div><br></div><div>Hope it will help other peoples having trouble using those data.</div><div><br></div><div>Regards,</div><div>Laurent</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-11-06 5:15 GMT-06:00 maning sambale <span dir="ltr"><<a href="mailto:emmanuel.sambale@gmail.com" target="_blank">emmanuel.sambale@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks Markus.  Already registered and can access ftp.  Unfortunately,<br>
processed (L3) rainfall data will be released by Dec 2014.<br>
Will just wait then. :)<br>
<span class="im HOEnZb"><br>
On Thu, Nov 6, 2014 at 4:27 PM, Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>> wrote:<br>
> On Mon, Nov 3, 2014 at 10:18 AM, maning sambale<br>
> <<a href="mailto:emmanuel.sambale@gmail.com">emmanuel.sambale@gmail.com</a>> wrote:<br>
>> Has anyone here able to archive and load GPM dataset into GRASS?  I<br>
>> was able to get TRMM netcdf in my area of interest before, but I can't<br>
>> find the tools to automate GPM downloads.<br>
>><br>
>> Thanks!<br>
>><br>
>> [0] <a href="http://www.nasa.gov/mission_pages/GPM/main/" target="_blank">http://www.nasa.gov/mission_pages/GPM/main/</a><br>
><br>
> They state<br>
><br>
> "All data are freely available through the NASA's Precipitation<br>
> Processing System at <a href="http://pps.gsfc.nasa.gov" target="_blank">http://pps.gsfc.nasa.gov</a>"<br>
><br>
> --> "Register and search for GPM and TRMM data, order custom subsets<br>
> and set up subscriptions using PPS Data Products Ordering Interface<br>
> (STORM)."<br>
><br>
> At time the server seems to be down?<br>
><br>
> Markus<br>
<br>
<br>
<br>
</span><span class="im HOEnZb">--<br>
cheers,<br>
maning<br>
------------------------------------------------------<br>
"Freedom is still the most radical idea of all" -N.Branden<br>
wiki: <a href="http://esambale.wikispaces.com/" target="_blank">http://esambale.wikispaces.com/</a><br>
blog: <a href="http://epsg4253.wordpress.com/" target="_blank">http://epsg4253.wordpress.com/</a><br>
------------------------------------------------------<br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</div></div></blockquote></div><br></div>