Michael Hearne wrote:
> Jeff - 
>
> My data set is actually dynamically generated by a program called 
> ShakeMap.  It's a 2D grid, with an extent usually about 600 kilometers 
> on a side, centered wherever the earthquake happened to be.  The 
> ShakeMap program does not know or care that some of the data may be 
> under water, but for display purposed, I do!  The grid is also in a 
> geographic projection (latitude/longitude coordinates assumed to be 
> cartesian).
Michael:  You'll either have to create your own land-sea mask, or use 
Pierre's method with gdal.
>
> So in this test instance (on a data set near Taiwan), my map width is 
> about 5.91 degrees longitude, and my height is about 5.5 degrees latitude.
>
> If I set xoffset=-0.01*5.91, I get -0.05.  This is not noticeably 
> different than the default.
>
> Is the problem that my dataset is not projected?
What is m.xmax-m.xmin? (m is the basemap instance, xmin and xmax are 
instance variables) That's what you have to use - the distance in map 
projection coordinates, not lat/lon coordinates (although these will be 
the same if you are using projection='cyl').

-Jeff

>
> --Mike
> On Nov 2, 2007, at 1:33 PM, Jeff Whitaker wrote:
>
>> Michael Hearne wrote:
>>> Jeff - I looked at that example file, and I think there's a big 
>>> difference - your etopo base data set is global, and you can plot 
>>> over the data in the oceans by setting the mask on all pixels less 
>>> than zero.
>>>
>>> My dataset (a map of earthquake shaking) is not global, and actually 
>>> has NO missing data.   I think I need a way to "clip" the data by 
>>> the land mask - that is, find all of the pixels that are NOT on 
>>> land, and then mask them off. 
>> Mike:
>>
>> If it's not global, is it just defined for land points?  If so, it 
>> can't be a 2-D grid, so you won't be able to plot it with imshow 
>> anyway.  Can you explain the structure of the data?
>>>
>>> Is there an easy way to do this with matplotlib/basemap tools?
>> Not really.  You'll have to define a sea mask for your grid and use 
>> that the create a masked array.  There is a land-sea mask dataset 
>> included in basemap, but it may not match the resolution of your grid.
>>
>>>
>>> Regarding my other issue - I used my script to test x/y offset 
>>> values: [0.05,0.1,0.5,1.0,10] and couldn't see any difference.  I'd 
>>> be more than happy to provide test output, or debugging information...
>>>
>>> Just to be clear - these offsets are supposed to move the meridian 
>>> and/or parallel labels around with respect to the map edge?  My 
>>> actual goal is to get the labels inside the edge of the map (I tried 
>>> negative numbers to accomplish this, to no effect.)
>> You  need to define an offset as a fraction of the map width - the 
>> numbers you are giving are too small to notice any difference.  As I 
>> said before, try something like -0.01*(m.max-m.min).
>>>
>>> On a positive note, I _can_ make solid lines!
>>
>> Good!
>>
>> -Jeff
>>
>> -- 
>> Jeffrey S. Whitaker         Phone  : (303)497-6313
>> Meteorologist               FAX    : (303)497-6449
>> NOAA/OAR/PSD  R/PSD1        Email  : [EMAIL PROTECTED] 
>> <mailto:[EMAIL PROTECTED]>
>> 325 Broadway                Office : Skaggs Research Cntr 1D-124
>> Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg
>
>
>
>
> ------------------------------------------------------
> Michael Hearne
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> (303) 273-8620
> USGS National Earthquake Information Center
> 1711 Illinois St. Golden CO 80401
> Senior Software Engineer
> Synergetics, Inc.
> ------------------------------------------------------
>
>


-- 
Jeffrey S. Whitaker         Phone : (303)497-6313
NOAA/OAR/CDC  R/PSD1        FAX   : (303)497-6449
325 Broadway                Boulder, CO, USA 80305-3328


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to