comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Keywords and properties (in function graphics)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Keywords and properties (in function graphics) [message #87488] Fri, 07 February 2014 11:12 Go to previous message
Gordon Farquharson is currently offline  Gordon Farquharson
Messages: 48
Registered: December 2010
Member
Hi All

The IDL documentation states that keywords are applied only during the initial creation of the graphic, whereas properties can be set as keywords to the function during creation, or retrieved or changed using the "." notation after creation (e.g., [1]).

Below is a simple program to display an image using a map projection. In the first case (im1), I set all keywords and properties in the function call. In the second case (im2), I only set keywords in the function call, and set properties after the function call.

---
file1 = FILEPATH('Night.jpg', SUBDIRECTORY=['examples','data'])

ret = query_jpeg(file1, info)

lon = findgen(info.dimensions[0]) / info.dimensions[0] * 360. - 180.
lat = findgen(info.dimensions[1]) / info.dimensions[1] * 180. - 90.

read_jpeg, file1, data

im1 = image(data, lon, lat, DIMENSIONS=[1024,512], MARGIN=0., $
GRID_UNITS="degrees", MAP_PROJECTION="Mollweide")

im2 = image(data, lon, lat, DIMENSIONS=[1024,512], MARGIN=0.)

im2.grid_units = "degrees"
im2.map_projection = "Mollweide"

END
---

im1 displays the image as I would expect (warped to the map projection). However, IDL returns the following error when the map_projection property is set for im2.

% Unable to retrieve map projection.
% Execution halted at: $MAIN$ 16 /home/gordon/tmp/test_map.pro

For reference, line 16 is

im2.map_projection = "Mollweide"

Why? Specifically, why I can't change the map projection *property* after the image has been created?

Gordon

[1] http://www.exelisvis.com/docs/image.html
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL_IDLBridge, spawn, and sftp, oh my!
Next Topic: IDLDE questions

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:19:40 PDT 2025

Total time taken to generate the page: 0.00482 seconds