Scale transformation module for coordinate system transformations
This module provides functions for transforming data coordinates using different scale types: linear, logarithmic, and symmetric logarithmic. Follows Single Responsibility Principle by focusing solely on scale transformations.
Apply forward scale transformation to a single value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | value | |||
character(len=*), | intent(in) | :: | scale_type | |||
real(kind=wp), | intent(in) | :: | threshold |
Apply inverse scale transformation to recover original value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | value | |||
character(len=*), | intent(in) | :: | scale_type | |||
real(kind=wp), | intent(in) | :: | threshold |
Transform data x-coordinate to screen coordinate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x | |||
real(kind=wp), | intent(in) | :: | x_min | |||
real(kind=wp), | intent(in) | :: | x_max | |||
integer, | intent(in) | :: | width |
Transform data y-coordinate to screen coordinate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | y | |||
real(kind=wp), | intent(in) | :: | y_min | |||
real(kind=wp), | intent(in) | :: | y_max | |||
integer, | intent(in) | :: | height | |||
logical, | intent(in), | optional | :: | invert |
Clamp extreme logarithmic ranges to ensure usable plots
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | data_min | |||
real(kind=wp), | intent(in) | :: | data_max | |||
real(kind=wp), | intent(out) | :: | clamped_min | |||
real(kind=wp), | intent(out) | :: | clamped_max |