# Reading RY files in .bz2 format

**URL:** <https://openradar.discourse.group/t/reading-ry-files-in-bz2-format/210>\
**Category:** General\
**Created:** [April 8, 2023, 1:18pm UTC](https://openradar.discourse.group/t/reading-ry-files-in-bz2-format/210 "2023-04-08T13:18:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karnatishiva786](https://avatars.discourse-cdn.com/v4/letter/k/6f9a4e/32.png) [@karnatishiva786](https://openradar.discourse.group/u/karnatishiva786)\
**Post date:** [April 8, 2023, 1:18pm UTC](https://openradar.discourse.group/t/reading-ry-files-in-bz2-format/210/1 "2023-04-08T13:18:29Z")

</div>

Hello Everyone! I am trying to read RY product files using the following code, but I have been encountering with the error. My question is ‘Is wradlib library supports for RY product files with .bz2 format?’ or do I need to do any preprocessing to make it as normal .bin file ?

Code

```auto
import wradlib as wrl

# load radolan files
rw_filename = wrl.util.get_wradlib_data_file(
    "/content/raa01-ry_10000-2301010000-dwd---bin.bz2"
)
rrwdata, rwattrs = wrl.io.read_radolan_composite(rw_filename)
# print the available attributes
print("RW Attributes:", rwattrs)

```

Error:

```auto
UnicodeDecodeError Traceback (most recent call last)
<ipython-input-30-fa4ed02dc0cd> in <cell line: 5>()
      3 "/content/raa01-ry_10000-2301010000-dwd---bin.bz2"
      4 )
----> 5 rrwdata, rwattrs = wrl.io.read_radolan_composite(rw_filename)
      6 # print the available attributes
      7 print("RW Attributes:", rwattrs)

4 frames
/usr/local/lib/python3.9/dist-packages/wradlib/io/radolan.py in read_radolan_header(fid)
    715 if mychar == b"\x03":
    716 break
--> 717 header += str(mychar.decode())
    718 return header
    719 

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 0: unexpected end of data

```

Can someone please help me to resolve this issue?

---

<div class="post-metadata">

**Author:** ![kmuehlbauer](https://yyz2.discourse-cdn.com/free1/user_avatar/openradar.discourse.group/kmuehlbauer/32/439_2.png) [@kmuehlbauer](https://openradar.discourse.group/u/kmuehlbauer)\
**Post date:** [December 1, 2023, 5:22pm UTC](https://openradar.discourse.group/t/reading-ry-files-in-bz2-format/210/2 "2023-12-01T17:22:57Z")

</div>

Sorry, @karnatishiva786,

Your question fell through the cracks.

`.bz2` is a compressed format (bzip2). It can be decompressed using standard compression/decompression tools. Then it can be read just fine.

HTH,  
Kai
