Core Objects

Extensive detail on the PseudoNetCDF module as a whole is available. This section documents the core that everyone uses. Even if you use CMAQ, CAMx, GEOS-Chem, ICARTT, … or any specific file… most of its the time you need to know three things:

import PseudoNetCDF as pnc
path = '/path/to/file'
fmt = 'format'  # e.g., netcdf, ioapi, ffi1001, bpch, uamiv, ...
f = pnc.pncopen(path, format=fmt)

# For a list of formats, run `pnc.pncopen(help=True)`
  • Question: What is f?

  • Answer: It is a PseudoNetCDFFile, which

    • has dimensions, variables, and properties.

      • The variables dictionary has PseudoNetCDFVariable objects that have:

        • dimensions, properties, and values.

        • they also act like numpy arrays.

      • The dimenions dictionary has PseudoNetCDFDimension objects that have: * length, and isunlimited property

    • The file object can be subset:

      • by variable (see subset)

      • by dimension (applies to all variables; see slice)

    • The file object can apply functions to dimensions (applies to all variables; see apply)

      • mean, sum, min, max, std, … any numpy by name, or

      • any custom function,

      • for example: mf = f.apply(time=’mean’)

    • The file object can be interpolated along dimensions (see interpDimension)

    • The file object can do so much more…

If you have more questions, go back to the Example scripts or the API. If you still have questions, open an issue on github.