fuel_moisture_model.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:wrfxpy 作者: openwfm 项目源码 文件源码
def to_netcdf(self, path):
        """
        Store the model in a netCDF file that attempts to be displayable
        using standard tools and loosely follows the WRF 'standard'.

        :param path: the path where to store the model
        """
        import netCDF4

        d = netCDF4.Dataset(path, 'w', format='NETCDF4')

        d0, d1, k = self.m_ext.shape

        d.createDimension('fuel_moisture_classes_stag', k)
        d.createDimension('south_north', d0)
        d.createDimension('west_east', d1)
        ncfmc = d.createVariable('FMC_GC', 'f4', ('south_north', 'west_east','fuel_moisture_classes_stag'))
        ncfmc[:,:,:] = self.m_ext
        ncfmc_cov = d.createVariable('FMC_COV', 'f4', ('south_north', 'west_east','fuel_moisture_classes_stag', 'fuel_moisture_classes_stag'))
        ncfmc_cov[:,:,:,:] = self.P

        d.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号