0

I want to know how to translate a netcdf file to a binary file IN PYTHON. I have some timeseries data in a netcdf file. I want to change it to a binary file so that I can run TIMESAT to extract phenological metrics.

Has someone already solved this problem? Or can I use Arcmap to build models to do this process?

2
  • 2
    You can read a NetCDF file with e.g. the NetCDF4 package, and write data in binary format with open(...., "wb"). Commented Oct 28, 2017 at 13:28
  • don't forget too that you can calculate a lot of useful metrics directly on the netcdf file itself using CDO from the command line Commented Aug 3, 2020 at 8:25

2 Answers 2

2

NCO converts netCDF to binary as illustrated here, e.g.,

ncks -C -O -v one_dmn_rec_var -b bnr.dat -p ~/nco/data in.nc out.nc
Sign up to request clarification or add additional context in comments.

Comments

1

You can just use gdal_translate to convert from netcdf to binary. See: http://web.nateko.lu.se/timesat/timesat.asp?cat=5 and http://www.gdal.org/gdal_translate.html

My favorite way to install gdal is with conda. Download anaconda or miniconda and for free from https://www.anaconda.com/ and then do:

conda install -c conda-forge gdal

1 Comment

Thanks for the response, basiclly I know Timesat well, but for gdal_translate, I don'tn know how to use fot data conversion especially I need from NETCDF to BINARY. Do you have examples? or give me more information about how to use gdal_translate. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.