Inputs#
- pyxel.load_image(filename)[source]#
Load a 2D image.
- Parameters:
filename (
str
orPath
) – Filename to read an image. {.npy, .fits, .txt, .data, .jpg, .jpeg, .bmp, .png, .tiff} are accepted.- Returns:
ndarray
– A 2D array.- Raises:
FileNotFoundError – If an image is not found.
ValueError – When the extension of the filename is unknown or separator is not found.
Examples
>>> from pyxel import load_image >>> load_image("frame.fits") array([[-0.66328494, -0.63205819, ...]])
>>> load_image("https://hostname/folder/frame.fits") array([[-0.66328494, -0.63205819, ...]])
>>> load_image("another_frame.npy") array([[-1.10136521, -0.93890239, ...]])
>>> load_image("rgb_frame.jpg") array([[234, 211, ...]])
- pyxel.load_header(filename, section=None)[source]#
Load and return header information from a file.
- Parameters:
- Returns:
Examples
>>> load_header("image.fits", section="RAW") CRPIX1 = 1024.6657050959 / Pixel coordinate of reference point CRPIX2 = 1024.6657050959 / Pixel coordinate of reference point PC1_1 = -1.0 / Coordinate transformation matrix element
- pyxel.load_table(filename, header=False, dtype='float')[source]#
Load a table from a file and returns a pandas dataframe. No header is expected in xlsx.
- Parameters:
- Returns:
- Raises:
FileNotFoundError – If an image is not found.
ValueError – When the extension of the filename is unknown or separator is not found.