private void setCalTypeAttributes ( Variable image , int calType ) { String longName = "image values" ; //String unit = ""; switch ( calType ) { case Calibrator . CAL_ALB : longName = "albedo" ; //unit = "%"; break ; case Calibrator . CAL_BRIT : longName = "brightness values" ; break ; case Calibrator . CAL_TEMP : longName = "temperature" ; //unit = "K"; break ; case Calibrator . CAL_RAD : longName = "pixel radiance values" ; //unit = "mW/m2/sr/cm-1"; break ; case Calibrator . CAL_RAW : longName = "raw image values" ; break ; default : break ; } image . addAttribute ( new Attribute ( "long_name" , longName ) ) ; if ( calUnit != null ) { image . addAttribute ( new Attribute ( CDM . UNITS , calUnit ) ) ; } if ( calScale != 1.f ) { image . addAttribute ( new Attribute ( "scale_factor" , calScale ) ) ; } }
Set the long name and units for the calibration type