# GOME2 SO2 SCD error in coda.fetch ingestion

**URL:** https://forum.atmospherictoolbox.org/t/gome2-so2-scd-error-in-coda-fetch-ingestion/894
**Category:** CODA
**Tags:** gome-2
**Created:** [March 17, 2025, 2:15pm UTC](https://forum.atmospherictoolbox.org/t/gome2-so2-scd-error-in-coda-fetch-ingestion/894 "2025-03-17T14:15:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mariliza](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@mariliza](https://forum.atmospherictoolbox.org/u/mariliza)
#### Post date: [March 17, 2025, 2:15pm UTC](https://forum.atmospherictoolbox.org/t/gome2-so2-scd-error-in-coda-fetch-ingestion/894/1 "2025-03-17T14:15:53Z")

</div>

Greetings Sander,

I am trying to ingest a GOME-2A file GOME\_O3-SO2\_L2\_20190623230357\_050\_METOPA\_65782\_DLR\_03.HDF5 using the following:

```
              product = harp.import_product(ffile, options = 'detailed_results=SO2;corrected=true;so2_column=15km', \
                         operations = 'solar_zenith_angle <= 75; scan_direction_type==0;SO2_column_number_density_validity!& 255;\
                         derive(SO2_column_number_density [DU]);derive(SO2_slant_column_number_density [DU]);\
                         derive(SO2_column_number_density_uncertainty [DU]); \
                         keep(latitude,longitude, solar_zenith_angle,\
                              SO2_column_number_density,SO2_column_number_density_uncertainty,\
                              SO2_slant_column_number_density, \
                              cloud_fraction,SO2_column_number_density_validity, index)')
                                           
               with coda.open(ffile) as pf:
                    # variables that are not in the ingestion definition need to be ingested by coda
                    # 0 is the first height, 15km
                    # 3 is the 4th species in the sequence, i.e. SO2
                    product.chisq = harp.Variable(coda.fetch(pf, "DETAILED_RESULTS/FittingChiSquare")[product.index.data,0], ["time"])
                    ESC = harp.Variable(coda.fetch(pf, "DETAILED_RESULTS/ESC")[product.index.data,3], ["time"])
                    ESC_Error = harp.Variable(coda.fetch(pf, "DETAILED_RESULTS/ESC_Error")[product.index.data,3], ["time"])
                    product.SO2_slant_column_number_density_uncertainty = harp.Variable(ESC_Error.data * 0.01 * ESC.data,["time"])  

```

It is the second day of the Raikoke eruption, so there are plenty of valid data points. I tried with other files of the day as well, of course. I went through the ingestion definition, [GOME2\_L2\_O3MOTO — HARP 1.25 documentation](https://stcorp.github.io/harp/doc/html/ingestions/GOME2_L2_O3MOTO.html), and I understand that the 4th, i.e. python index 3, is the SO2 “window”. However, I get the following error in python.

* * *

IndexError Traceback (most recent call last)  
Cell In[23], line 6  
1 with coda.open(ffile) as pf:  
2 # variables that are not in the ingestion definition need to be ingested by coda  
3 # 0 is the first height, 15km  
4 # 3 is the 4th species in the sequence, i.e. SO2  
5 product.chisq = harp.Variable(coda.fetch(pf, “DETAILED\_RESULTS/FittingChiSquare”)[product.index.data,0], [“time”])  
----\> 6 ESC = harp.Variable(coda.fetch(pf, “DETAILED\_RESULTS/ESC”)[product.index.data,3], [“time”])  
7 ESC\_Error = harp.Variable(coda.fetch(pf, “DETAILED\_RESULTS/ESC\_Error”)[product.index.data,3], [“time”])  
8 product.SO2\_slant\_column\_number\_density\_uncertainty = harp.Variable(ESC\_Error \* 0.01 \* ESC,[“time”])

IndexError: index 3 is out of bounds for axis 1 with size 2

I am using harp 1.23 on python 3.11.7. Any help very welcome as always!

Best wishes,  
MariLiza

---

<div class="post-metadata">

### Author: ![sander.niemeijer](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/sander.niemeijer/32/5_2.png) [@sander.niemeijer](https://forum.atmospherictoolbox.org/u/sander.niemeijer)
#### Post date: [March 18, 2025, 10:49am UTC](https://forum.atmospherictoolbox.org/t/gome2-so2-scd-error-in-coda-fetch-ingestion/894/2 "2025-03-18T10:49:42Z")

</div>

I think this is because you cannot consider the `window` index to be fixed.  
See also the [mapping description in HARP](https://stcorp.github.io/harp/doc/html/ingestions/GOME2_L2_O3MOTO.html) (bottom section). You need to use a window index using `the index in MainSpecies[] that has the value ‘SO2’`

---

<div class="post-metadata">

### Author: ![mariliza](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@mariliza](https://forum.atmospherictoolbox.org/u/mariliza)
#### Post date: [March 18, 2025, 1:18pm UTC](https://forum.atmospherictoolbox.org/t/gome2-so2-scd-error-in-coda-fetch-ingestion/894/3 "2025-03-18T13:18:11Z")

</div>

Well, this is a bit worrying. I always thought that the species within the GOME2 files are in the same order, always, as per Table in page 38 of the PUM, [Microsoft Word - DLR\_GOME-2\_PUM\_3B\_Nov2019](https://acsaf.org/docs/pum/Product_User_Manual_NTO_OTO_Nov_2019.pdf).

I.e. O3 is always 1st, SO2 is always 4th, etc.

Obviously, I was mistaken, print out of the META\_DATA for the orbits of June 23rd 2019:

Indices of ‘SO2’: [3]  
[‘O3’ ‘NO2’ ‘BrO’ ‘SO2’ ‘H2O’ ‘HCHO’]  
Indices of ‘SO2’: [3]  
[‘O3’ ‘NO2’ ‘BrO’ ‘SO2’ ‘H2O’ ‘HCHO’]  
Indices of ‘SO2’: [3]  
[‘O3’ ‘NO2’ ‘BrO’ ‘SO2’ ‘H2O’ ‘HCHO’]  
Indices of ‘SO2’: [3]  
[‘O3’ ‘NO2’ ‘BrO’ ‘SO2’ ‘H2O’ ‘HCHO’]  
Indices of ‘SO2’: [3]  
[‘O3’ ‘NO2’ ‘BrO’ ‘SO2’ ‘H2O’ ‘HCHO’]  
Indices of ‘SO2’: [1]  
[‘O3’ ‘SO2’]

I checked and this specific file’s filename only contains two species as well.

Will alter the python script, thanks!  
MariLiza
