[AstroPy] Moving Ahead with Raw Image Conversion

Wayne Watson sierra_mtnview at sbcglobal.net
Tue Apr 14 13:52:32 EDT 2009

Well, one more question about manipulation.

rawim_numpy = numpy.fromfile('sent_internal.raw', dtype='uint8')

was a good device for producing this from a file:
  array([1, 1, 1, ..., 1, 1, 1], dtype=uint8)
a numpy array. In my program, I'm getting* the image in a string 307200 
"characters" long. Is there a device (fromstring?) that would do this in 
one fell swoop to get a numpy array?

* as here: img_string=self.current_image.tostring()

           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
              Obz Site:  39° 15' 7" N, 121° 2' 32" W, 2700 feet  

           All the neutrons, and protons in the human body occupy
           a cube whose side is 5.52*10**-6 meters (tiny!). That
           adds up to a 150 pound person. It's not a surprise that
           we are mostly space. (Calculation by WTW)

More information about the AstroPy mailing list