NetCDF rotated pole

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

NetCDF rotated pole

Eduardo Klein
Hi,

Is there any way to read a NetCDF file which has a rotated pole Mercator
projection and have it inside GRASS with the North pole at North?

I'm trying to use AVISO SSH products on GRASS 6.4.1 and gdal 1.8.0

Thanks!

--
Eduardo Klein
Lab Sensores Remotos e
Instituto de Tecnología y Ciencias Marinas
Universidad Simón Bolívar
Caracas, Venezuela
ph (58) (212) 906-3111 ext 6700
fax (58) (212( 906-3111 ext 6701
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: NetCDF rotated pole

Michael Barton
I'm at NCAR right now and I'm doing that very thing today in fact.

Once I have an answer as to the difference between TLAT and ULAT, and TLONG and ULONG within the NetCDF files, I'll be able to give you a full work flow for this.

Michael

On Mar 19, 2012, at 2:44 PM, <[hidden email]> wrote:

> Message: 3
> Date: Mon, 19 Mar 2012 13:20:33 -0430
> From: Eduardo Klein <[hidden email]>
> Subject: [GRASS-user] NetCDF rotated pole
> To: [hidden email]
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi,
>
> Is there any way to read a NetCDF file which has a rotated pole Mercator
> projection and have it inside GRASS with the North pole at North?
>
> I'm trying to use AVISO SSH products on GRASS 6.4.1 and gdal 1.8.0
>
> Thanks!
>
> --
> Eduardo Klein
> Lab Sensores Remotos e
> Instituto de Tecnolog?a y Ciencias Marinas
> Universidad Sim?n Bol?var
> Caracas, Venezuela
> ph (58) (212) 906-3111 ext 6700
> fax (58) (212( 906-3111 ext 6701

_____________________
C. Michael Barton
Visiting Scientist, Integrated Science Program
National Center for Atmospheric Research &
University Corporation for Atmospheric Research
303-497-2889 (voice)

Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: NetCDF rotated pole

peifer
In reply to this post by Eduardo Klein
On 19/03/2012 18:50, Eduardo Klein wrote:
> Hi,
>
> Is there any way to read a NetCDF file which has a rotated pole Mercator
> projection and have it inside GRASS with the North pole at North?
>
> I'm trying to use AVISO SSH products on GRASS 6.4.1 and gdal 1.8.0
>
> Thanks!
>

This is possible but works in a somewhat counter-intuitive way. See my
below explanations which I have sent to a colleague, a couple of weeks
ago. I assume that you can apply the steps in analogy.

Hope this helps, Hermann


=========================================================
How to re-project "rotated pole lat/lon grids" with GRASS
=========================================================

0. On the command line, one can re-project from "rotated lat/lon
coordinates" to "normal lat/lon coordinates" by using:

$ proj -v -f "%.6f" -m 57.2957795130823 +proj=ob_tran +o_proj=latlon
+o_lon_p=-162 +o_lat_p=39.25 +lon_0=180

...and for the opposite direction (from normal to rotated coordinates),
one uses:

$ invproj -v -f "%.6f" -m 57.2957795130823 +proj=ob_tran +o_proj=latlon
+o_lon_p=-162 +o_lat_p=39.25 +lon_0=180

I noted that the proj/invproj (i.e. forward/inverse projection) logic is
opposite to what I would expect.

1. gdalwarp cannot be used for re-projection, as GDAL/OGR only supports
a subset of the projections known in PROJ.4. ob_tran is NOT part of the
supported subset :-(.

2. GRASS *can* be used for re-projection, by doing the following steps:

a) Create a regular WGS84 location in GRASS, which has these projection
parameters

==> PROJ_INFO <==
name: Latitude-Longitude
datum: wgs84
towgs84: 0.000,0.000,0.000
proj: ll
ellps: wgs84

==> PROJ_UNITS <==
unit: degree
units: degrees
meters: 1.0

b) Import the NetCDF data into WGS84 GRASS location, disable coordinate
system check with -o

c) Create an ob_tran GRASS location, which has these projection parameters:

==> PROJ_INFO <==
name: General Oblique Transformation
datum: wgs84
towgs84: 0.000,0.000,0.000
proj: ob_tran
o_proj: latlon
ellps: wgs84
a: 6378137.0000000000
es: 0.0066943800
f: 298.2572235630
lat_0: 0.0000000000
lon_0: 180.0000000000
o_lat_p: 39.2500000000
o_lon_p: -162.0000000000

==> PROJ_UNITS <==
unit: meter
units: meters
meters: 0.0174532925

(The conversion factor 0. 0174532925 is pi/180, used for the
degree/radians conversion.)

Example re-projection, from wgs84 to ob_tran location:
$ r.proj precip.1 location=wgs84 mapset=PERMANENT out=precip.1
method=nearest   # or bilinear

NB: The procedure intentionally ignores that the original (rotated)
lat/lon coordinates are based on a spherical Earth and just uses the
given coordinate values on the WGS84 ellipsoid. This is usually better
than trying to apply a "datum shift" between sphere and ellipsoid. The
PROJ software behaves by default in a similar way.
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: NetCDF rotated pole

Michael Barton
In reply to this post by Michael Barton
Edwardo,

I am attaching a PDF and RTF of the workflow I used to import paleocurrent data from a NetCDF file with rotated poles. While it may not exactly match your file, it should give you an idea of how to proceed. Let me know how it comes out.



Michael

On Mar 20, 2012, at 6:18 AM, Eduardo Klein wrote:

> Thanks Michael, your advice will be much appreciated!.
>
> Saludos, EKS
>
>
> On 03/19/2012 04:39 PM, Michael Barton wrote:
>> I'm at NCAR right now and I'm doing that very thing today in fact.
>>
>> Once I have an answer as to the difference between TLAT and ULAT, and TLONG and ULONG within the NetCDF files, I'll be able to give you a full work flow for this.
>>
>> Michael
>>
>> On Mar 19, 2012, at 2:44 PM,<[hidden email]>  wrote:
>>
>>> Message: 3
>>> Date: Mon, 19 Mar 2012 13:20:33 -0430
>>> From: Eduardo Klein<[hidden email]>
>>> Subject: [GRASS-user] NetCDF rotated pole
>>> To: [hidden email]
>>> Message-ID:<[hidden email]>
>>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>>
>>> Hi,
>>>
>>> Is there any way to read a NetCDF file which has a rotated pole Mercator
>>> projection and have it inside GRASS with the North pole at North?
>>>
>>> I'm trying to use AVISO SSH products on GRASS 6.4.1 and gdal 1.8.0
>>>
>>> Thanks!
>>>
>>> --
>>> Eduardo Klein
>>> Lab Sensores Remotos e
>>> Instituto de Tecnolog?a y Ciencias Marinas
>>> Universidad Sim?n Bol?var
>>> Caracas, Venezuela
>>> ph (58) (212) 906-3111 ext 6700
>>> fax (58) (212( 906-3111 ext 6701
>>
>> _____________________
>> C. Michael Barton
>> Visiting Scientist, Integrated Science Program
>> National Center for Atmospheric Research&
>> University Corporation for Atmospheric Research
>> 303-497-2889 (voice)
>>
>> Director, Center for Social Dynamics&  Complexity
>> Professor of Anthropology, School of Human Evolution&  Social Change
>> Arizona State University
>> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
>>
>
> --
> Eduardo Klein
> Lab Sensores Remotos e
> Instituto de Tecnología y Ciencias Marinas
> Universidad Simón Bolívar
> Caracas, Venezuela
> ph (58) (212) 906-3111 ext 6700
> fax (58) (212( 906-3111 ext 6701
_____________________
C. Michael Barton
Visiting Scientist, Integrated Science Program
National Center for Atmospheric Research &
University Consortium for Atmospheric Research
303-497-2889 (voice)

Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu






_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user

processing workflow for current data.pdf (90K) Download Attachment
processing workflow for current data.rtf (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: NetCDF rotated pole

Eduardo Klein
Michael,

Thanks a lot for the instructions. It worked perfectly on my files!

Saludos, EKS


On 03/20/2012 05:42 PM, Michael Barton wrote:

> Edwardo,
>
> I am attaching a PDF and RTF of the workflow I used to import paleocurrent data from a NetCDF file with rotated poles. While it may not exactly match your file, it should give you an idea of how to proceed. Let me know how it comes out.
>
>
>
>
>
> Michael
>
> On Mar 20, 2012, at 6:18 AM, Eduardo Klein wrote:
>
>> Thanks Michael, your advice will be much appreciated!.
>>
>> Saludos, EKS
>>
>>
>> On 03/19/2012 04:39 PM, Michael Barton wrote:
>>> I'm at NCAR right now and I'm doing that very thing today in fact.
>>>
>>> Once I have an answer as to the difference between TLAT and ULAT, and TLONG and ULONG within the NetCDF files, I'll be able to give you a full work flow for this.
>>>
>>> Michael
>>>
>>> On Mar 19, 2012, at 2:44 PM,<[hidden email]>   wrote:
>>>
>>>> Message: 3
>>>> Date: Mon, 19 Mar 2012 13:20:33 -0430
>>>> From: Eduardo Klein<[hidden email]>
>>>> Subject: [GRASS-user] NetCDF rotated pole
>>>> To: [hidden email]
>>>> Message-ID:<[hidden email]>
>>>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>>>
>>>> Hi,
>>>>
>>>> Is there any way to read a NetCDF file which has a rotated pole Mercator
>>>> projection and have it inside GRASS with the North pole at North?
>>>>
>>>> I'm trying to use AVISO SSH products on GRASS 6.4.1 and gdal 1.8.0
>>>>
>>>> Thanks!
>>>>
>>>> --
>>>> Eduardo Klein
>>>> Lab Sensores Remotos e
>>>> Instituto de Tecnolog?a y Ciencias Marinas
>>>> Universidad Sim?n Bol?var
>>>> Caracas, Venezuela
>>>> ph (58) (212) 906-3111 ext 6700
>>>> fax (58) (212( 906-3111 ext 6701
>>>
>>> _____________________
>>> C. Michael Barton
>>> Visiting Scientist, Integrated Science Program
>>> National Center for Atmospheric Research&
>>> University Corporation for Atmospheric Research
>>> 303-497-2889 (voice)
>>>
>>> Director, Center for Social Dynamics&   Complexity
>>> Professor of Anthropology, School of Human Evolution&   Social Change
>>> Arizona State University
>>> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
>>>
>>
>> --
>> Eduardo Klein
>> Lab Sensores Remotos e
>> Instituto de Tecnología y Ciencias Marinas
>> Universidad Simón Bolívar
>> Caracas, Venezuela
>> ph (58) (212) 906-3111 ext 6700
>> fax (58) (212( 906-3111 ext 6701
>
> _____________________
> C. Michael Barton
> Visiting Scientist, Integrated Science Program
> National Center for Atmospheric Research&
> University Consortium for Atmospheric Research
> 303-497-2889 (voice)
>
> Director, Center for Social Dynamics&  Complexity
> Professor of Anthropology, School of Human Evolution&  Social Change
> Arizona State University
> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
>
>
>
>
>

--
Eduardo Klein
Lab Sensores Remotos e
Instituto de Tecnología y Ciencias Marinas
Universidad Simón Bolívar
Caracas, Venezuela
ph (58) (212) 906-3111 ext 6700
fax (58) (212( 906-3111 ext 6701
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: NetCDF rotated pole

Michael Barton
Excellent!

I was warned here at NCAR that I would have a lot of trouble with these model data file unless I could find someone to help me with the arcane NCAR Computer Language (NCL) code to reproject them. When I said that with GRASS, georeferencing would not be that big a deal if I could somehow find proper geographic reference points or data layers, they were skeptical. Persistence paid off, however. I still don't have NCL working (though I want to try it), but the approach I sent you turned out very well for my data. It may even be better than the NCL approach, since NCL seems to use a simple bilinear interpolation to directly change the grid cells from POP grid to latlon. With mine, we reproject grid centers first before interpolating. We can then choose which interpolator works best for our particular question and data set.

Michael

On Mar 21, 2012, at 8:51 AM, Eduardo Klein wrote:

> Michael,
>
> Thanks a lot for the instructions. It worked perfectly on my files!
>
> Saludos, EKS
>
>
> On 03/20/2012 05:42 PM, Michael Barton wrote:
>> Edwardo,
>>
>> I am attaching a PDF and RTF of the workflow I used to import paleocurrent data from a NetCDF file with rotated poles. While it may not exactly match your file, it should give you an idea of how to proceed. Let me know how it comes out.
>>
>>
>>
>>
>>
>> Michael
>>
>> On Mar 20, 2012, at 6:18 AM, Eduardo Klein wrote:
>>
>>> Thanks Michael, your advice will be much appreciated!.
>>>
>>> Saludos, EKS
>>>
>>>
>>> On 03/19/2012 04:39 PM, Michael Barton wrote:
>>>> I'm at NCAR right now and I'm doing that very thing today in fact.
>>>>
>>>> Once I have an answer as to the difference between TLAT and ULAT, and TLONG and ULONG within the NetCDF files, I'll be able to give you a full work flow for this.
>>>>
>>>> Michael
>>>>
>>>> On Mar 19, 2012, at 2:44 PM,<[hidden email]>   wrote:
>>>>
>>>>> Message: 3
>>>>> Date: Mon, 19 Mar 2012 13:20:33 -0430
>>>>> From: Eduardo Klein<[hidden email]>
>>>>> Subject: [GRASS-user] NetCDF rotated pole
>>>>> To: [hidden email]
>>>>> Message-ID:<[hidden email]>
>>>>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>>>>
>>>>> Hi,
>>>>>
>>>>> Is there any way to read a NetCDF file which has a rotated pole Mercator
>>>>> projection and have it inside GRASS with the North pole at North?
>>>>>
>>>>> I'm trying to use AVISO SSH products on GRASS 6.4.1 and gdal 1.8.0
>>>>>
>>>>> Thanks!
>>>>>
>>>>> --
>>>>> Eduardo Klein
>>>>> Lab Sensores Remotos e
>>>>> Instituto de Tecnolog?a y Ciencias Marinas
>>>>> Universidad Sim?n Bol?var
>>>>> Caracas, Venezuela
>>>>> ph (58) (212) 906-3111 ext 6700
>>>>> fax (58) (212( 906-3111 ext 6701
>>>>
>>>> _____________________
>>>> C. Michael Barton
>>>> Visiting Scientist, Integrated Science Program
>>>> National Center for Atmospheric Research&
>>>> University Corporation for Atmospheric Research
>>>> 303-497-2889 (voice)
>>>>
>>>> Director, Center for Social Dynamics&   Complexity
>>>> Professor of Anthropology, School of Human Evolution&   Social Change
>>>> Arizona State University
>>>> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
>>>>
>>>
>>> --
>>> Eduardo Klein
>>> Lab Sensores Remotos e
>>> Instituto de Tecnología y Ciencias Marinas
>>> Universidad Simón Bolívar
>>> Caracas, Venezuela
>>> ph (58) (212) 906-3111 ext 6700
>>> fax (58) (212( 906-3111 ext 6701
>>
>> _____________________
>> C. Michael Barton
>> Visiting Scientist, Integrated Science Program
>> National Center for Atmospheric Research&
>> University Consortium for Atmospheric Research
>> 303-497-2889 (voice)
>>
>> Director, Center for Social Dynamics&  Complexity
>> Professor of Anthropology, School of Human Evolution&  Social Change
>> Arizona State University
>> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
>>
>>
>>
>>
>>
>
> --
> Eduardo Klein
> Lab Sensores Remotos e
> Instituto de Tecnología y Ciencias Marinas
> Universidad Simón Bolívar
> Caracas, Venezuela
> ph (58) (212) 906-3111 ext 6700
> fax (58) (212( 906-3111 ext 6701

_____________________
C. Michael Barton
Visiting Scientist, Integrated Science Program
National Center for Atmospheric Research &
University Corporation for Atmospheric Research
303-497-2889 (voice)

Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user