Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import netCDF4 as nc
- ncfile = nc.Dataset("/pathway/file.nc", "r")
- ncfile.dimensions.keys()
- [u'time', u'lat', u'lon', u'bnds']
- ncfile.variables.keys()
- [u'time', u'time_bnds', u'lat', u'lat_bnds', u'lon', u'lon_bnds', u'snc']
- for attr in ncfile.ncattrs():
- print attr, '=', getattr(ncfile, attr)
- institution = CCCma (Canadian Centre for Climate Modelling and Analysis, Victoria, BC, Canada)
- institute_id = CCCma
- experiment_id = rcp85
- source = CanESM2 2010 atmosphere: CanAM4 (AGCM15i, T63L35) ocean: CanOM4 (OGCM4.0, 256x192L40) and CMOC1.2 sea ice: CanSIM1 (Cavitating Fluid, T63 Gaussian Grid) land: CLASS2.7 and CTEM1
- model_id = CanESM2
- forcing = GHG,Oz,SA,BC,OC,LU,Sl (GHG includes CO2,CH4,N2O,CFC11,effective CFC12. Sl is the repeat of the 23rd solar cycle, years 1997-2008, after year 2008.)
- parent_experiment_id = historical
- parent_experiment_rip = r1i1p1
- branch_time = 56940.0
- contact = cccma_info@ec.gc.ca
- references = http://www.cccma.ec.gc.ca/models
- initialization_method = 1
- physics_version = 1
- tracking_id = ebf1ab27-15be-45df-a8f3-dbac739f9191
- branch_time_YMDH = 2006:01:01:00
- CCCma_runid = IDR
- CCCma_parent_runid = IGM
- CCCma_data_licence = 1) GRANT OF LICENCE - The Government of Canada (Environment Canada) is the
- owner of all intellectual property rights (including copyright) that may exist in this Data
- product. You (as "The Licensee") are hereby granted a non-exclusive, non-assignable,
- non-transferable unrestricted licence to use this data product for any purpose including
- the right to share these data with others and to make value-added and derivative
- products from it. This licence is not a sale of any or all of the owner's rights.
- 2) NO WARRANTY - This Data product is provided "as-is"; it has not been designed or
- prepared to meet the Licensee's particular requirements. Environment Canada makes no
- warranty, either express or implied, including but not limited to, warranties of
- merchantability and fitness for a particular purpose. In no event will Environment Canada
- be liable for any indirect, special, consequential or other damages attributed to the
- Licensee's use of the Data product.
- product = output
- experiment = RCP8.5
- frequency = mon
- creation_date = 2011-03-17T20:06:09Z
- history = 2011-03-17T20:06:09Z CMOR rewrote data to comply with CF standards and CMIP5 requirements.
- Conventions = CF-1.4
- project_id = CMIP5
- table_id = Table LImon (31 January 2011) 6f05b7e5f64aaa34bcac127ca47ac655
- title = CanESM2 model output prepared for CMIP5 RCP8.5
- parent_experiment = historical
- modeling_realm = landIce land
- realization = 1
- cmor_version = 2.5.4
- snc= ncfile.variables["snc"][:][0]
- array([[-90. , -86.48016542],
- [-86.48016542, -83.70472247],
- [-83.70472247, -80.91926226],
- [-80.91926226, -78.13125563],
- [-78.13125563, -75.34220992],
- [-75.34220992, -72.55263609],
- [-72.55263609, -69.76275656],
- [-69.76275656, -66.97268406],
- xmin, ymin, xmax, ymax = [lon.min(), lat.min(), lon.max(), lat.max()]
- (0.0, -87.863801343710804, 357.1875, 87.863801343710804)
Add Comment
Please, Sign In to add comment