# Prepare observations for JEDI-SOCA exp (r2d2 database)

**URL:** <https://forums.jcsda.org/t/prepare-observations-for-jedi-soca-exp-r2d2-database/465>\
**Category:** JEDI\
**Created:** [April 24, 2023, 4:51pm UTC](https://forums.jcsda.org/t/prepare-observations-for-jedi-soca-exp-r2d2-database/465 "2023-04-24T16:51:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjhossen](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/mjhossen/32/186_2.png) [@mjhossen](https://forums.jcsda.org/u/mjhossen)\
**Post date:** [April 24, 2023, 4:51pm UTC](https://forums.jcsda.org/t/prepare-observations-for-jedi-soca-exp-r2d2-database/465/1 "2023-04-24T16:51:07Z")

</div>

Hi,  
I am trying to run an experiments with my own observation database. My understanding is that first I have to convert the observation into ioda format, store them in a r2d2 database and link the r2d2 dir in the experiments. Would you please tell me where I can put the r2d2 dir? FYI, my r2d2\_host is orion. In this case, do I need to worry about mysql which requires DatabaseCredentials such as username, password, host, Port etc.

---

<div class="post-metadata">

**Author:** ![ericlingerfelt](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/ericlingerfelt/32/183_2.png) [@ericlingerfelt](https://forums.jcsda.org/u/ericlingerfelt)\
**Post date:** [April 24, 2023, 5:30pm UTC](https://forums.jcsda.org/t/prepare-observations-for-jedi-soca-exp-r2d2-database/465/2 "2023-04-24T17:30:55Z")

</div>

Hello, mjhossen.

- All R2D2 data store directories are now centrally controlled by the MySQL database.
- R2D2 end users no longer create a separate directory for their data. A data store already exists on Orion for end user data.
- R2D2 end users are required to have AWS permissions for the JCSDA-NOAA account on region “us-east-1”.
- R2D2 pulls its MySQL credentials from an S3 bucket from this account and region.
- R2D2 is integrated with a centralized, authoritative MySQL server running in “us-east-1”.

Here are the steps for ingesting your observations into R2D2.

(1) As you mentioned, you will convert your observations to the IODA format using the correct converter from [GitHub - JCSDA-internal/ioda-converters: Various converters for getting obs data in and out of IODA](https://github.com/JCSDA-internal/ioda-converters).  
(2) Export `$R2D2_HOST="orion"`.  
(3) Update your AWS config and credentials as per these instructions: [https://github.com/JCSDA-internal/r2d2/blob/develop/TUTORIAL.md#aws-credentials](https://github.com/JCSDA-internal/r2d2/blob/develop/TUTORIAL.md#aws-credentials). If you do not have access to the JCSDA-USAF account on “us-east-2”, then do not include that entry in each AWS file.  
(4) Execute R2D2’s store call in the following manner with your values replacing `provider`, `observation_type`, `file_extension`, `window_start`, and `window_length` with your values for each `source_file` provided.

from r2d2 import R2D2Data  
R2D2Data.store(  
item=‘observation’,  
provider=‘noaa’,  
observation\_type=‘amsua\_n15’,  
file\_extension=‘nc’,  
window\_start=‘2020-01-01T00:00:00Z’,  
window\_length=‘PT6H’,  
source\_file=‘/path/to/ioda/file.nc’)

---

<div class="post-metadata">

**Author:** ![mjhossen](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/mjhossen/32/186_2.png) [@mjhossen](https://forums.jcsda.org/u/mjhossen)\
**Post date:** [April 24, 2023, 6:56pm UTC](https://forums.jcsda.org/t/prepare-observations-for-jedi-soca-exp-r2d2-database/465/3 "2023-04-24T18:56:46Z")

</div>

> [@ericlingerfelt](#):
>
> [https://github.com/JCSDA-internal/r2d2/blob/develop/TUTORIAL.md#aws-credentials](https://github.com/JCSDA-internal/r2d2/blob/develop/TUTORIAL.md#aws-credentials)

I got error message related to AWS Access Key Id. I have no idea how I can get the AWS Access Key Id for Orion. Any suggestions for this?

---

<div class="post-metadata">

**Author:** ![ericlingerfelt](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/ericlingerfelt/32/183_2.png) [@ericlingerfelt](https://forums.jcsda.org/u/ericlingerfelt)\
**Post date:** [April 24, 2023, 6:58pm UTC](https://forums.jcsda.org/t/prepare-observations-for-jedi-soca-exp-r2d2-database/465/4 "2023-04-24T18:58:27Z")

</div>

The AWS access key is for your AWS user account for the JCSDA-NOAA accounts. It will be the same as the access keys you use locally on your laptop.

---

<div class="post-metadata">

**Author:** ![mjhossen](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/mjhossen/32/186_2.png) [@mjhossen](https://forums.jcsda.org/u/mjhossen)\
**Post date:** [April 24, 2023, 8:00pm UTC](https://forums.jcsda.org/t/prepare-observations-for-jedi-soca-exp-r2d2-database/465/5 "2023-04-24T20:00:02Z")

</div>

No success yet. I used my AWS personal account info. I do not have AWS for JCSDA-NOAA. I am wondering how I can link myself to JCSDA-NOAA.

---

<div class="post-metadata">

**Author:** ![ericlingerfelt](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/ericlingerfelt/32/183_2.png) [@ericlingerfelt](https://forums.jcsda.org/u/ericlingerfelt)\
**Post date:** [April 24, 2023, 8:05pm UTC](https://forums.jcsda.org/t/prepare-observations-for-jedi-soca-exp-r2d2-database/465/6 "2023-04-24T20:05:54Z")

</div>

Please contact the JEDI Infrastructure Team Lead at dom.heinzeller@ucar.edu. I do not have permissions to add users to that account.

---

<div class="post-metadata">

**Author:** ![mjhossen](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/mjhossen/32/186_2.png) [@mjhossen](https://forums.jcsda.org/u/mjhossen)\
**Post date:** [April 25, 2023, 3:35pm UTC](https://forums.jcsda.org/t/prepare-observations-for-jedi-soca-exp-r2d2-database/465/7 "2023-04-25T15:35:20Z")

</div>

I have run an existing experiments of JEDI-skylab as  
`create_experiment.py $JEDI_SRC/ewok/experiments/mom6-3dvar-5deg.yaml`

I got an error message related to ewok/src/yamltools/template.py:  
File “jedi-bundle/ewok/src/yamltools/template.py”, line 128, in substitute\_template\_variables  
full\_value = full\_value.replace(f’$({g})', value)  
TypeError: replace() argument 2 must be str, not None

Is it my mistake? Do I need to provide another yaml file? Or is it a bug?
