'How can I read and then convert MODFLOW binary input files as text files on python?

I am trying to read the binary input rainfall and evapotranspiration data of a MODFLOW model on python. The data that I have downloaded is accessible at the following link:

https://water.usgs.gov/GIS/dsdl/gwmodels/SIR2014-5162/model.externalfiles.zip

The zip file in the above link contains several subfolders and the one that I am referring to can be found at this path (externalfiles\met_data\rch_inpd) after extracting the zip folder.

The following is the description of the files:

"Binary files containing daily NEXRAD rainfall data (RCH_INPD) and GOES satellite-based reference evapotranspiration (RET_MMPD) data used in the calibration/verification model and all scenarios. The binary files are standard MODFLOW-2005 binary files with standard headers and real single precision floating point data (dimensioned to NCOL by NROW). See line 1402 in SUBROUTINE ULASAV in code\MD_mfnwt\src\utl7.f for more information on the data types in the binary header."

The image shows the line 1402 in SUBROUTINE ULASAV in code\MD_mfnwt\src\utl7.f

The model grid has 101 columns and 189 rows.

By the way, I have read the answer to the question (How can I read data from a binary file generated by MODFLOW?) in this link https://water.usgs.gov/ogw/modflow-nwt/MODFLOW-NWT-Guide/frequently_asked_questions.html. But I couldn't figure out how to do it in python.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source