credit.transforms404
====================

.. py:module:: credit.transforms404


Attributes
----------

.. autoapisummary::

   credit.transforms404.logger


Classes
-------

.. autoapisummary::

   credit.transforms404.NormalizeState
   credit.transforms404.ToTensor


Module Contents
---------------

.. py:data:: logger

.. py:class:: NormalizeState(conf)

   (De/)Normalize C404 data by variable.  Currently only does
   z-score normalization using precomputed mu & sigma.



   .. py:attribute:: mean_ds


   .. py:attribute:: std_ds


   .. py:attribute:: variables


   .. py:method:: __call__(sample: credit.data.Sample, inverse: bool = False) -> credit.data.Sample


   .. py:method:: transform(sample: Dict[str, numpy.ndarray]) -> Dict[str, numpy.ndarray]


   .. py:method:: inverse_transform(x: torch.Tensor) -> torch.Tensor


.. py:class:: ToTensor(conf, x0=120, xsize=512, y0=300, ysize=512)

   Converts xarray object to torch tensor.  Defined as a class so
   it can be used as a component of a string of transforms applied to
   C404Dataset's __getitem__ calls.  Also does spatial cropping
   (which probably ought to move elsewhere, likely into another
   transform sequence component object).



   .. py:attribute:: conf


   .. py:attribute:: hist_len


   .. py:attribute:: for_len


   .. py:attribute:: variables


   .. py:attribute:: static_variables


   .. py:attribute:: slice_x


   .. py:attribute:: slice_y


   .. py:method:: __call__(sample: credit.data.Sample) -> credit.data.Sample


