User API

Routines

GeoCAT-comp native routines

geocat.comp.climatologies.anomaly(dset, freq)

Compute anomalies for a specified time frequency.

geocat.comp.climatologies.calendar_average(...)

This function divides the data into time periods (months, seasons, etc) and computes the average for the data in each one.

geocat.comp.climatologies.climatology(dset, freq)

Compute climatologies for a specified time frequency.

geocat.comp.climatologies.climatology_average(...)

This function calculates long term hourly, daily, monthly, or seasonal averages across all years in the given dataset.

geocat.comp.climatologies.month_to_season(...)

Computes a user-specified three-month seasonal mean.

geocat.comp.crop.actual_saturation_vapor_pressure(tdew)

Compute 'actual' saturation vapor pressure [kPa] as described in the Food and Agriculture Organization (FAO) Irrigation and Drainage Paper 56 entitled:

geocat.comp.crop.max_daylight(jday, lat)

Computes maximum number of daylight hours as described in the Food and Agriculture Organization (FAO) Irrigation and Drainage Paper 56 entitled:

geocat.comp.crop.psychrometric_constant(pressure)

Compute psychrometric constant [kPa / C] as described in the Food and Agriculture Organization (FAO) Irrigation and Drainage Paper 56 entitled:

geocat.comp.crop.saturation_vapor_pressure(...)

Compute saturation vapor pressure as described in the Food and Agriculture Organization (FAO) Irrigation and Drainage Paper 56 entitled:

geocat.comp.crop.saturation_vapor_pressure_slope(...)

Compute the slope [kPa/C] of saturation vapor pressure curve as described in the Food and Agriculture Organization (FAO) Irrigation and Drainage Paper 56 entitled:

geocat.comp.eofunc.eofunc_eofs(data[, ...])

Computes empirical orthogonal functions (EOFs, aka: Principal Component Analysis).

geocat.comp.eofunc.eofunc_pcs(data[, npcs, ...])

Computes the principal components (time projection) in the empirical orthogonal function analysis.

geocat.comp.fourier_filters.fourier_band_block(...)

Filter a dataset by frequency.

geocat.comp.fourier_filters.fourier_band_pass(...)

Filter a dataset by frequency.

geocat.comp.fourier_filters.fourier_filter(...)

Filter a dataset by frequency.

geocat.comp.fourier_filters.fourier_low_pass(...)

Filter a dataset by frequency.

geocat.comp.fourier_filters.fourier_high_pass(...)

Filter a dataset by frequency.

geocat.comp.interpolation.interp_hybrid_to_pressure(...)

Interpolate data from hybrid-sigma levels to isobaric levels.

geocat.comp.interpolation.interp_sigma_to_hybrid(...)

Interpolate data from sigma to hybrid coordinates.

geocat.comp.meteorology.dewtemp(temperature, ...)

This function calculates the dew point temperature given temperature and relative humidity using equations from John Dutton's "Ceaseless Wind" (pp 273-274)

geocat.comp.meteorology.heat_index(...[, ...])

Compute the 'heat index' as calculated by the National Weather Service.

geocat.comp.meteorology.relhum(temperature, ...)

This function calculates the relative humidity given temperature, mixing ratio, and pressure.

geocat.comp.meteorology.relhum_ice(...)

Calculates relative humidity with respect to ice, given temperature, mixing ratio, and pressure.

geocat.comp.meteorology.relhum_water(...)

Calculates relative humidity with respect to water, given temperature, mixing ratio, and pressure.

geocat.comp.polynomial.detrend(data[, deg, axis])

Estimates and removes the trend of the leftmost dimension from all grid points.

geocat.comp.polynomial.ndpolyfit(x, y, deg)

An extension to numpy.polyfit function to support multi-dimensional arrays, Dask arrays, and missing values.

geocat.comp.polynomial.ndpolyval(p, x[, axis])

Extended version of numpy.polyval to support multi-dimensional outputs provided by geocat.comp.ndpolyfit.

geocat.comp.skewt_params.get_skewt_vars(p, ...)

This function processes the dataset values and returns a string element which can be used as a subtitle to replicate the styles of NCL Skew-T Diagrams.

geocat.comp.skewt_params.showalter_index(...)

Calculate Showalter Index from pressure temperature and 850 hPa lcl.

GeoCAT-comp routines from GeoCAT-f2py

geocat.comp.dpres_plevel(pressure_levels, ...)

Calculates the pressure layer thicknesses of a constant pressure level coordinate system.

geocat.comp.grid_to_triple(data[, x_in, ...])

Converts a two-dimensional grid with one-dimensional coordinate variables to an array where each grid value is associated with its coordinates.

geocat.comp.linint1(fi, xo[, xi, icycx, msg_py])

Interpolates from one series to another using piecewise linear interpolation across the rightmost dimension.

geocat.comp.linint2(fi, xo, yo[, xi, yi, ...])

Interpolates a regular grid to a rectilinear one using bi-linear interpolation. linint2 uses bilinear interpolation to interpolate from one rectilinear grid to another. The input grid may be cyclic in the x direction. The interpolation is first performed in the x direction, and then in the y direction. :param fi: An array of two or more dimensions. If xi is passed in as an argument, then the size of the rightmost dimension of fi must match the rightmost dimension of xi. Similarly, if yi is passed in as an argument, then the size of the second- rightmost dimension of fi must match the rightmost dimension of yi. If missing values are present, then linint2 will perform the bilinear interpolation at all points possible, but will return missing values at coordinates which could not be used. Note: This variable must be supplied as a xarray.DataArray in order to copy the dimension names to the output. Otherwise, default names will be used. :type fi: xarray.DataArray or numpy.ndarray: :param xo: A one-dimensional array that specifies the X coordinates of the return array. It must be strictly monotonically increasing, but may be unequally spaced. For geo-referenced data, xo is generally the longitude array. If the output coordinates (xo) are outside those of the input coordinates (xi), then the fo values at those coordinates will be set to missing (i.e. no extrapolation is performed). :type xo: xarray.DataArray or numpy.ndarray: :param yo: A one-dimensional array that specifies the Y coordinates of the return array. It must be strictly monotonically increasing, but may be unequally spaced. For geo-referenced data, yo is generally the latitude array. If the output coordinates (yo) are outside those of the input coordinates (yi), then the fo values at those coordinates will be set to missing (i.e. no extrapolation is performed). :type yo: xarray.DataArray or numpy.ndarray: :param xi (numpy.ndarray): An array that specifies the X coordinates of the fi array. Most frequently, this is a 1D strictly monotonically increasing array that may be unequally spaced. In some cases, xi can be a multi-dimensional array (see next paragraph). The rightmost dimension (call it nxi) must have at least two elements, and is the last (fastest varying) dimension of fi. If xi is a multi-dimensional array, then each nxi subsection of xi must be strictly monotonically increasing, but may be unequally spaced. All but its rightmost dimension must be the same size as all but fi's rightmost two dimensions. For geo-referenced data, xi is generally the longitude array. Note: If fi is of type xarray.DataArray and xi is left unspecified, then the rightmost coordinate dimension of fi will be used. If fi is not of type xarray.DataArray, then xi becomes a mandatory parameter. This parameter must be specified as a keyword argument. :param yi (numpy.ndarray): An array that specifies the Y coordinates of the fi array. Most frequently, this is a 1D strictly monotonically increasing array that may be unequally spaced. In some cases, yi can be a multi-dimensional array (see next paragraph). The rightmost dimension (call it nyi) must have at least two elements, and is the second-to-last dimension of fi. If yi is a multi-dimensional array, then each nyi subsection of yi must be strictly monotonically increasing, but may be unequally spaced. All but its rightmost dimension must be the same size as all but fi's rightmost two dimensions. For geo-referenced data, yi is generally the latitude array. Note: If fi is of type xarray.DataArray and xi is left unspecified, then the second-to-rightmost coordinate dimension of fi will be used. If fi is not of type xarray.DataArray, then xi becomes a mandatory parameter. This parameter must be specified as a keyword argument. :param icycx: An option to indicate whether the rightmost dimension of fi is cyclic. This should be set to True only if you have global data, but your longitude values don't quite wrap all the way around the globe. For example, if your longitude values go from, say, -179.75 to 179.75, or 0.5 to 359.5, then you would set this to True. :type icycx: bool: :param msg_py: A numpy scalar value that represent a missing value in fi. This argument allows a user to use a missing value scheme other than NaN or masked arrays, similar to what NCL allows. :type msg_py: numpy.number:.

geocat.comp.linint2pts(fi, xo, yo[, icycx, ...])

Interpolates from a rectilinear grid to an unstructured grid or locations using bilinear interpolation.

geocat.comp.moc_globe_atl(lat_aux_grid, ...)

Facilitates calculating the meridional overturning circulation for the globe and Atlantic.

geocat.comp.rcm2points(lat2d, lon2d, fi, ...)

Interpolates data on a curvilinear grid (i.e.

geocat.comp.rcm2rgrid(lat2d, lon2d, fi, ...)

Interpolates data on a curvilinear grid (i.e.

geocat.comp.rgrid2rcm(lat1d, lon1d, fi, ...)

Interpolates data on a rectilinear lat/lon grid to a curvilinear grid like those used by the RCM, WRF and NARR models/datasets.

geocat.comp.triple_to_grid(data, x_in, y_in, ...)

Places unstructured (randomly-spaced) data onto the nearest locations of a rectilinear grid.