# Clibrary Error in HARP during merge of S5P files

**URL:** https://forum.atmospherictoolbox.org/t/clibrary-error-in-harp-during-merge-of-s5p-files/719
**Category:** HARP
**Tags:** sentinel-5p, python
**Created:** [December 7, 2023, 7:23am UTC](https://forum.atmospherictoolbox.org/t/clibrary-error-in-harp-during-merge-of-s5p-files/719 "2023-12-07T07:23:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pm21ms212](https://forum.atmospherictoolbox.org/letter_avatar_proxy/v4/letter/p/c57346/32.png) [@pm21ms212](https://forum.atmospherictoolbox.org/u/pm21ms212)
#### Post date: [December 7, 2023, 7:23am UTC](https://forum.atmospherictoolbox.org/t/clibrary-error-in-harp-during-merge-of-s5p-files/719/1 "2023-12-07T07:23:00Z")

</div>

import harp  
import numpy as np  
import matplotlib.pyplot as plt  
import cartopy.crs as ccrs  
from cmcrameri import cm  
import eofetch  
import os  
import matplotlib.ticker as mticker  
from cartopy.mpl.gridliner import LONGITUDE\_FORMATTER, LATITUDE\_FORMATTER  
os.chdir(“E:/t\_3/”)

operations = “;”.join([  
“CH4\_column\_volume\_mixing\_ratio\_dry\_air\_validity\>50”,  
“keep(latitude\_bounds,longitude\_bounds,datetime\_start,datetime\_length,CH4\_column\_volume\_mixing\_ratio\_dry\_air)”,  
“derive(datetime\_stop {time} [days since 2000-01-01])”,  
“derive(datetime\_start [days since 2000-01-01])”,  
“exclude(datetime\_length)”,  
“bin\_spatial(1801,-90,0.1,3601,-180,0.1)”,  
“derive(latitude {latitude})”,  
“derive(longitude {longitude})”,  
])  
reduce\_operations = “squash(time, (latitude, longitude, latitude\_bounds, longitude\_bounds));bin()”  
filenames = “S5P\_OFFL\_L2\_\_CH4\*.nc”  
merged = harp.import\_product(filenames, operations, reduce\_operations=reduce\_operations)  
#print(merged)  
harp.export\_product(merged, ‘s5p-ch4\_L3\_3\_2023.nc’)  
I successfully merged the 2022 S5P data of CH4 using this code, but when I try to merge the 2023, 2021, or even 2020 data, I get a “CLibraryError,” which may be the result of a few files that aren’t suitable for merging. If you could provide me a bypass, that would allow it to skip over any files that it finds incompatible and proceed with the merge instead of throwing me various errors when I try to add the try-catch block, that would be great. Please fix this issue and provide me the revised code; I’ll be appreciative.  
Thank You
