[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[UDUNITS #PKD-127901]: the library udunits2 : type(ut_converter), scale/offset(ut_converter)



Abara,

So, if I understand correctly, you want to be able to programmatically generate 
an ncML file that converts values from a unit specified in the netCDF file into 
the unit specified in the ncML file? Is this correct?

According to an ncML developer, ncML can't do that type of conversion.

> Hello,
> 
> My objectif is to implement a generator of ncml descriptions.
> 
> For example, suppose that we want to modify the 'K' unit to 'degC'
> unit in a netcdf file. In this cas, we need to introduce the add_offset
> attribut with the value X=273,15 in the ncml description.
> 
> <netcdf xmlns="" location=".... /netdcf_file.nc">
> <attribute name="degC" orgName="K" />
> <attribut name="add_offset" type="double" value="273.15" />
> </netcdf>
> 
> Why a program which uses the udunits library determines that the
> conversion type is OFFSET and the X value is 273.15.
> 
> We can propose this simple interface :
> 
> #########################################################
> enum CONV_TYPE = {SCALE_CONV, OFFSET_CONV, ........};
> 
> /*
> * return the type of the converter 'conv'
> */
> 
> CONV_TYPE typeConv (ut_converter * conv);
> 
> or
> 
> int isScaleConv (ut_converter * conv);
> 
> ...
> 
> int isOffsetConv (ut_converter * conv);
> 
> for the parameters, we can define a structure or functions as :
> 
> /*
> * return the scale if 'conv' have the scale type, error otherwise.
> */
> double scaleConv (ut_converter * conv);
> ...
> /*
> * return the scale if 'conv' have the offset type, error otherwise.
> */
> double offsetConv (ut_converter * conv);
> #########################################################
> 
> Thank you very much in advance.
> 
> Abdelrezzak BARA.

Regards,
Steve Emmerson

Ticket Details
===================
Ticket ID: PKD-127901
Department: Support UDUNITS
Priority: Normal
Status: Closed