Package uk.ac.starlink.ttools.plot2
Class Scalings
java.lang.Object
uk.ac.starlink.ttools.plot2.Scalings
Implementation class for functions to do with Scaling instances.
- Since:
- 21 Mar 2019
- Author:
- Mark Taylor
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Determines whether all of a list of scalings can be used to create Scaler objects from given span instances.static Scaling.RangeScaling
createAsinhScaling
(String name, double delta) Constructs an asinh-based scaling.static Ranger
createRanger
(Scaling[] scalings) Returns a ranger suitable for use with all of a given list of scalings.static double
Utility method to perform the inverse operation of Scaler.scaleValue.
-
Method Details
-
createRanger
Returns a ranger suitable for use with all of a given list of scalings. If a ranger is obtained from this method and used to create aSpan
, that span'screateScaler
method can be used with any of the scalings presented here.- Parameters:
scalings
- list of scalings required for compatibility; null values are permitted, and add no constraints- Returns:
- suitable ranger
-
canScale
Determines whether all of a list of scalings can be used to create Scaler objects from given span instances.- Parameters:
scalings
- scaling instances for which scalers may be requireddataSpan
- span obtained from ranging datafixSpan
- span obtained by direct user input of bounds- Returns:
- true iff spans are sufficient, false if new span instances are going to be needed
-
createAsinhScaling
Constructs an asinh-based scaling.- Parameters:
name
- scaling namedelta
- output difference for lower-end input unit difference- Returns:
- scaling
-
unscale
Utility method to perform the inverse operation of Scaler.scaleValue.- Parameters:
scaler
- scaler instancelo
- lower bound of input data valuehi
- upper bound of input data valuefrac
- required output value of scaleValue method, must be in range 0..1- Returns:
- value x that causes scaler.scaleValue(x)
to return
frac
-