Skip to content

Misreading of PP files #161

@dangalea

Description

@dangalea

Hi,

I am trying to read in a .pp file outputted from a UM run but two variables, U and V, had some missing values. I think that cf is not handling the file correctly. After converting the PP file to an NC file, no values were missing. Below is a plot of U at 850hPa comparing the two results:

compare

The code used to generate the above plot is the following:

import cf
import numpy as np
import matplotlib.pyplot as plt

nc = cf.read("bz203a.pc19890101.pp")

pp_field = nc.select("eastward_wind")[-4]
pp_field.dump()

nc = cf.read("bz203a.pc19890101.nc")

nc_field = nc.select("eastward_wind")[1]
nc_field.dump()

plt.figure(figsize=(15, 5))

plt.subplot(121)
plt.title("PP File")
plt.contourf(pp_field.data.array[0, :, :])
plt.colorbar()

plt.subplot(122)
plt.title("NC File")
plt.contourf(nc_field.data.array[0, 0, :, :])
plt.colorbar()

plt.savefig("compare.png")

The example files are on JASMIN at /work/scratch-nopw/dg/example along with the code to create the example and the script used to convert the PP file to an NC file.

Environment (via cf.environment(paths=False)):

Platform: Linux-3.10.0-1127.19.1.el7.x86_64-x86_64-with-centos-7.8.2003-Core
HDF5 library: 1.10.4
netcdf library: 4.6.3
udunits2 library: /opt/jaspy/lib/libudunits2.so.0
python: 3.7.1
netCDF4: 1.5.3
cftime: 1.1.1.2
numpy: 1.17.0
psutil: 5.6.3
scipy: 1.4.1
matplotlib: 3.1.1
ESMF: not available
cfdm: 1.8.0
cfunits: 3.2.5
cfplot: not available
cf: 3.2.0

Metadata

Metadata

Labels

bugSomething isn't workingum/ppRelating to UM or PP format files

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions