[GRASS-dev] Re: [GRASS-user] how to import NetCDF data??

Moskovitz, Bob Bob.Moskovitz at conservation.ca.gov
Wed Feb 8 14:14:43 EST 2012


By the way, I've been wanting to import some tsunami models into GRASS, but it is a pain to extract 100's of time slices with gdal_translate and then import them into GRASS.  So, an easy way to import NetCDF files into GRASS would make my job easier.  Looking forward to giving Soren's new temporal GIS framework a try!

Bob Moskovitz
Seismic Hazards Mapping Program
California Geological Survey

-----Original Message-----
From: grass-dev-bounces at lists.osgeo.org on behalf of Michael Barton
Sent: Wed 2/8/2012 9:57 AM
To: Jennifer Boehnert
Cc: Helena Mitasova; Kirk Wythers; developers grass-developers; Kyngesburye William; GRASS at lists.osgeo.org
Subject: [GRASS-dev] Re: [GRASS-user] how to import NetCDF data??
 
This will be even more important with Soren's new temporal GIS framework. Many netcdf climate files are the equivalent of 'time-cubes'. Being able to read/write these easily would provide a very rich source of data to use in temporal GIS analyses.

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity 
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

voice: 	480-965-6262 (SHESC), 480-727-9746 (CSDC)
fax:          480-965-7671 (SHESC),  480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu











On Feb 8, 2012, at 10:14 AM, Jennifer Boehnert wrote:

> Thank you everyone for all the support, suggestions and feedback.  I am 
> trying to create a course using GRASS which I would teach in Latin 
> America and eventually hopefully in Africa working on vulnerability 
> assessements using climate change model output from NCAR.  My netCDF 
> data is from the CCSM which was in by the IPCC AR4, it is netCDF3 and 
> using the CF-convention.  It is a pretty typical netCDF file and it 
> would be great if we could read it into GRASS directly without having to 
> convert it to a geotiff or any other format, if possible.
> Thanks Jennifer
> 
> 
> On 2/8/2012 10:05 AM, Michael Barton wrote:
>> Lack of NetCDF support would be a problem for sure. We wondered about
>> that. Jennifer is trying on Windows and I'm on a Mac.
>> 
>> Michael
>> ____________________
>> C. Michael Barton
>> Director, Center for Social Dynamics & Complexity
>> Professor of Anthropology, School of Human Evolution & Social Change
>> Arizona State University
>> 
>> voice: 480-965-6262 (SHESC), 480-727-9746 (CSDC)
>> fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)
>> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> On Feb 8, 2012, at 9:16 AM, Kirk Wythers wrote:
>> 
>>> Michael,
>>> 
>>> I could not open the file in GRASS either. I have attached the errors
>>> I got. They look like the same that you were describing (I tried both
>>> with and without the -o flag). I did however remember the work around
>>> I used, which was to:
>>> 
>>> 1. import the .nc files into MATLAB
>>> 2. Export as GeoTIffs
>>> 3. Read the GeoTiffs into GRASS
>>> 
>>> This made sense for me partly because I needed to aggregate daily
>>> values to monthly means which I did in step 1, but then never thought
>>> much more about why I couldn't import directly into GRASS . Your
>>> problem motivated me to look into why I needed this workaround in the
>>> first place (which is not much of a workaround unless you have access
>>> to MATLAB). which appears to be that my gdal does not have GMT/netcdf
>>> support either (as Markus pointed out yesterday). I am also using
>>> WIlliams binaries and frameworks.
>>> 
>>> I agree that more detail in the wiki would be helpful, but I think the
>>> first step is to compile to update gdal with GMT/NetCDF support.
>>> Perhaps William would be interested?
>>> 
>>> 
>>> ===================================================================================================================================
>>> GRASS ERRORS:
>>> 
>>> 
>>> GRASS 6.4.1 (latlon):~ > r.in.gdal
>>> input=~/Desktop/ppt_SRESA2_mid_annual_down_anomaly.nc
>>> output=ppt_SRESA2_mid_annual_down_anomaly
>>> ERROR: Projection of dataset does not appear to match current location.
>>> 
>>> Location PROJ_INFO is:
>>> name: Lat/Lon
>>> proj: ll
>>> datum: nad83
>>> ellps: grs80
>>> towgs84: 0,0,0,0,0,0,0
>>> no_defs: defined
>>> 
>>> Import dataset PROJ_INFO is:
>>> cellhd.proj = 0 (unreferenced/unknown)
>>> 
>>> You can use the -o flag to r.in.gdal to override this check and use
>>> the location definition for the dataset.
>>> Consider generating a new location from the input dataset using the
>>> 'location' parameter.
>>> 
>>> GRASS 6.4.1 (latlon):~ > r.in.gdal -o
>>> input=~/Desktop/ppt_SRESA2_mid_annual_down_anomaly.nc
>>> output=ppt_SRESA2_mid_annual_down_anomaly
>>> WARNING: Over-riding projection check
>>> WARNING: G_set_window(): Illegal latitude for North
>>> GRASS 6.4.1 (latlon):~ >
>>> ===================================================================================================================================
>>> 
>>> 
>>> On Feb 7, 2012, at 9:10 PM, Michael Barton wrote:
>>> 
>>>> Thanks Kirk,
>>>> 
>>>> Here is a copy of the smallest file we tried. The big ones gave
>>>> identical errors.
>>>> 
>>>> Michael
>>>> 
>>>> <ppt_SRESA2_mid_annual_down_anomaly.nc>
>>>> 
>>>> ____________________
>>>> C. Michael Barton
>>>> Director, Center for Social Dynamics & Complexity
>>>> Professor of Anthropology, School of Human Evolution & Social Change
>>>> Arizona State University
>>>> 
>>>> voice: 480-965-6262 (SHESC), 480-727-9746 (CSDC)
>>>> fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)
>>>> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
>>>> <http://csdc.asu.edu/>
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On Feb 7, 2012, at 11:49 AM, Kirk Wythers wrote:
>>>> 
>>>>> I had to import a bunch of SSURGO NetCDF data not too long ago
>>>>> Michael (I was going back and forth with GRASS and MATLAB). I don't
>>>>> seem to remember having any trouble with gdal (which means that it
>>>>> must have worked!) Are you sure that the NetCDF is Lat Long?
>>>>> 
>>>>> What was your error exactly? Is the file too big to share? If not
>>>>> send it to me and I'll take a look.
>>>>> 
>>>>> Best,
>>>>> 
>>>>> Kirk
>>>>> 
>>>>> Kirk R. Wythers
>>>>> Department of Forest Resources
>>>>> University of Minnesota
>>>>> St. Paul, MN 55108
>>>>> tel: 612.625.2261
>>>>> email: kwythers at umn.edu <mailto:kwythers at umn.edu>
>>>>> 
>>>>> 
>>>>> On Feb 7, 2012, at 12:33 PM, Michael Barton wrote:
>>>>> 
>>>>>> I'm trying to help someone at NCAR import NetCDF data and we keep
>>>>>> getting an illegal north latitude error. Looking at the GDAL info,
>>>>>> I think we need to specify some additional metadata, but the GDAL
>>>>>> page stops short of giving an example of how to do this. Has anyone
>>>>>> imported climate data this way?
>>>>>> 
>>>>>> Thanks
>>>>>> Michael
>>>>>> ____________________
>>>>>> C. Michael Barton
>>>>>> Director, Center for Social Dynamics & Complexity
>>>>>> Professor of Anthropology, School of Human Evolution & Social Change
>>>>>> Arizona State University
>>>>>> 
>>>>>> voice: 480-965-6262 (SHESC), 480-727-9746 (CSDC)
>>>>>> fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)
>>>>>> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
>>>>>> <http://csdc.asu.edu/>
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> _______________________________________________
>>>>>> grass-user mailing list
>>>>>> grass-user at lists.osgeo.org <mailto:grass-user at lists.osgeo.org>
>>>>>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>>>> 
>>>> 
>>> 
>> 
> 
> -- 
> Jennifer Boehnert
> GIS Coordinator
> National Center of Atmospheric Research
> PO Box 3000
> Boulder, CO, 80307

_______________________________________________
grass-dev mailing list
grass-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev





More information about the grass-dev mailing list