vyperdatum.drivers.npz ====================== .. py:module:: vyperdatum.drivers.npz Classes ------- .. autoapisummary:: vyperdatum.drivers.npz.NPZ Module Contents --------------- .. py:class:: NPZ(input_file: str, invalid_error: bool = True) Bases: :py:obj:`vyperdatum.drivers.base.Driver` Handle loading and parsing of a .npz (numpy arrays) file. .. attribute:: input_file Full path to the npz file. :type: str .. attribute:: content The object containing the numpy arrays stored in the npz file. :type: np.lib.npyio.NpzFile .. rubric:: Example >>> npz = NPZ('PATH_TO_NPZ_FILE') >>> x, y, z, u = npz.xyzu() >>> wkt = npz.wkt() >>> mmx, mmy, mmz, mmu = npz.minmax() .. py:attribute:: input_file .. py:attribute:: content .. py:method:: load() -> numpy.lib.npyio.NpzFile Load a numpy .npz file (collection of numpy arrays). Return None when any exception take place or when the file is invalid. :raises ValueError:: If the file path is missing. :raises FileNotFoundError:: If the input file is not found. :raises TypeError:: If key names in the .npz file didn't match the expected names. :rtype: Optional[numpy.lib.npyio.NpzFile] .. py:method:: xyzu() -> Tuple[numpy.ndarray] Slice the `data` array to extract x, y, z, u arrays. :returns: * **x** (*numpy.ndarray*) -- x coordinate numpy array. * **y** (*numpy.ndarray*) -- y coordinate numpy array. * **z** (*numpy.ndarray*) -- z coordinate numpy array. * **u** (*numpy.ndarray*) -- uncertainty numpy array. .. py:method:: wkt() -> str Return wkt stored in the npz file. .. py:method:: minmax() -> Tuple[numpy.ndarray] Extract the minmax values of the coordinated and uncertainty arrays. :returns: * **x** (*numpy.ndarray*) -- x coordinate numpy array. * **y** (*numpy.ndarray*) -- y coordinate numpy array. * **z** (*numpy.ndarray*) -- z coordinate numpy array. * **u** (*numpy.ndarray*) -- uncertainty numpy array. .. py:method:: transform(transformer_instance, vdatum_check: bool) -> bool Apply point transformation on npz data according to the `transformer_instance`. :param transformer_instance: Instance of the transformer class. :type transformer_instance: vyperdatum.transformer.Transform :returns: True if successful, otherwise False. :rtype: bool .. py:property:: is_valid