Skip to content

Chengwenju/GRACE

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GRACE

Script

write_singlemonth_geotif.py

Purpose:

This Python script is used to convert the JPL GRACE Mascon file from netCDF4 to GeoTIFF format. The most current Mascon dataset can be found and downloaded from https://doi.org/10.5067/TEMSC-3JC62. This script decomposes the multi-year monthly Mascon netCDF file into single GeoTIFF files for each month.

Inputs and Outputs:

  1. Inputs: data path and filename (.nc)
  2. Outputs: output path.

Users need to manually modify the code at line 26 and 27 for the input and output strings. Output filenames are auto created. By default, the script will look in a local 'input' directory (./input/...) and write files to a local output (./output) directory.

update:

input_mascon_file = Path('./input/GRCTellus.JPL.200204_202008.GLO.RL06M.MSCNv02CRI.nc')
output_geotiff_path = Path('./output')

to

input_mascon_file = Path('PATH/TO/YOUR/INPUTFILE')
output_geotiff_path = Path('/PATH/TO/YOUR/OUTPUTFILE')

Pre-requisites:

The code works with both Python 2 and Python 3. The code has been tested on Mac OS and PC (Windows). Required Python libraries are listed below: 1. netCDF - https://unidata.github.io/netcdf4-python/netCDF4/index.html 2. gdal - https://pypi.org/project/GDAL/ 3. pathlib - https://www.python.org/dev/peps/pep-0428/

PO.DAAC contacts:

About

Code and Scripts for the GRACE mission

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%