CMORPH binary files
Added by Joseph S over 5 years ago
Greetings:
I've attempted to use the import_binary operator to convert the CMORPH binary precipitation files to netcdf, but after multiple attempts, I am still unable to read, open, or convert the binary CMORPH files.
The bzip files are located here...
ftp://ftp.cpc.ncep.noaa.gov/precip/CMORPH_V1.0/CRT/8km-30min/2018/
I unpacked the files, and used the operator as described below to convert the files (note that the infiles are binary and do not have a file extension):
cdo -f nc import_binary infile outfile.nc
After reading several posts about this subject, I suspect that cdo is unable to read this particular type of binary file. If anyone has any additional suggestions or thoughts on the matter, please assist.
Thanks kindly.
Joseph
Replies (7)
RE: CMORPH binary files - Added by Karin Meier-Fleischer over 5 years ago
Hi Joseph,
have you read the documentation about import_binary? https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-7120002.14.1
-Karin
RE: CMORPH binary files - Added by Joseph S over 5 years ago
Hi Karin,
Yes, I read through the documentation on import_binary. I think I will need NCL for converting this particular type of CMORPH binary data.
Thanks kindly for your response.
Joseph
RE: CMORPH binary files - Added by Karin Meier-Fleischer over 5 years ago
If you have the information which are needed to create the GrADS description file you should be able to use the import_binary operator.
Example grads_description_file.ctl:
DSET ^CMORPH_V1.0_ADJ_8km-30min_2018013123 OPTIONS sequential UNDEF −9e+33 XDEF 360 LINEAR −179.5 1 YDEF 180 LINEAR −89.5 1 ZDEF 1 LINEAR 1 1 TDEF 1 LINEAR 00:00Z15jun1989 12hr VARS 1 param 1 99 description of the variable ENDVARS
cdo import_binary grads_description_file.ctl outfile.bin
-Karin
RE: CMORPH binary files - Added by Joseph S over 5 years ago
Hi Karin,
Yes, there is a single ctl file:
ftp://ftp.cpc.ncep.noaa.gov/precip/CMORPH_V1.0/CTL/CMORPH_V1.0_CRT_8km-30min.ctl
and the CMORPH binaries are located here:
ftp://ftp.cpc.ncep.noaa.gov/precip/CMORPH_V1.0/CTL/CMORPH_V1.0_CRT_8km-30min.ctl
I ran the command:
cdo -b nc import_binary CMORPH_V1.0_CRT_8km-30min.ctl outfile.nc
That command produces an nc file with the lat-lon dimensions, but no other variables. I think I may be missing a step that merges the outfile.nc with the CMORPH binaries, but so far, I do not understand the next step, assuming there is one.
Other research that I've read suggests that I may need to use NCL or MATLAB to process the CMORPH binaries, but I would also like to learn how to accomplish this with CDO, if it's possible.
Thanks kindly for any assistance or ideas you may have. I'm finding CDO very useful so far, but I'm stumbling on this CMORPH binaries issue for now.
Joseph
RE: CMORPH binary files - Added by Joseph S over 5 years ago
Correction. I meant to post:
...and the CMORPH binaries are located here:
ftp://ftp.cpc.ncep.noaa.gov/precip/CMORPH_V1.0/CRT/8km-30min/2017/
RE: CMORPH binary files - Added by Karin Meier-Fleischer over 5 years ago
The GrADS descriptor file is wrong for the given 744 files containing 2 timesteps each.
DSET ^CMORPH_V1.0_ADJ_8km-30min_%y4%m2%d2%h2 OPTIONS template little_endian UNDEF -999.0 TITLE Precipitation estimates XDEF 4948 LINEAR 0.036378335 0.072756669 YDEF 1649 LINEAR -59.963614 0.072771377 ZDEF 1 LEVELS 1 TDEF 1488 LINEAR 00Z01dec2017 30mn VARS 1 cmorph 1 99 cmorph [ mm/hr ] ENDVARS
After unpacking the files into a separate directory (where the descriptor file is copied, too) the following command do what it should to do
cdo -r -f nc -setreftime,2017-12-01,00:00:00,minutes -import_binary descriptor.ctl outfile.nc
Note: Take a look at the description of a GrADS descriptor file and know your data. The file names already gives you the time information you need.
-Karin
RE: CMORPH binary files - Added by Joseph S over 5 years ago
Hi Karin,
Thank you for the explanation and solution. I'm still in the process of learning the CDO commands, and your solution had not occurred to me.
Joseph