this is quite easy to do with numpy. See notes from me in the past few
weeks about similar topics.
-CHB
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
--
To unsubscribe, send email to wxPython-user...@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
Steve,
I've been playing around withe the script snippet and the data file you provided. My basic problem is that I don't know just what is a "floating point" pixel value ! There seems to be no documentation available anywhere. It appears to be whatever the programmer wants it to mean.
For example, what does a pixel value of "-31.3153" mean ? I amd assuming that a value of "0.0" means that this pixel is transparent. See file [ FP_data_text.txt ]. It forms a perfect 64x64 disc. Is this an output from some kind of special-purpose scanner array ?
Consider the program line:
pilImage = Image.frombuffer ( 'RGBA', (66, 66), d1, 'raw', 'RGBA', 0, 1 )
The first arg says that you want to create an RGBA mode image. Any valid Pil mode may be used here. The 5th parameter ( 'RGBA' ) tells Pil that the raw data order in the buffer is r-g-b-a, r-g-b-a, ...
How can this be right ? The buffer consists of only 64x64 pixels which have a single floating point value encoding each pixel. How does one encode an RGBA pixel into a +/- floating point value ?
Anyway, I scaled the +/- data to the [0 .. 255] grey level range and made 0.0-valued pixels transparent. In reality I have no idea what the floating point values really mean. This is what I got:
Magnified 64x64 image
The patterns suggest that I am on the right track in decoding the FP values. Only the creator of the values in file [ data_float.npy ] knows what the values mean, that is, how to transform them into (back into ?) 4 RGBA-ordered image integer values.
Hi Ray,Thanks for taking the time to look at this. The grey level range is what I get from my data too. The data is what is left over from reconstructing a wavefront after the data is collected from a CCD. For now I display everything in greyscale but I wanted to get the color going since it looked decent when I used imshow. The problem I ran into is exactly what you're running into, which is what do the values represent?On Fri, Jun 18, 2010 at 7:26 PM, Ray Pasco <pas...@verizon.net> wrote:Steve,
I've been playing around withe the script snippet and the data file you provided. My basic problem is that I don't know just what is a "floating point" pixel value ! There seems to be no documentation available anywhere. It appears to be whatever the programmer wants it to mean.
For example, what does a pixel value of "-31.3153" mean ? I amd assuming that a value of "0.0" means that this pixel is transparent. See file [ FP_data_text.txt ]. It forms a perfect 64x64 disc. Is this an output from some kind of special-purpose scanner array ?
Consider the program line:
pilImage = Image.frombuffer ( 'RGBA', (66, 66), d1, 'raw', 'RGBA', 0, 1 )
The first arg says that you want to create an RGBA mode image. Any valid Pil mode may be used here. The 5th parameter ( 'RGBA' ) tells Pil that the raw data order in the buffer is r-g-b-a, r-g-b-a, ...
How can this be right ? The buffer consists of only 64x64 pixels which have a single floating point value encoding each pixel. How does one encode an RGBA pixel into a +/- floating point value ?
Anyway, I scaled the +/- data to the [0 .. 255] grey level range and made 0.0-valued pixels transparent. In reality I have no idea what the floating point values really mean. This is what I got:
Magnified 64x64 image
The patterns suggest that I am on the right track in decoding the FP values. Only the creator of the values in file [ data_float.npy ] knows what the values mean, that is, how to transform them into (back into ?) 4 RGBA-ordered image integer values.