Source code for casinotools.file_format.casino3.region_intensity_info
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. py:currentmodule:: casinotools.file_format.casino3.region_intensity_info
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
Description
"""
###############################################################################
# Copyright 2020 Hendrix Demers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
# Standard library modules.
# Third party modules.
# Local modules.
# Project modules.
from casinotools.file_format.file_reader_writer_tools import read_int, read_double
# Globals and constants variables.
[docs]
class RegionIntensityInfo:
def __init__(self):
self.version = 0
self.energy_intensity = 0.0
self._region_id = 0
self.normalized_energy_intensity = 0.0
[docs]
def read(self, file):
assert getattr(file, 'mode', 'rb') == 'rb'
self.version = read_int(file)
self.energy_intensity = read_double(file)
self._region_id = read_int(file)
self.normalized_energy_intensity = read_double(file)
[docs]
def get_energy_intensity(self):
return self.energy_intensity
[docs]
def get_normalized_energy_intensity(self):
return self.normalized_energy_intensity