Last active
May 3, 2021 14:32
-
-
Save willrayeo/218bd2d59caf5e2ec088d489a0b99af6 to your computer and use it in GitHub Desktop.
creating new variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#convert VV DN to Decibels | |
vv_dn = s1_cube.VV | |
vv_db = 10 * (xr.ufuncs.log10(vv_dn)) | |
vv_db = vv_db.where(xr.ufuncs.isfinite(vv_db), 0) | |
# attribute long name and units to new variable | |
vv_db.attrs['long_name']='VV_dB' | |
vv_db.attrs['units']='decibels' | |
# define the new variable | |
s1_cube['VV_dB']= vv_db |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment