def _write_viewing_info(self, group):

        if self.peeloff_origin is not None and self.inside_observer is not None:
            raise Exception("Cannot specify inside observer and peeloff origin at the same time")

        if self.inside_observer is not None:
            group.attrs['inside_observer'] = bool2str(True)
            self._write_inside_observer(group)
            if self.viewing_angles == []:
                self.set_viewing_angles([90.], [0.])
            if self.image and self.xmin < self.xmax:
                raise ValueError("longitudes should increase towards the left for inside observers")
            if self.d_min < 0.:
                if self.d_min != -np.inf:
                    raise ValueError("Lower limit of depth should be positive for inside observer")
                self.d_min = 0.
            if self.d_max < 0.:
                raise ValueError("Upper limit of depth should be positive for inside observer")

        elif len(self.viewing_angles) > 0:
            group.attrs['inside_observer'] = bool2str(False)
            if self.peeloff_origin is None:
                self.set_peeloff_origin((0., 0., 0.))
            self._write_peeloff_origin(group)
        else:
            raise Exception("Need to specify either observer position, or viewing angles")

        self._write_ignore_optical_depth(group)

        self._write_viewing_angles(group)

        self._write_depth(group)
dataset/ETHPy150Open hyperion-rt/hyperion/hyperion/conf/conf_files.py/PeeledImageConf._write_viewing_info/original