# Filtering and exporting CHOCHO

**URL:** https://forum.atmospherictoolbox.org/t/filtering-and-exporting-chocho/718
**Category:** HARP
**Tags:** sentinel-5p, python
**Created:** [December 5, 2023, 11:42am UTC](https://forum.atmospherictoolbox.org/t/filtering-and-exporting-chocho/718 "2023-12-05T11:42:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![kolanov](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/k/e495f1/32.png) [@kolanov](https://forum.atmospherictoolbox.org/u/kolanov)
#### Post date: [December 5, 2023, 11:42am UTC](https://forum.atmospherictoolbox.org/t/filtering-and-exporting-chocho/718/1 "2023-12-05T11:42:16Z")

</div>

Hello,  
I’m trying to filter a glyoxal observation with qa\_value \> 0.5, but I’m getting “harp.\_harppy.CLibraryError: could not derive variable ‘longitude {longitude}’”

```
operations = ';'.join([
        'C2H2O2_column_number_density_validity > 50',
        'keep(latitude, longitude, C2H2O2_column_number_density)',
        'derive(longitude{longitude})',
        'derive(latitude{latitude})'
        ])
  
imported_product = harp.import_product(
    product, 
    operations=operations,
    )
      
try:
    harp.export_product(
        imported_product,
        os.path.join(directory, product_filtered)
    )
    
except FileNotFoundError as e:
    sys.exit(f"File not found: {e}")

except ValueError as e:
    sys.exit(f"Value error: {e}")

except Exception as e:
    sys.exit(f"Error occurred during conversion: {e}")

```

When I don’t include the derive latitude/longitude line, I get this error when I’m exporting it to tif with rio.to\_raster function (rioxarray library):

“Error occurred during conversion: y dimension not found. ‘rio.set\_spatial\_dims()’ or using ‘rename()’ to change the dimension name to ‘y’ can address this. Data variable: C2H2O2\_column\_number\_density”

What’s the issue here?

---

<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: [December 5, 2023, 10:53pm UTC](https://forum.atmospherictoolbox.org/t/filtering-and-exporting-chocho/718/2 "2023-12-05T22:53:08Z")

</div>

The problem is that you are trying to treat the product as raster data while it is not.  
If you want to convert the data to a lat/lon grid you will have to use the `bin_spatial` operation. There is an [online use case](https://atmospherictoolbox.org/media/usecases/Usecase_2_S5P_AAI_Siberia_Smoke.html) that demonstrates this, but there are also many topics on this forum that cover this specific operation.
