static public VariableDS makeDummyTransformVariable ( NetcdfDataset ds , CoordinateTransform ct ) { VariableDS v = new VariableDS ( ds , null , null , ct . getName ( ) , DataType . CHAR , "" , null , null ) ; List < Parameter > params = ct . getParameters ( ) ; for ( Parameter p : params ) { if ( p . isString ( ) ) v . addAttribute ( new Attribute ( p . getName ( ) , p . getStringValue ( ) ) ) ; else { double [ ] data = p . getNumericValues ( ) ; Array dataA = Array . factory ( DataType . DOUBLE , new int [ ] { data . length } , data ) ; v . addAttribute ( new Attribute ( p . getName ( ) , dataA ) ) ; } } v . addAttribute ( new Attribute ( _Coordinate . TransformType , ct . getTransformType ( ) . toString ( ) ) ) ; // fake data Array data = Array . factory ( DataType . CHAR , new int [ ] { } , new char [ ] { ' ' } ) ; v . setCachedData ( data , true ) ; return v ; }
Create a dummy Coordinate Transform Variable based on the given CoordinateTransform . This creates a scalar Variable with dummy data and adds the Parameters of the CoordinateTransform as attributes .