Created
October 28, 2014 19:46
-
-
Save Eastonium/91f0d1269c2ce63d7e77 to your computer and use it in GitHub Desktop.
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
from netCDF4 import Dataset | |
import glob | |
import time | |
#This is a simple script to add to the end of the history attribute in netCDF files | |
for f in glob.glob("/data/home/gervais/prod/jobs/0431/collection/fkb/fkbmwrhfM1.b1/*.cdf"): #Path to data | |
ncfile = Dataset(f, "r+"); | |
ncfile.history +=" Modified by user <user> on machine <machine> at "+time.strftime("%d-%b-%Y,%H:%M:%S")+" using scripts/RID0431/mod.py $";#The last bit about scripts is optional | |
print ncfile.history; | |
ncfile.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment