how can i set a projection area larger than data's geographical coverage?

I want to set a projection area larger than data’s geographical coverage.

But data must still be georeferenced correctly inside map region

and coastlines in projection area should still be visible outside data area.

right now, the data is always stretched inside whole projection area.

trying to mimic with characters:

–right now–

ulcorner

···

p r o j. a r e a |

                 >
w h o l e        |
 d a t a         |
   i s           |

s t r e t c h e d |

                 >

-----------------------| lrcorner

–what i try to do–

ulcorner


                 >

__________ this |

     >   is      |

this |projection |

is | area |

data | |

     >           >

-----------------------| lrcorner

Code below certainly does not work and stretch data to full projection region:


code skipped

m = Basemap(projection=‘merc’,llcrnrlat=37,urcrnrlat=42,
llcrnrlon=24,urcrnrlon=34,resolution=‘i’)

m.imshow(data, cmap=plt.cm.jet, interpolation=‘nearest’)

plt.show()

code skipped


i fiddled with imshow’s extent and clip_box keywords but since could not get it work. and googling for a serious amount of time didnt help either.

Some posts on web mentioned bbox or set_autoscale_on related things but i cant seem to get it. Any ideas ?

thanks.


Yasin Selçuk Berber
“Bismillah, her hayrın başıdır.”

Yasin: If you use pcolor or contourf, you can specify the x,y (map
projection) coordinates of the data grid, and the data will be
plotted on a subset of the map projection region. imshow (which
doesn’t take x,y coordinates) just fills the whole plotting region
with an image. If you want to use imshow, perhaps you could define
an inset map (with no coastlines drawn) inside your larger map, and
plot the image on the inset map.

-Jeff
···
-- Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : 325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web :

Jeffrey.S.Whitaker@…259…http://tinyurl.com/5telg

Jeff: in the end, i decided to suspend this kind of approach to problem, but should give it a try in the future. thanks for suggestion.

-Yasin

2012/6/14 Jeff Whitaker <jeffrey.s.whitaker@…259…>

···

On 6/14/12 7:52 AM, Yasin Selçuk Berber wrote:

      I want to set a projection

area larger than data’s geographical coverage.

      But data must still be

georeferenced correctly inside map region

      and coastlines in

projection area should still be visible outside data area.

      right now, the data is always

stretched inside whole projection area.

trying to mimic with characters:

–right now–

ulcorner


p r o j. a r e a |

                 >
w h o l e        |
 d a t a         |
   i s           |

s t r e t c h e d |

                 >

-----------------------| lrcorner

–what i try to do–

ulcorner


                 >

__________ this |

     >   is      |

this |projection |

is | area |

data | |

     >           >

-----------------------| lrcorner

    Code below certainly does not work and stretch data to full

projection region:


code skipped

      m =

Basemap(projection=‘merc’,llcrnrlat=37,urcrnrlat=42,\

                  llcrnrlon=24,urcrnrlon=34,resolution='i')
      m.imshow(data,

cmap=plt.cm.jet, interpolation=‘nearest’)

plt.show()

code skipped


    i fiddled with imshow's extent and clip_box keywords but

since could not get it work. and googling for a serious amount
of time didnt help either.

    Some posts on web mentioned bbox or set_autoscale_on related

things but i cant seem to get it. Any ideas ?

thanks.

    --

    Yasin Selçuk Berber

    "Bismillah, her hayrın başıdır."
-- Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : [http://tinyurl.com/5telg](http://tinyurl.com/5telg)
Yasin:  If you use pcolor or contourf, you can specify the x,y (map

projection) coordinates of the data grid, and the data will be
plotted on a subset of the map projection region. imshow (which
doesn’t take x,y coordinates) just fills the whole plotting region
with an image. If you want to use imshow, perhaps you could define
an inset map (with no coastlines drawn) inside your larger map, and
plot the image on the inset map.

-Jeff


Yasin Selçuk Berber
“Bismillah, her hayrın başıdır.”