sarxarray icon indicating copy to clipboard operation
sarxarray copied to clipboard

Endianess of data

Open nilsdoe opened this issue 1 year ago • 1 comments

Hey,

thank you for this nice open-source project. I was wondering if you thought about adding the possibility to specify the endianess of the complex SAR data to load.

Thanks, Nils

nilsdoe avatar Jul 03 '24 11:07 nilsdoe

Hi @nilsdoe, thanks a lot for reaching out to us. And my apology for taking so long to reply.

I myself am not an expert in endianess. What we use in SARXarray is the standard Numpy data types. For example, in this documentation page, we use numpy.complex64. And according to Numpy documentation, by default the system native endian is used, with the possibility of customization.

Based on the information, I would expect if you follow the dtype constructing doc from Numpy, you can construct the dtype with the endian of your interest and pass it to sarxarray.from_binary().

For example, to read complex64 with big endian:

sarxarray.from_binary( ..., dtype='>c8')

Could you please give this a try?

rogerkuou avatar Sep 12 '24 13:09 rogerkuou