Re: x/y margin from map_set to plot position and cgimage [message #85679 is a reply to message #85677] |
Mon, 26 August 2013 11:20   |
Andy Sayer
Messages: 127 Registered: February 2009
|
Senior Member |
|
|
I guess this question could be posed more generally as: how can I identify what parts of an image window lie within the portion available for drawing the map after a call to map_set, and how can I pass this to other routines such as cgimage?
Andy
On Monday, August 26, 2013 1:36:06 PM UTC-4, AMS wrote:
> Hi all,
>
>
>
> Suppose I have set up a part of a window to draw a map, and used xmargin and ymargin to specify the margins around this map. For example:
>
>
>
> map_set,0,0,xmargin=[2,2],ymargin=[2,2]
>
>
>
> Suppose I then want to draw an image (with cgimage) inside this map. Is there a way to pass the xmargin/ymargin information so the image is drawn inside the map region rather than the whole plot window? I don't see those as keywords to cgimage. If not, is there some way I can pull out the plot position which arose from my map_set call and pass this to cgimage? I can't necessarily assume that !p.multi=0, so I don't think the cgimage position keyword would help me here?
>
>
>
> (I am switching over a lot of old code written for IDL 5/6 to use newer features and the Coyote library... so am now becoming familiar with some 'under the hood' stuff which I had not looked at in detail before. I'm now using IDL 7.1.1 and 8.2.2.)
>
>
>
> I would not be averse to recoding to use something like the Coyote Graphics position keyword in my map_set call, but as far as I know that can't be done with map_set (and I don't want to pass the position keyword to map_set because often !p.multi will not be 0).
>
>
>
> The longer story for what I am trying to do is that I have written code to map regularly or irregularly lat-lon gridded data from e.g. satellites. This basically makes use of polyfill to draw each point. If the grid is not regular, my code allows for a proper expression of the ground pixel size. But if the grid is regular (e.g. level 3 data), I figure I should be able to map it as an image, which could be a lot faster than using polyfill.
>
>
>
> Thanks,
>
>
>
> Andy
|
|
|