thk_var.long_name = "land ice thickness" thk_var.standard_name = "land_ice_thickness" thk_var.grid_mapping = mapping_var thk_var[:] = np.flipud(result) rho_var = nc.createVariable("rho", 'b', dimensions=("y", "x"),fill_value=fill_value) rho_var.long_name = "data density integer mask" rho_var.flag_values = "0b, 1b" rho_var.flag_meanings = "no_data data" rho_var.grid_mapping = mapping_var rho_var[:] = np.flipud(rho) x[:] = easting y[:] = northing # Save the projection information: nc.projection = proj4_str nc.Conventions = "CF-1.5" # writing global attributes import time script_command = ' '.join([time.ctime(), ':', __file__.split('/')[-1], ' '.join([str(l) for l in args])]) nc.history = script_command print "writing to %s ...\n" % out_filename print "run nc2cdo.py to add lat/lon variables" nc.close()