pycaps.diagnostic package

Submodules

pycaps.diagnostic.arps_gridinfo module

arps_gridinfo(arpsfile, format='hdf', **kwargs)[source]
Parameters:
  • arpsfile – the file for which you want grid information
  • format – OPTIONAL – The format of your history file (valid choices are ‘hdf’ and ‘netcdf’)
  • grdbas – OPTIONAL – A separate file (.netgrdbas or .hdfgrdbas) containing gridbase data, if needed.
Returns:

<<nothing>> (Prints grid information to terminal)

pycaps.diagnostic.listvars module

listvars(source, shapefile=False)[source]

Gives a list of the variables, attributes, and dimensions contained in a NetCDF or HDF file. If called with shapefile = True, it will instead provide information on variables contained in a shapefile.

Parameters:
  • source – The file whose contents you wish to list (for best results, give full path)
  • shapefile – OPTIONAL – If shapefile = True, listvars will attempt to open the source as a shapefile and give relevant information about the contents.
Returns:

<<nothing>> (prints information about file contents to the terminal window)

pycaps.diagnostic.patchinfo module

patchinfo(format='hdf', **kwargs)[source]

Given an ARPS history file or a specified domain size (nx by ny), returns information on valid patch configurations for MPI runs.

Parameters:
  • format – OPTIONAL – The format of your history file (valid choices are ‘hdf’ and ‘netcdf’)
  • file – OPTIONAL – If you want to run patchinfo on an existing ARPS history dump file, the path to that file.
  • nx – OPTIONAL – If you want to specify dimensions manually, # of x-gridpoints (remember ARPS adds 3 points to the edges!)
  • ny – OPTIONAL – If you want to specify dimensions manually, # of y-gridpoints (remember ARPS adds 3 points to the edges!)
  • target – OPTIONAL – A target number of processors; show detailed information on patch configurations near this target.
  • tolerance – OPTIONAL – Given with a target, how close a configuration must be (in terms of # of procs) to be shown.
Returns:

<<nothing>> (Prints grid information to terminal)

pycaps.diagnostic.vardump module

var_dump(var, source, filefmt='hdf')[source]

Dumps the contents of a given variable, attribute, or dimension from a NetCDF or HDF file to the terminal window. Good for sanity checks or when you want to confirm a dimension or attribute is correctly set (var_info works well for this too.)

Parameters:
  • var – The name of the variable you want to dump.
  • source – The HDF or NetCDF file containing the data you want to dump. For best results, provide a full path.
  • filefmt – OPTIONAL – The format of the file you’re reading from (default: hdf). Valid options are ‘hdf’ and ‘netcdf’.
Returns:

<<nothing>> (dumps the requested information to the terminal window)

pycaps.diagnostic.varinfo module

var_info(var, source, verbose=False, format='hdf')[source]

Gives information on the dimensions, maximum, minimum, and average values of a variable in an HDF or NetCDF file. Good for spotting gross errors (e.g. NaN values, unrealistically high or low values). Verbose mode also includes information on NetCDF or HDF attritubes and dimensions.

Parameters:
  • var – the name of the variable to update (as stored in the file)
  • source – the path to the file the data are stored in
  • verbose – OPTIONAL – Passing verbose as True will give extra data on HDF/NetCDF variable attributes and dimensions. Default is False.
  • format – OPTIONAL – The format your data are stored in (default: hdf). Valid options are ‘hdf’ and ‘netcdf’.
Returns:

<<nothing>> (prints variable information to the terminal window)

Module contents