当前位置: 首页>>代码示例>>Python>>正文


Python Dataset.platform方法代码示例

本文整理汇总了Python中netCDF4.Dataset.platform方法的典型用法代码示例。如果您正苦于以下问题:Python Dataset.platform方法的具体用法?Python Dataset.platform怎么用?Python Dataset.platform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在netCDF4.Dataset的用法示例。


在下文中一共展示了Dataset.platform方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_bad_platform_variables

# 需要导入模块: from netCDF4 import Dataset [as 别名]
# 或者: from netCDF4.Dataset import platform [as 别名]
    def test_bad_platform_variables(self):
        '''
        Tests that the platform variable attributes check is working
        '''

        # Create an empty dataset that writes to /dev/null This acts as a
        # temporary netCDF file in-memory that never gets written to disk.
        nc_obj = Dataset(os.devnull, 'w', diskless=True)
        self.addCleanup(nc_obj.close)

        # The dataset needs at least one variable to check that it's missing
        # all the required attributes.
        nc_obj.createDimension('time', 1)
        nc_obj.platform = 'platform'
        # global attribute 'platform' points to variable that does not exist in dataset

        results = self.ioos.check_platform_variables(nc_obj)
        for result in results:
            self.assert_result_is_bad(result)
开发者ID:ioos,项目名称:compliance-checker,代码行数:21,代码来源:test_ioos_profile.py

示例2: dir

# 需要导入模块: from netCDF4 import Dataset [as 别名]
# 或者: from netCDF4.Dataset import platform [as 别名]
    if opt[0]=="-o":
      overwrite=1
    if opt[0]=="-g":
      doget=1
  if overwrite and doget:
    print "Unable overwrite the file while getting it"
    print "Make a better selection of command line options"
    sys.exit(1)

  # If we must overwrite the reference file, we need to
  # create it, first, otherwise, just open it for reading
  refname="reference.cdf"
  if overwrite:
    nc=Dataset(refname,"w")
    nc.version=sys.version
    nc.platform=sys.platform
    if 'byteorder' in dir(sys):
      nc.byteorder=sys.byteorder
    else:
      nc.byteorder="Unknown, Python older than 2.0??"
  else:
    # If there is no local copy of the file, get it from
    # its URL
    if os.access(refname,os.F_OK)==0 or doget:
      thedir="http://starship.python.net/crew/jsaenz/pyclimate/"
      thedir=thedir+"references/"
      theurl=thedir+pyclimate.tools.pyclimateversion()+"/"+refname
      print "There is no local copy of:",refname
      print "Do you want me to get it from"
      print theurl,"?[no]/yes"
      print "Warning: It is about 1.6 Mb"
开发者ID:tammasloughran,项目名称:PyClimateUpdate,代码行数:33,代码来源:pyclimatetest.py

示例3: len

# 需要导入模块: from netCDF4 import Dataset [as 别名]
# 或者: from netCDF4.Dataset import platform [as 别名]
    conusmask[:] = conusmask_ccpa

    thrnumv[:] = xc[:]
    thrvalv[:] = thresh[:]
 
    rootgrp.latcorners = [lats_anal[0,0], lats_anal[0,-1], lats_anal[-1,0], lats_anal[-1,-1]]
    rootgrp.loncorners = [lons_anal[0,0], lons_anal[0,-1], lons_anal[-1,0], lons_anal[-1,-1]]

    rootgrp.stream = "s4" # ????
    rootgrp.title = "Reforecast V2 accum. ensemble-mean precip forecast and analyzed CDF + rank correlation"
    rootgrp.Conventions = "CF-1.0"  # ????
    rootgrp.history = "Revised Mar 2016 by Hamill" 
    rootgrp.institution = \
        "Reforecast from ERSL/PSD using NCEP/EMC GEFS, circa 2012"
    rootgrp.platform = "Model" 
    rootgrp.references = "http://www.esrl.noaa.gov/psd/forecasts/reforecast2/" 
    
    # ---- open ensemble data file for each year, read in data, and augment cdf 
    #      information for that year if the sample is within the month of interest
    #      or the neighboring month

    rankcorr_fa = -99.99*np.ones((nja,nia),dtype=np.float)    
    nyears = len(range(2002,2016))
    print 'nsamps = ',92*nyears
    precipa = np.zeros((nja,nia),dtype=np.float)
    precipf3d = np.zeros((92*nyears,njf,nif),dtype=np.float)
    precipa3d = np.zeros((92*nyears,nja,nia),dtype=np.float)
    ipktr = 0

    infilename = input_data_directory+'/refcstv2_precip_ccpav3_'+\
开发者ID:ThomasMoreHamill,项目名称:analog,代码行数:32,代码来源:compute_precip_CCPAgrid_cdfs.py

示例4: Table

# 需要导入模块: from netCDF4 import Dataset [as 别名]
# 或者: from netCDF4.Dataset import platform [as 别名]
fid.institution = ["National Snow and Ice Data Center\n",
                   "Cooperative Institute for Research in Environmental Sciences\n",
                   "University of Colorado at Boulder\n",
                   "Boulder, CO"]
fid.publisher = ["National Snow and Ice Data Center\n",
                   "Cooperative Institute for Research in Environmental Sciences\n",
                   "University of Colorado at Boulder\n",
                   "Boulder, CO"]
fid.publisher_url = "http://nsidc.org/charis"
fid.publisher_email = "[email protected]"
fid.project = "CHARIS"
fid.standard_name_vocabulary = "CF Standard Name Table (v27, 28 September 2013)"
fid.cdm_data_type = "grid"
fid.keywords = "EARTH SCIENCE > SPECTRAL/ENGINEERING > MICROWAVE > BRIGHTNESS TEMPERATURE" 
fid.keywords_vocabulary = "NASA Global Change Master Directory (GCMD) Earth Science Keywords, Version 8.1"
fid.platform = "TBD"
fid.sensor = "TBD"
fid.naming_authority = "org.doi.dx"
fid.id = "10.5067/MEASURES/CRYOSPHERE/nsidc-0630.001"
fid.date_created = "TBD"
fid.acknowledgement = ["This data set was created with funding from NASA MEaSUREs Grant #NNX13AI23A.\n",
                       "Data archiving and distribution is supported by the NASA NSIDC Distributed Active Archive Center (DAAC)."]
fid.license = "No constraints on data access or use"
fid.processing_level = "Level 3"
fid.creator_name = "Mary J. Brodzik"
fid.creator_email = "[email protected]"
fid.creator_url = "http://nsidc.org/charis"
fid.contributor_name = "T. H. Painter, M. J. Brodzik, R. L. Armstrong"
fid.contributor_role = "Principal Investigator, Co-Investigator, Co-Investigator"
fid.citation = ["Brodzik, M. J., D. G. Long, M. A. Hardman, A. C. Paget. 2015.\n",
                "MEaSUREs Calibrated Passive Microwave Daily EASE-Grid 2.0 Brightness Temperature ESDR.\n",
开发者ID:mjbrodzik,项目名称:ipython_notebooks,代码行数:33,代码来源:make_MODICEv04_min05yr_netcdf.py


注:本文中的netCDF4.Dataset.platform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。