<commit_before>Inflow from Land Surface Models
===============================

Code to use to prepare input data for RAPID from Land Surface Models
(LSM) such as:

- ECMWF's ERA Interim Data
- NASA's GLDAS/NLDAS/LIS Data

Step 1: Retrieve Land Surface Model Runoff Output
-------------------------------------------------

Download the data into a local directory.

- http://apps.ecmwf.int/datasets/data
- http://ldas.gsfc.nasa.gov/index.php


Step 2: Create folders for RAPID input and output
-------------------------------------------------

In this instance:

::

    $ cd $HOME
    $ mkdir -p rapid-io/input rapid-io/output

Step 3: Create script using LSM process
---------------------------------------

Here is the API for the function to use. Follow the example to create a script to use the code such as in ~/run\_lsm.py.

.. autofunction:: RAPIDpy.inflow.lsm_rapid_process.run_lsm_rapid_process

Step 4: Add RAPID files to the rapid-io/input directory
---------------------------------------------------------

Make sure the directory is in the format [watershed name]-[subbasin
name] with lowercase letters, numbers, and underscores only. No spaces!

Example:

::

    $ ls /rapid-io/input
    nfie_texas_gulf_region-huc_2_12
    $ ls /rapid-io/input/nfie_texas_gulf_region-huc_2_12
    comid_lat_lon_z.csv
    k.csv
    rapid_connect.csv
    riv_bas_id.csv
    weight_era_t511.csv
    weight_nldas.csv
    x.csv

Step 5: Run the code
--------------------

::

    $ python ~/run_lsm.py<commit_msg>added link to instructions to generate rapid input files<commit_after>Inflow from Land Surface Models
===============================

Code to use to prepare input data for RAPID from Land Surface Models
(LSM) such as:

- ECMWF's ERA Interim Data
- NASA's GLDAS/NLDAS/LIS Data

Step 1: Retrieve Land Surface Model Runoff Output
-------------------------------------------------

Download the data into a local directory.

- http://apps.ecmwf.int/datasets/data
- http://ldas.gsfc.nasa.gov/index.php


Step 2: Create folders for RAPID input and output
-------------------------------------------------

In this instance:

::

    $ cd $HOME
    $ mkdir -p rapid-io/input rapid-io/output

Step 3: Create script using LSM process
---------------------------------------

Here is the API for the function to use. Follow the example to create a script to use the code such as in ~/run\_lsm.py.

.. autofunction:: RAPIDpy.inflow.lsm_rapid_process.run_lsm_rapid_process

Step 4: Add RAPID files to the rapid-io/input directory
---------------------------------------------------------

Make sure the directory is in the format [watershed name]-[subbasin
name] with lowercase letters, numbers, and underscores only. No spaces!

Example:

::

    $ ls /rapid-io/input
    nfie_texas_gulf_region-huc_2_12

    $ ls /rapid-io/input/nfie_texas_gulf_region-huc_2_12
    comid_lat_lon_z.csv
    k.csv
    rapid_connect.csv
    riv_bas_id.csv
    weight_era_t511.csv
    weight_nldas.csv
    weight_gldas.csv
    weight_lis.csv
    weight_wrf.csv
    x.csv

If you have not generated these files yet, see :doc:`gis_tools` 

Step 5: Run the code
--------------------

::

    $ python ~/run_lsm.py
{'fraction_non_alphanumeric': 0.21685991852083986, 'fraction_numerical': 0.008774678784080225, 'mean_word_length': 2.0284629981024667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6468499', 'n_tokens_mistral': 1038, 'n_tokens_neox': 974, 'n_words': 310}