clear % ------------- Step I where is the data LISSTroot = 'L3370000.asc'; LISSTdat = 'L3370000.DAT'; ncroot = '8482lisst'; % the name for the output files % --------- set up the information needed by the programs % % this is what should be used if using a single source of global attributes % modified to use the universal metadata file : globatt_805.txt % change the line below to fit your system path for the location of m_cmg % comment out this line and enter the metadata below by hand if you do not % have the metadata toolbox. gatt=read_globalatts('..\global_atts848.txt'); % ------------- Step II what is the metadata? % % there must be a deployment start date!! metadata.deployment_start = gatt.Deployment_date; % the in water time metadata.deployment_end = gatt.Recovery_date; % the out of water time metadata.lon = gatt.longitude; % decimal degrees, West = negative metadata.lat = gatt.latitude; % decimal degrees, South = negative metadata.WATER_DEPTH = gatt.WATER_DEPTH; % m (DO NOT OMIT!) % LISST specific information metadata.serial = '1172'; % serial number of the LISST metadata.type = 'C'; % LISST type (indicating size range) metadata.zscFile = '1172bench29nov07gmt1602.asc'; %best background scatter file metadata.factoryFile = 'factory_zsc_1172.asc'; % best background scatter file metadata.ringFile = 'ringarea_1172.asc'; % best background scatter file % these are [slope, offset] metadata.cal.laserpower = [0.00081556 0]; % raw count to mW metadata.cal.battery = [0.01 0]; % raw count to volts metadata.cal.external = [0 0]; % none for LISST-ST metadata.cal.laserreference = [0.00076741 0]; %raw count to mW metadata.cal.pressure = [0.01 -10]; %raw count to meters metadata.cal.temperature = [0.01 0]; % raw count to deg C metadata.cal.volumeconversion = 45733; %in instrumentdata.txt % this height will be tagged to all variables metadata.inst_height = 0.31; % m pressure port height, about the same as the optics metadata.STtopopening_height = 0; % m metadata.STnsettlingsamples = 0; % a settling experiment metadata.MOORING = '8482'; metadata.metafile = mfilename('fullpath'); metadata.metafile_date = datestr(now); metadata.metafile_version = '0.0'; metadata.metafile_author = 'MM'; % if the following fields are missing, UNKOWN will be used metadata.DATA_ORIGIN = gatt.DATA_ORIGIN; % with collaborator's data, could be USC, etc. metadata.EXPERIMENT = gatt.EXPERIMENT; metadata.PROJECT = gatt.PROJECT; % might also use OFA funding agency, such as MWRA, EPA, WCMG metadata.DESCRIPTION = gatt.DESCRIPTION; metadata.SciPi = gatt.SciPi; metadata.Conventions = gatt.Conventions; metadata.DATA_CMNT = ''; % your metadata metadata.longitude = gatt.longitude; % negative degrees in western hemisphere metadata.lonUnits = 'degrees_east'; metadata.latitude = gatt.latitude; % always positive degrees in northern metadata.latUnits = 'degrees_north'; metadata.dataFile = LISSTroot; metadata.goodsamples = [681 20528]; % use [1 Inf] for all data % these programs take a long time to run, so keep a diary diary(sprintf('run%s',datestr(now,30))) if 0, % convert the raw data in the .log file to netCDF lisstraw = LISST100Xlog2cdf(LISSTroot, ncroot, metadata); end if 0, % convert the raw data in the .asc file into netCDF lisst = LISST100Xasc2nc(LISSTroot, ncroot, metadata); end if 0, % do it from the binary using Sequoia code, results in a .mat file dvec = datevec(metadata.deployment_start); settings.expYear = dvec(1); settings.LISSTtype = metadata.type; settings.LISSTserial = str2double(metadata.serial); settings.volconv = metadata.cal.volumeconversion; settings.pscale = metadata.cal.pressure(1); settings.poffset = metadata.cal.pressure(2); settings.raux = 2.5/4095; [lisstmat, settings] = do100X(LISSTdat, metadata.zscFile, metadata.ringFile, ... settings, metadata.goodsamples, 0); save(ncroot,'lisstmat', 'metadata', 'settings'); end diary off