[filename, pathname] = uigetfile('HAMSR_L1B*.nc', 'Select HAMSR L1B file');
ncid = netcdf.open([pathname,filename],'NOWRITE');
clear pth fname

time = netcdf.getVar(ncid,0)*netcdf.getAtt(ncid,0,'scale_factor'); % seconds since 2000-01-01 00:00:00.0 : [time]
lat = single(netcdf.getVar(ncid,1))*netcdf.getAtt(ncid,1,'scale_factor'); % Pixel Latitude [-90:90] : [scan x time]
lon = single(netcdf.getVar(ncid,2))*netcdf.getAtt(ncid,2,'scale_factor'); % Pixel Longitude [-180:180] : [scan x time]
alt = single(netcdf.getVar(ncid,3))*netcdf.getAtt(ncid,3,'scale_factor'); % Aircraft altitude from GPS in meters  : [time]
tb = single(netcdf.getVar(ncid,4))*netcdf.getAtt(ncid,4,'scale_factor'); % Calibrated Brightness Temperature [K] :  [channel x scan x time]
eia = single(netcdf.getVar(ncid,5))*netcdf.getAtt(ncid,5,'scale_factor'); % Pixel Incidence Angle [0:90] : [scan x time]
AClat = single(netcdf.getVar(ncid,6))*netcdf.getAtt(ncid,6,'scale_factor'); % Airplane Latitude [-90:90]  : [time]
AClon = single(netcdf.getVar(ncid,7))*netcdf.getAtt(ncid,7,'scale_factor'); % Airplane Longitude [-180:180]  : [time]
roll = single(netcdf.getVar(ncid,8))*netcdf.getAtt(ncid,8,'scale_factor'); % Airplane Longitude [-180:180]  : [time]
pitch = single(netcdf.getVar(ncid,9))*netcdf.getAtt(ncid,9,'scale_factor'); % Airplane Longitude [-180:180]  : [time]
heading = single(netcdf.getVar(ncid,10))*netcdf.getAtt(ncid,10,'scale_factor'); % Airplane Longitude [-180:180]  : [time]
try
TAflag = single(netcdf.getVar(ncid,11))*netcdf.getAtt(ncid,11,'scale_factor'); % TA quality flag [0,1,2] : [time]
end

netcdf.close(ncid);

