# Installing pyCRTM

**URL:** <https://forums.jcsda.org/t/installing-pycrtm/449>\
**Category:** CRTM\
**Created:** [April 6, 2023, 8:54pm UTC](https://forums.jcsda.org/t/installing-pycrtm/449 "2023-04-06T20:54:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhyey](https://avatars.discourse-cdn.com/v4/letter/d/9de0a6/32.png) [@dhyey](https://forums.jcsda.org/u/dhyey)\
**Post date:** [April 6, 2023, 8:54pm UTC](https://forums.jcsda.org/t/installing-pycrtm/449/1 "2023-04-06T20:54:17Z")

</div>

Hi,

I am trying to install pyCRTM using `https://github.com/JCSDA/pycrtm`. I have CRTM v2.4 already installed (not sure if it was built with ecbuild). The README instructs to modify `setup.cfg` with CRTM installation path that contains `lib/libcrtm.a`. But in my installation `libcrtm.a` is under `crtm-master/src/Build/libsrc` , which also has all the `.o` and `.mod` files. I think this is causing trouble since the installation script is expecting `lib/libcrtm.a`. Could you please guide me on this?

However, I was able to install pyCRTM for CRTM v2.3 using `https://github.com/karpob/pycrtm.git`.

My use of pyCRTM is limited to calculating channel transmittance. Is there any difference in results for transmittance calculations using CRTM v2.3 and v2.4?

Thanks a lot,  
Dhyey.

---

<div class="post-metadata">

**Author:** ![StegmannJCSDA](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/stegmannjcsda/32/53_2.png) [@StegmannJCSDA](https://forums.jcsda.org/u/StegmannJCSDA)\
**Post date:** [April 6, 2023, 9:48pm UTC](https://forums.jcsda.org/t/installing-pycrtm/449/2 "2023-04-06T21:48:02Z")

</div>

Hello @dhyey. No, for most cases there is no difference in the clearsky channel transmittance between v2.3 and v.2.4.

The directory in which `libcrtm.a` is located shouldn’t cause build issues with pycrtm.

---

<div class="post-metadata">

**Author:** ![dhyey](https://avatars.discourse-cdn.com/v4/letter/d/9de0a6/32.png) [@dhyey](https://forums.jcsda.org/u/dhyey)\
**Post date:** [April 14, 2023, 5:42pm UTC](https://forums.jcsda.org/t/installing-pycrtm/449/3 "2023-04-14T17:42:21Z")

</div>

Thanks a lot, @StegmannJCSDA. Since I will only use pyCRTM for calculating transmittance, I have decided to go forward with v2.3.

I have a few questions about setting up the pyCRTM.

1. Even when I am running the exact same script for pyCRTM, it keeps giving me an invalid FOV index error. It runs perfectly if I close the terminal every time before running the script. Could you please suggest any solution for this?
2. The definition of geometry was a little confusing. For airmass = 1 (nadir), I have currently set up satellite zenith angle (i.e., `profiles.Angles[i,0] = 0`) and scan angle (`profiles.Angles[i,4] = 1`). Is it the right way to set up for airmass = 1?
3. I expected to get 2 sets of transmittance values, one for ODAS and ODPS. My coefficient file has both. But I am only getting 1 set of values in `crtmOb.TauLevels` output. Is it for ODAS or ODPS?

Thanks a lot,  
Dhyey.

---

<div class="post-metadata">

**Author:** ![StegmannJCSDA](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/stegmannjcsda/32/53_2.png) [@StegmannJCSDA](https://forums.jcsda.org/u/StegmannJCSDA)\
**Post date:** [April 20, 2023, 3:58pm UTC](https://forums.jcsda.org/t/installing-pycrtm/449/4 "2023-04-20T15:58:23Z")

</div>

Hello @dhyey ,

> Even when I am running the exact same script for pyCRTM, it keeps giving me an invalid FOV index error.

→ This might be a memory issue but I will double check.

> The definition of geometry was a little confusing. For airmass = 1 (nadir), I have currently set up satellite zenith angle (i.e., `profiles.Angles[i,0] = 0`) and scan angle (`profiles.Angles[i,4] = 1`). Is it the right way to set up for airmass = 1?

→ I’m not sure what you mean by ‘airmass’ but yes, nadir corresponds to 0 degrees satellite zenith angle and the scan angle \theta\_S is related to the zenith angle \theta\_Z by the following formula:  
\frac{sin\ \theta\_Z}{R\_{earth}+h\_{Satellite}}=\frac{sin\ \theta\_S}{R}

> I expected to get 2 sets of transmittance values, one for ODAS and ODPS. My coefficient file has both. But I am only getting 1 set of values in `crtmOb.TauLevels` output. Is it for ODAS or ODPS?

→ The selection of ODPS or ODAS algorithm really depends on the type of instruments. MW and IR instruments typically use ODPS, whereas visible and UV instruments use ODAS.
