[AstroPy] Data Analysis and Programming in Python
write_array(arr,outname,keywords). These 2 functions should allow you to read JPG images as numpy arrays and then write each array out to a separate FITS file using PyFITS.
write_array(arr,outname,keywords). These 2 functions should allow you to read JPG images as numpy arrays and then write each array out to a separate FITS file using PyFITS.
The error comes out because, actually, numpy.ndarray has no getshape method. > > What is the correct way to do it? > Within your function, declare.and export it to Python and pass, from Python, a Numpy 2D array. Have a look at mds-utils and at its usage examples.
Previous message (by thread): [Numpy-discussion] Numpy 2D array from a list error.apps/python/2.5.4/rhel4/lib/python2.5/site-packages/numpy/lib/io.py", line 505, in loadtxt X = np.array(X, dtype) ValueError: setting an array element with a sequence " @.
For object arrays the ufuncs look to the > objects themselves for implementation. In this case. The ufunc tries > to call the log method of each entry in the array. The first entry is a > float (which as the error shows) does not have a log attribute and so > you get a failure. >