tropy.analysis_tools¶
tropy.analysis_tools.grid_and_interpolation¶
create_interpolation_index |
Given georeference of two grids in lon and lat, an index is built to map a field on grid 1 to grid 2. |
curve_flow_filter |
Smoothing filter depending on isoline curvature. |
cutout_cluster |
Makes a cutout of a categorial field c for an object of class / number nc. |
cutout_field4box |
Cuts out a field based on center pix index and box size. |
cutout_fields |
Cuts out a field or a list of similar fields given row and column slices. |
get_index |
Given a point p the nearest grid point is returned. |
i2iset |
Returns an index set for a n-dim numpy array given an index i which points to a position within the same but flattened array. |
interpolate_field_to_hor_pos |
Given a sequence of points (or just one) a field (2d or 3d) given a grid is interpolated to the new positions. |
ldiff |
Calculates difference of a field at adjacent levels. |
ll2xy |
Transformation between longitude and latitude and local Cartesian coordinates in west-east direction (x) and south-north direction (y). |
ll2xyc |
Applies a centered version of ll2xy. |
lmean |
Calculates the layer mean of a field. |
make_add_edge |
Adds egde region to 2d data field. |
make_index_set |
This simple routine makes an 2d index set for given row and column number of a 2d field. |
make_vert_cut |
Makes a horizontal - vertical cut through a 3d field. |
mid2edge_gridvector |
Converts an mid-point based grid vector into an edge-based grid vector. |
region2slice |
Given a region of ((lon1,lon2),(lat1, lat2)) the routine provides a slicing ((row1, row2), (col1, col2)) than accomodates the region. |
remap_field |
Do nearest nearbor remapping on a simple equi-distant local cartesian coordiante grid. |
simple_pixel_area |
Approximates the grid box area of a lon - lat grid. |
spline_smooting |
Smoothes a curve with smooting spline. |
tube_cutout4box |
Performs tube cutout with given index set. |
xy2ll |
Transformation between local Cartesian coordinates in west-east direction (x) and south-north direction (y) and longitude and latitude. |
tropy.analysis_tools.optical_flow¶
displacement_from_opt_flow |
Derives displacement vector between to fields f1 and f2 using optical flow method (either farnebaeck, or tvl1). |
displacement_from_opt_flow_farneback |
Derives displacement vector between to fields f1 and f2 using optical flow method after Farneback (2003). |
displacement_from_opt_flow_tvl1 |
Derives displacement vector between to fields f1 and f2 using optical flow method after Zach et al (2007). |
displacement_vector |
Calculates displacement vector for several times. |
flow_velocity |
Calculates flow field for Lagrangian displacements of tracers in the field. |
Lagrangian_change |
Calculates Lagrangian change of a field using possibly another field to generate optical flow. |
morph_trans_opt_flow |
Applies morphological transformation of field f given a displacement field. |
tropy.analysis_tools.segmentation¶
clustering |
General interface to aplly either connectivity or watershed clustering. |
combine_object_stack |
Sequentially combines object label fields by searching for new objects that have no predecessor in the higher hierarchy level. |
connected_sequences2pairlists |
The routine gets a set of paired numbers which show connection between numbers and collects all connections in a list of pairs. |
connectivity_clustering |
Applies connectivity clustering to a field. |
markers_from_iterative_shrinking |
The routine tries to find core parts of objects via iterative shrinking. |
multithreshold_clustering |
Performs sequential segmentation and returns the combine result only keeping the predecessor object alive. |
percentiles_from_cluster |
Calculates percentiles of cells in an segmented (labeled) field. |
remove_clustersize_outside |
Counts numbers of pixels per cluster cell and removes clusters outside a size range defined by a minimum and maximum size. |
remove_clustersize_outside_slow |
OLD VERSION –> much slower … |
remove_small_clusters |
Counts numbers of pixels per cluster cell and removes clusters smaller than minimum size. |
sequential_segmentation |
Performs sequential segmentation. |
set_connectivity_footprint |
Return connectivity footprint for either 4-connectivity or 8-connectivity. |
sort_clusters |
It sorts clusters by size (number of pixels) in decreasing order. |
watershed_clustering |
Applies watershed clustering to a field. |
watershed_merge_clustering |
Applies watershed clustering to a field and then tries to merge them again. |
tropy.analysis_tools.statistics¶
autocorr |
Calculates autocorrelation function of masked array. |
cond_perc_simple |
This is a simple routine to emulate the Rosenfeld T-Re plots. |
correlation_bootstrap |
Calculates percentile values of possible correlation using a bootstrap approach. |
crosscorr |
Calculates time-lagged crosscorrelation function of masked array. |
cumsum_data_fraction |
The function uses iso-lines of equal density and maps the fraction of data enclosed by these lines onto it. |
draw_from_empirical_1ddist |
Draw random number from an empirical distribution. |
draw_from_empirical_dist |
Draw random number from an empirical distribution. |
fdistrib_mapping |
Performs a transformation of field fin to have the same distribution as fmap. |
get_outlier_from_residuals |
Calculate outliers from residuals using percentile-based standardization. |
KStest |
Calculates Kolmogorov Smirnov test for the distributions of two samples in a standard way, but allows for input of effective degrees of freedom. |
normalize_field |
Normalization of a field is applied. |
odrfit_with_outlier_removal |
Calculates fitting parameter object using a orthogonal distance regression. |
rank_transformation |
The routine performs rank transformation of a field, meaning that the ranks of the individual field values are returned. |
tropy.analysis_tools.thermodynamic_variables¶
absolute_humidity |
Calculates absolute humidity. |
both_mass_fractions2mixing_ratios |
Converts water and the vapor mass fraction to condensed water and vapor mixing ratio. |
dew_point |
Calculates dew point temperature after Markowski book p 13 eq (2.25) |
dry_air_density |
Calculates dry air density. |
dry_air_potential_temperature |
Calculates dry air potential temperature. |
equivalent_potential_temperature |
Calculates equivalent potential temperature. |
H2r |
Converts relative humidity H into mixing ratio r. |
lifting_condensation_level_temperature |
Calculates lifting condensation level temperature. |
moist_gas_constant |
Calculates gas constant of moist air. |
moist_potential_temperature |
Calculates moist air potential temperature. |
moist_specific_heat |
Calculates specific heat at constant pressure of moist air. |
relative_humidity |
Calculates relative humidity. |
saturation_over_ice |
Calculates saturation water vapor pressure over ice. |
saturation_pressure |
Calculates saturation water vapor pressure after Bolton (1980) MWR 108, p.1046, eq. |
specific_humidity |
Calculates specific humidity. |
thermodynamic_constants |
Sets some thermodynamic constants. |
total_density |
Calculates total density of moist air with hydrometeors. |
watermass_fraction2rw |
Converts water mass fraction to condensed water mixing ratio. |
water_vapor_pressure |
Calculates water vapor pressure. |