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

Home » Public Forums » archive » Working with color, cursor, and png to extract information
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Working with color, cursor, and png to extract information [message #58526] Mon, 04 February 2008 11:59 Go to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
OK,

So I am no exactly sure how to ask this question but here goes. As
such I am open for reinterpretation or another solution all
together...

What I want to do:
- Start with a png image from old research (like
http://www.dfanning.com/programs/docs/read_toms_aerosol.jpg)
- read in the png (yes I know the example is a jpg, but it should be
the same procedure)
- extract the "value" at each pixel in the image based on the colorbar

This seems like it should in principle do doable...

Here is what I tried for this attempt:
- read in the image
IDL> image=selectimage(palette=palette)
IDL> help, image, palette
IMAGE BYTE = Array[3, 672, 708]
PALETTE BYTE = Array[256, 3]
- display it
IDL> window, /free, xs=672, ys=708
IDL> tv, image, /true
- select out the part that is the data with cursor and save it
separately
IDL> cursor, x1, y1, /dev ; clicked lower left
IDL> cursor, x2, y2, /dev ; clicked upper right
IDL> image2=image[*,x1:x2, y1:y2]
IDL> window, /free, xs=x2-x1, ys=y2-y1
IDL> tv, image2, /true
- set the x-y vectors using cursor and inspection, and scale_vector
(easy)

now I am stuck, I thought I could set the colortable with
IDL> tvlct, palette
but this seems to still be gray scale (according to cindex)
then I thought I could just pull out the value at each pixel from the
color table then map that back to the values in the colorbar. But I
dont know how, anyone else done something like this?

Normally I extract line plots with g3data (http://www.frantz.fi/
software/g3data.php) but it only does lineplots and not color plots.

Ideas? Comments?

thanks much,

Brian








------------------------------------------------------------ -------------
Brian Larsen
Boston University
Center for Space Physics
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Working with color, cursor, and png to extract information
Next Topic: WIDGET_BASE always on top

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

Current Time: Fri Oct 10 15:00:38 PDT 2025

Total time taken to generate the page: 0.80528 seconds