Re: grdcut: Error cutting over +/-180° longitude

Kristof Koch <[email protected]>
Newsgroups gmane.comp.gis.gmt.user
Message-ID <[email protected]>
Dear Paul,

Thank you for your explanation of the correct -R usage. I wasn't aware of the west < east requirement and the proper solution. 

May I suggest that you write 

"grdcut: Make sure west < east for geographic coordinates"

in the error message? While your version is technically correct, I find mine easier to comprehend: west is "left" and east is "right". 

On -R[...]r: I tried the "r" to reduce the size of the cut terrain as a Lambert conic conformal projection, due to its nature, "wastes" quite a lot of the cut area outside the plotted area. Think of the wasted cake when you use a rectangular shaped cookie cutter (my resulting plot) on a wedge of cake (my cut terrain). As pointed out by you it doesn't work, and as it didn't cause any trouble, I forgot about it and it stayed. 

Thank you again and all the best,
Kristof

> Am 23.03.2014 um 22:00 schrieb Paul Wessel <[email protected]>:
> 
> I've improved the error message to say (for geographic grids):
> 
> grdcut: Error: grid x range <= 0.0
> grdcut: Make sure east > west for geographic coordinates
> 
> I should also add that your -R75/17/-124/79r is the same as -R75/-124/17/79 which of course also would fail badly.  So either use
> 
> -R75/17/236/79r or -R75/236/17/79 or even -R-285/17/-124/79r
> 
> -p
> 
>> On Mar 23, 2014, at 10:40 AM, Paul Wessel <[email protected]> wrote:
>> 
>> Usually, one has to ensure that west < east, even if picking corners, so the -124 is causing trouble.  It works better with 236 since 236 > 5 while -124 < 5.
>> 
>> -p
>> 
>>>> On Mar 23, 2014, at 9:03 AM, Kristof Koch <[email protected]> wrote:
>>> 
>>> Dear Paul,
>>> 
>>> I'd say so:
>>> 
>>> $ grdinfo ETOPO1_Ice_g_gmt4.grdETOPO1_Ice_g_gmt4.grd: Title: ETOPO1_Ice_g_gmt4.grd
>>> ETOPO1_Ice_g_gmt4.grd: Command:
>>> ETOPO1_Ice_g_gmt4.grd: Remark:
>>> ETOPO1_Ice_g_gmt4.grd: Gridline node registration used [Geographic grid]
>>> ETOPO1_Ice_g_gmt4.grd: Grid file format: ni = GMT netCDF format (32-bit integer), COARDS, CF-1.5
>>> ETOPO1_Ice_g_gmt4.grd: x_min: -180 x_max: 180 x_inc: 0.0166666666667 name: Longitude [degrees_east] nx: 21601
>>> ETOPO1_Ice_g_gmt4.grd: y_min: -90 y_max: 90 y_inc: 0.0166666666667 name: Latitude [degrees_north] ny: 10801
>>> ETOPO1_Ice_g_gmt4.grd: z_min: -10898 z_max: 8271 name: z
>>> ETOPO1_Ice_g_gmt4.grd: scale_factor: 1 add_offset: 0
>>> ETOPO1_Ice_g_gmt4.grd: format: classic
>>> 
>>> The Version of GMT I'm using is 5.1.1_r12890 [64-bit] on Ubuntu 12.04.4 LTS (GNU/Linux 2.6.32-042stab084.17 x86_64)
>>> 
>>>>> Am 23.03.2014 um 19:52 schrieb Paul Wessel <[email protected]>:
>>>> 
>>>> Does grdinfo say your etopo1 grid is geographic?  If not you will have to add -fg.
>>>> 
>>>> Sent from my iPad
>>>> 
>>>>> On Mar 23, 2014, at 12:31 AM, Kristof Koch <[email protected]> wrote:
>>>>> 
>>>>> Dear List,
>>>>> 
>>>>> I'm trying to cut the ETOPO1 grid. My script works as desired as long as -R doesn't span over +/-180° longitude, however I get the following error trying to cut over +/-180° longitude:
>>>>> 
>>>>> grdcut: Error: grid x range <= 0.0
>>>>> grdcut (GMT_grdcut): Unacceptable PLOT_DEGREE_FORMAT template. A not allowed [/tmp/apollodor-8GOUnDRc/tmp_elevation_data_raw.grd]
>>>>> 
>>>>> the relevant snippet of code:
>>>>> 
>>>>>    TERRAIN_BOUNDARIES=75/17/-124/79
>>>>> 
>>>>> grdcut \
>>>>>    ETOPO1_Ice_g_gmt4.grd \
>>>>>    -G"${WORK_DIR}"/tmp_elevation_data_raw.grd \
>>>>>    -R"${TERRAIN_BOUNDARIES}"r
>>>>> 
>>>>> After studying the grdcut manpage, I'm not quite sure how to make it work. Any hints are welcome.
>>>>> 
>>>>> All the best,
>>>>> Kristof Koch
>>>>> 
>>>>> --
>>>>> My PGP Public Key: http://kristofkoch.de/pgp/
>>>>> 
>>>>> 
>>>>> To unsubscribe, send the message "signoff gmt-help" to [email protected]
>>>> 
>>>> To unsubscribe, send the message "signoff gmt-help" to [email protected]
>>> 
>>> 
>>> --
>>> My PGP Public Key: http://kristofkoch.de/pgp/
>>> 
>>> 
>>> To unsubscribe, send the message "signoff gmt-help" to [email protected]
> 
> To unsubscribe, send the message "signoff gmt-help" to [email protected]

To unsubscribe, send the message "signoff gmt-help" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.