forked from trondkr/downscaleA20
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeleteDuplicateVariables.py
46 lines (33 loc) · 972 Bytes
/
deleteDuplicateVariables.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from __future__ import print_function
import numpy as np
import matplotlib
matplotlib.use('Agg')
import string, os, sys
from netCDF4 import Dataset
import netCDF4
from datetime import datetime
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from pylab import *
import datetime
import glob
from shutil import copyfile
try:
import ESMF
except:
print("Unable to continue without ESMF: install using : conda install -c conda-forge esmpy")
sys.exit()
__author__ = 'Trond Kristiansen'
__email__ = 'me (at) trondkristiansen.com'
__created__ = datetime.datetime(2019, 1, 21)
__modified__ = datetime.datetime(2019, 1, 25)
__version__ = "1.0"
__status__ = "Development, 21.1.2019, 25.01.2019"
def removeDuplicateVariables():
print("Running remove duplicates")
infile="RESULTS/a20_bry_NORESM_20060115_to_20501215_delta.nc"
cdf=Dataset(infile,'a')
print(cdf.variables)
atts = cdf.ncattrs()
del cdf.s_rho_2
cdf.close()