
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "examples/The_GS_Standard/plot_help_I_have_no_variable_metadata.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        Click :ref:`here <sphx_glr_download_examples_The_GS_Standard_plot_help_I_have_no_variable_metadata.py>`
        to download the full example code

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_examples_The_GS_Standard_plot_help_I_have_no_variable_metadata.py:


Converting CSV to GSpy Raster formats without metadata
------------------------------------------------------

.. GENERATED FROM PYTHON SOURCE LINES 8-23


.. rst-class:: sphx-glr-script-out

.. code-block:: pytb

    Traceback (most recent call last):
      File "/Users/nfoks/codes/repositories/gspy/gspy_secondary/documentation_source/source/examples/The_GS_Standard/plot_help_I_have_no_variable_metadata.py", line 23, in <module>
        survey.add_tabular(type='csv', data_filename=d_data, metadata_file=d_supp)
      File "/Users/nfoks/codes/repositories/gspy/gspy_secondary/gspy/src/classes/survey/Survey.py", line 131, in add_tabular
        out = tabular_csv.Tabular_csv.read(data_filename, metadata_file=metadata_file, spatial_ref=self.spatial_ref, **kwargs)
      File "/Users/nfoks/codes/repositories/gspy/gspy_secondary/gspy/src/classes/data/Tabular.py", line 135, in read
        cls._create_variable_metadata_template(filename, file.df.columns)
      File "/Users/nfoks/codes/repositories/gspy/gspy_secondary/gspy/src/classes/data/tabular_csv.py", line 183, in _create_variable_metadata_template
        raise Exception(s)
    Exception: 
    Variable metadata values are not defined in the ..//supplemental information file.
    Creating a template with filename variable_metadata_template_Resolve.json
    Please fill out and add the dictionary to the ..//supplemental information file.







|

.. code-block:: default

    import matplotlib.pyplot as plt
    from os.path import join
    from gspy import Survey

    # Path to example files
    data_path = '..//..//supplemental'

    # Define ..//supplemental information file
    ..//supplemental = join(data_path, "region//MAP//data//Resolve_survey_md.json")

    survey = Survey(..//supplemental)

    d_data = join(data_path, 'region//MAP//data//Resolve.csv')
    d_supp = join(data_path, 'region//MAP//data//Resolve_data_md_without_variables.json')

    survey.add_tabular(type='csv', data_filename=d_data, metadata_file=d_supp)

.. rst-class:: sphx-glr-timing

   **Total running time of the script:** ( 0 minutes  1.657 seconds)


.. _sphx_glr_download_examples_The_GS_Standard_plot_help_I_have_no_variable_metadata.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example


    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: plot_help_I_have_no_variable_metadata.py <plot_help_I_have_no_variable_metadata.py>`

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: plot_help_I_have_no_variable_metadata.ipynb <plot_help_I_have_no_variable_metadata.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
