GithubHelp home page GithubHelp logo

sermovie's Introduction

sermovie

SER Decoder (see https://www.grischa-hahn.homepage.t-online.de/astro/ser/ ).

Copyright (C) 2023 Sergio Diaz, sergiodiaz.eu

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

SERMovie Objects

class SERMovie()

Simple class for reading SER movie files, with timestamp support.

Based on:

Usage example:

from sermovie import SERMovie
import matplotlib.pyplot as plt

m = SERMovie("file.ser")
print(m)  # Header info

# For reading frames, some options:
# 1) Directly, outside context: open, read data then close the file
im = m.getFrame(0)
print(im.shape)
plt.imshow(im)

# 2) Within context: the file is only opened at the beginning and
# closed at the end (better if getting multiple frames)
with m:
    im = m.getFrame(0)
    print(im.shape)
    plt.imshow(im)

# 3) Access frames via memmap, so you can access all the stream
# as a big array where frames can be indexed by the first axis
# (slices and advanced indexing are supported)
im = m.as_memmap()
print(im.shape)
plt.imshow(im[0, ...])

Attributes

color_modes : dict dictionary with supported color modes

color : str color mode of the current file (see color_modes)

planes : int number of planes of each frame

endian : str 'little' or 'big'

width : int width of each frame, in pixels

height : int height of each frame, in pixels

bpp : int bits per plane, 8 or 16

shape : tuple tuple (height, width, planes), or (height, width) if planes==1

frame_pixels : int total number of pixel in each frame

frame_bytes : int frame size in bytes

observer : str observer field (40 bytes max)

instrument : str instrument field (40 bytes max)

telescope : str telescope field (40 bytes max)

datetime : datetime start date/time of image stream, in local time

datetime_utc : datetime start date/time of image stream, in UTC

timestamps_utc : np.array[datetime64] numpy array including timestamps for all frames, if present

Parameters

fname : str filename

Raises

NotImplementedError Raises if unexpected values are found in the file header

sermovie's People

Contributors

sergio-dr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.