plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | zhehedream/UAV-Path-Optimization-master | Get_Point_Cluster.m | .m | UAV-Path-Optimization-master/sub/Get_Point_Cluster.m | 985 | utf_8 | c87a022c3541eda8931d80b99dfb7655 | % Get_Point_Cluster
% Get Point sets which each point (p0) in this set meets
% the condition with other points (px) that Euclidean_distance(p0,px)<distance
%
% Input: A
% point vector that has the coordinates of all the points
% Input: distance
% Output: point_cluster
function point_cluster=Get_Point_Cluster(A... |
github | zhehedream/UAV-Path-Optimization-master | Show_Result.m | .m | UAV-Path-Optimization-master/sub/Show_Result.m | 337 | utf_8 | c17a98ffb5f6b879f54eae1febc2a224 | % Show_Result
% Input: str
% Message on MessageBox
function Show_Result(str)
h=msgbox(str);
th = findall(0, 'Tag','MessageBox' );
boxPosition = get(h,'position');
textPosition = get(th, 'position');
set(th, 'position', [boxPosition(3).*0.5 textPosition(2) textPosition(3)]);
set(th, 'HorizontalAlignme... |
github | zhehedream/UAV-Path-Optimization-master | Draw_Station.m | .m | UAV-Path-Optimization-master/sub/Draw_Station.m | 354 | utf_8 | c9ce117454b3d96871c766e8f16d508a | % Draw_Station
% Input: fig_id
% The figure id of the window you want to overly
% Input: Station
% The data matrix of Station
function Draw_Station(fig_id,Station)
figure(fig_id);
for i=1:length(Station)
if Station(i,3)==0
plot(Station(i,1),Station(i,2),'rx');
else
plot(Station(i,... |
github | zhehedream/UAV-Path-Optimization-master | Get_Plane_Point_After_Road.m | .m | UAV-Path-Optimization-master/sub/Get_Plane_Point_After_Road.m | 940 | utf_8 | 8adf2e993be0a730d561678e25a3da37 | % Get_Plane_Point_After_Road
% Get the coordinate of plane after it travels through point in t with
% speed
%
% Input: point
% points vector of Road
% Input: t_limit
% time limit
% Input: speed
% Output: x, y
% plane coordinate after traveling
% (x & y==1000) means cannot finish in t_limit... |
github | zhehedream/UAV-Path-Optimization-master | Calc_Rad_Destroy.m | .m | UAV-Path-Optimization-master/sub/Calc_Rad_Destroy.m | 834 | utf_8 | 555d90692ef2abce735ce68065288008 | function [result,p]=Calc_Rad_Destroy(point,n,rp)
point_tmp={};
min_rd=1e12;
min_p=[];
for i=1:size(point,1)
point_tmp=[point_tmp;Get_Circle_Point(point(i,1),point(i,2),30,n)];
end
point_index_list=Get_NL(n,size(point,1));
for i=1:size(point_index_list,1)
temp=[];
for j=1:size(point_index_list,2)
ind... |
github | zhehedream/UAV-Path-Optimization-master | Get_Circle_Point.m | .m | UAV-Path-Optimization-master/sub/Get_Circle_Point.m | 482 | utf_8 | 68db6bee1c4e0f9cb36ed345c5144463 | % Get_Circle_Point
% Get (point coordinate) * n on Circle(x,y,r)
% Input: x,y
% Center coordinate
% Input: r
% Radius
% Output: point
% matrix of point coordinates on Circle
%
% Example:
% >>Get_Circle_Point(0,0,1,3)
% ans =
% 1.0000 0
% -0.5000 0.8660
% -0.5000 -0.8660
fun... |
github | zhehedream/UAV-Path-Optimization-master | Get_Total_Dist.m | .m | UAV-Path-Optimization-master/sub/Get_Total_Dist.m | 229 | utf_8 | 2fe733178a53d8bea91de1a450b33d4d | % Get_Total_Dist
% Get the total traveling distance through point
function result=Get_Total_Dist(point)
n=size(point,1);
result=0;
for i=1:n-1
result=result+sqrt((point(i,1)-point(i+1,1))^2+(point(i,2)-point(i+1,2))^2);
end
|
github | zhehedream/UAV-Path-Optimization-master | Circle.m | .m | UAV-Path-Optimization-master/sub/Circle.m | 317 | utf_8 | b00cb510af2f78c479f2aef5f568f0f3 | % Circle
% Draw a circle as you want
% Input: fig_num
% The figure id of the window you want to overly
% Input: R
% radius
% Input: rx, ry
% center coordinate
function Circle(fig_num,R,rx,ry)
figure(fig_num);
alpha=0:pi/50:2*pi;
x=R*cos(alpha)+rx;
y=R*sin(alpha)+ry;
plot(x,y,'r-')
axis equal |
github | zhehedream/UAV-Path-Optimization-master | Get_Group_Dist.m | .m | UAV-Path-Optimization-master/sub/Get_Group_Dist.m | 308 | utf_8 | 84aff7c6f1baba3e1a171b3cfc37a056 | % Get_Group_Dist
% Get the Distance_Matrix of group A
function group_dist=Get_Group_Dist(A)
n=size(A,1);
group_dist=zeros(n,n);
for i=1:n
for j=1:n
if i==j
group_dist(i,j)=0;
else
group_dist(i,j)=sqrt((A(i,1)-A(j,1))^2+(A(i,2)-A(j,2))^2);
end
end
end
|
github | zhehedream/UAV-Path-Optimization-master | Get_Plane_Time.m | .m | UAV-Path-Optimization-master/sub/Get_Plane_Time.m | 717 | utf_8 | d5ade61a7777be49a120e84b76f2a0ad | % Get_Plane_Time
% Input: point
% Coordinate of start station
% Input: rp
% Coordinates of radars
% Output: total_time
% Output: rad_time
% total time that plane is in radar scale
function [rad_time,total_time]=Get_Plane_Time(point,rp)
time_t=0;
step=0.01;
dd=30/720;
rt=0;
rad_time=0;
%while ~i... |
github | JaneliaSciComp/JRCLUST-main | jrc.m | .m | JRCLUST-main/jrc.m | 4,939 | utf_8 | 41e344ea661891ce9fdd12a80a9fa36a | % JRCLUST v4
% Alan Liddell, Vidrio Technologies
% Originally written by James Jun
function hJRC_ = jrc(varargin)
%JRC
if nargout > 0
hJRC_ = [];
end
if nargin < 1
disp(jrclust.utils.help()); % later: GUI
return;
end
% discard try-catch here for now as the... |
github | JaneliaSciComp/JRCLUST-main | computeDelta.m | .m | JRCLUST-main/+jrclust/+sort/computeDelta.m | 5,692 | utf_8 | 31d6b7ec2f2a77c4b7904396922feda7 | function res = computeDelta(dRes, res, hCfg)
%COMPUTEDELTA Compute delta for spike features
hCfg.updateLog('computeDelta', 'Computing delta', 1, 0);
% create CUDA kernel
chunkSize = 16;
nC_max = 45;
if hCfg.useGPU
ptxFile = fullfile(jrclust.utils.basedir(), '+jrclust', '+CUDA', 'jrc_cud... |
github | JaneliaSciComp/JRCLUST-main | computeRho.m | .m | JRCLUST-main/+jrclust/+sort/computeRho.m | 7,725 | utf_8 | e105308d09ac426b49d8fe7da60fb1a6 | function res = computeRho(dRes, res, hCfg)
%COMPUTERHO Compute rho values for spike features
res.rhoCutSite = zeros(hCfg.nSites, 1, 'single');
res.rhoCutGlobal = [];
% compute rho cutoff globally
if hCfg.useGlobalDistCut
res.rhoCutGlobal = estRhoCutGlobal(dRes, hCfg);
end
hCfg.upda... |
github | JaneliaSciComp/JRCLUST-main | detrendRhoDelta.m | .m | JRCLUST-main/+jrclust/+sort/detrendRhoDelta.m | 3,219 | utf_8 | 5eb83d93119c4695dab3563811a087c3 | function [centers, logRho, zscores] = detrendRhoDelta(hClust, spikesBySite, fLocal, hCfg)
%DETREND Detrend rho-delta plot to identify cluster centers (high rho, high delta)
logRho = log10(hClust.spikeRho);
delta = hClust.spikeDelta;
if fLocal % detrend for each site
rhosBySite = cellfun(@(spike... |
github | JaneliaSciComp/JRCLUST-main | assignClusters.m | .m | JRCLUST-main/+jrclust/+sort/assignClusters.m | 5,777 | utf_8 | 7a148b0d500650e1792590c71be17900 | function sRes = assignClusters(dRes, sRes, hCfg)
%ASSIGNCLUSTERS Given rho-delta information, assign spikes to clusters
sRes = computeCenters(dRes, sRes, hCfg);
sRes.spikeClusters = [];
% do initial assignment
hCfg.updateLog('assignClusters', sprintf('Assigning clusters (nClusters: %d)', numel(sRes... |
github | JaneliaSciComp/JRCLUST-main | v3.m | .m | JRCLUST-main/+jrclust/+import/v3.m | 10,097 | utf_8 | e135825cb7562eb7126f7341643710de | function [hCfg, res] = v3(filename)
%V3 Import an old-style session (_jrc.mat) to the new style
[hCfg, res] = deal([]);
filename_ = jrclust.utils.absPath(filename);
if isempty(filename_)
error('Could not find ''%s''', filename);
end
try
S0 = load(filename_, '-mat');
catch M... |
github | JaneliaSciComp/JRCLUST-main | loadPhy.m | .m | JRCLUST-main/+jrclust/+import/private/loadPhy.m | 2,295 | utf_8 | 3b2cb8ce5b1f9a7ed98fe7f5c4d9025c | function phyData = loadPhy(loadPath)
%LOADPHY Load and return Phy-formatted .npy files
phyData = struct();
if exist('readNPY', 'file') ~= 2
warning('Please make sure you have npy-matlab installed (https://github.com/kwikteam/npy-matlab)');
return;
end
loadPath_ = jrclust.utils.absPath(loadPath);
if isempty(lo... |
github | JaneliaSciComp/JRCLUST-main | nwb.m | .m | JRCLUST-main/+jrclust/+export/nwb.m | 17,128 | utf_8 | 4a2bdc1a2a095661d8f768b20c3f8d8f | function nwbData = nwb(hClust, outPath)
%NWBEXPORT exports jrclust data to NWB
% Assumes matnwb is in path and generateCore is called
% hClust is a regular hClust object with certain additions for config data
% outFileName is the destination file name produced by NWB.
% Should use the .nwb e... |
github | JaneliaSciComp/JRCLUST-main | phy.m | .m | JRCLUST-main/+jrclust/+export/phy.m | 7,408 | utf_8 | ba6c593290b356e7d5e4c522f8572f35 | function phy(hClust)
%PHY Export JRCLUST data to .npy format for Phy
if exist('writeNPY', 'file') ~= 2
warning('Please make sure you have npy-matlab installed and on your path (https://github.com/kwikteam/npy-matlab)');
return;
elseif ~isa(hClust, 'jrclust.sort.DensityPeakClustering')
... |
github | JaneliaSciComp/JRCLUST-main | plotFigMap.m | .m | JRCLUST-main/+jrclust/+views/plotFigMap.m | 2,032 | utf_8 | 0099e1d2529c7838cdb359201ba2cf50 | function hFigMap = plotFigMap(hFigMap, hClust, hCfg, selected, channel_idx)
%PLOTFIGMAP Plot probe map
iWaveforms = hClust.meanWfGlobal(:, :, selected(1));
clusterVpp = squeeze(max(iWaveforms) - min(iWaveforms));
vpp = repmat(clusterVpp(:)', [4, 1]);
if ~hFigMap.hasAxes('default')
hFigMap.a... |
github | JaneliaSciComp/JRCLUST-main | plotFigProj.m | .m | JRCLUST-main/+jrclust/+views/plotFigProj.m | 4,858 | utf_8 | 5345f70e2051d3d1fd75c97079bc3ec1 | function hFigProj = plotFigProj(hFigProj, hClust, sitesToShow, selected, boundScale, channel_idx, doAutoscale)
%PLOTFIGPROJ Plot feature projection figure
if nargin < 7
doAutoscale = 1;
end
hCfg = hClust.hCfg;
hFigProj.clearPlot('foreground2'); % clear secondary cluster spikes
if strc... |
github | JaneliaSciComp/JRCLUST-main | plotFigTraces.m | .m | JRCLUST-main/+jrclust/+views/plotFigTraces.m | 8,160 | utf_8 | fbeb77a831e9f43002615fcabc32cef9 | function tracesFilt = plotFigTraces(hFigTraces, hCfg, tracesRaw, resetAxis, hClust)
%PLOTFIGTRACES Plot raw traces view
hBox = jrclust.utils.qMsgBox('Plotting...', 0, 1);
hFigTraces.wait(1);
sampleRate = hCfg.sampleRate / hCfg.nSkip;
viSamples1 = 1:hCfg.nSkip:size(tracesRaw, 2);
evtWindowSamp ... |
github | JaneliaSciComp/JRCLUST-main | plotAuxCorr.m | .m | JRCLUST-main/+jrclust/+views/plotAuxCorr.m | 5,406 | utf_8 | e6c6e367d0977e3822bffc05f1190406 | function corrData = plotAuxCorr(hClust, selected)
%PLOTAUXCORR Plot aux channel correlation with firing rates figure
if nargin < 2
selected = [];
end
hCfg = hClust.hCfg;
% load aux channel data
[auxSamples, auxTimes] = loadAuxChannel(hCfg);
if isempty(auxSamples)
corrData = ... |
github | JaneliaSciComp/JRCLUST-main | plotFigPos.m | .m | JRCLUST-main/+jrclust/+views/plotFigPos.m | 3,173 | utf_8 | 6015f33647d46b93b6b2e1b00de79a57 | function plotFigPos(hFigPos, hClust, hCfg, selected, maxAmp)
%PLOTFIGPOS Plot position of cluster on probe
c1Data = hClust.exportUnitInfo(selected(1));
if numel(selected) > 1
c2Data = hClust.exportUnitInfo(selected(2));
end
if ~hFigPos.hasAxes('default')
hFigPos.addAxes('default');
... |
github | JaneliaSciComp/JRCLUST-main | rescaleFigProj.m | .m | JRCLUST-main/+jrclust/+views/rescaleFigProj.m | 4,444 | utf_8 | 926ae507dda8b9082f199b3cd5d4e86e | function rescaleFigProj(hFigProj, projScale, hCfg)
%RESCALEFIGPROJ
rescaleUpdate(hFigProj, projScale, hCfg);
hFigProj.figData.boundScale = projScale;
if strcmp(hCfg.dispFeature, 'vpp')
XLabel = 'Site # (%0.0f \\muV; upper: V_{min}; lower: V_{max})';
YLabel = 'Site # (%0.0f \\muV_{min})'... |
github | JaneliaSciComp/JRCLUST-main | plotFigPSD.m | .m | JRCLUST-main/+jrclust/+views/plotFigPSD.m | 1,680 | utf_8 | 20b31bccf1f950b9d64573bfa2911fe7 | function hFigPSD = plotFigPSD(hFigPSD, tracesFilt, hCfg)
%PLOTFIGPSD Plot power spectrum density figure
nSmooth = 3;
ignoreSites = hCfg.ignoreSites;
sampleRate = hCfg.sampleRate/hCfg.nSkip;
%warning off;
tracesFilt = fft(tracesFilt');
tracesFilt = real(tracesFilt .* conj(tracesFilt)) / siz... |
github | JaneliaSciComp/JRCLUST-main | multiplot.m | .m | JRCLUST-main/+jrclust/+views/@Figure/multiplot.m | 2,480 | utf_8 | 79bf8609e02fe4ad4d018dd3f78c7bde | function [plotKey, YOffsets] = multiplot(obj, plotKey, scale, XData, YData, YOffsets, doScatter)
% Create (nargin > 2) or rescale (nargin <= 2) a multi-line plot
% TODO: separate these (presumably multiple plots are passed in somewhere)
if nargin <= 2 % rescale
obj.rescalePlot(plotKey, scale);
... |
github | JaneliaSciComp/JRCLUST-main | getSpikeCov.m | .m | JRCLUST-main/+jrclust/+views/private/getSpikeCov.m | 1,287 | utf_8 | 12df2e13dc92edb948e83e1fe5999ba8 | %function [mrVpp1, mrVpp2] = getSpikeCov(sampledSpikes, iSite)
function [mrVpp1, mrVpp2] = getSpikeCov(hClust, sampledSpikes, iSite)
%GETSPIKECOV Compute covariance feature for a subset of spikes
hCfg = hClust.hCfg;
spikeSites = hClust.spikeSites;
spikesFilt = hClust.spikesFilt;
nSpikes = numel(sam... |
github | JaneliaSciComp/JRCLUST-main | plotSpikeWaveforms.m | .m | JRCLUST-main/+jrclust/+views/private/plotSpikeWaveforms.m | 2,829 | utf_8 | 9aaea892f3aede5849ff38a799714028 | function hFigWav = plotSpikeWaveforms(hFigWav, hClust, maxAmp, channel_idx)
%PLOTSPIKEWAVEFORMS Plot individual waveforms in the main view
showSubset = hFigWav.figData.showSubset;
[XData, YData, showSites] = deal(cell(numel(showSubset), 1));
hCfg = hClust.hCfg;
nSpikesCluster = zeros(numel(showSub... |
github | JaneliaSciComp/JRCLUST-main | plotMeanWaveforms.m | .m | JRCLUST-main/+jrclust/+views/private/plotMeanWaveforms.m | 3,204 | utf_8 | 439f9f8bfe5c1834ef41abbf66aaf8de | function hFigWav = plotMeanWaveforms(hFigWav, hClust, maxAmp, channel_idx)
%PLOTMEANWAVEFORMS Plot mean cluster waveforms in FigWav
hCfg = hClust.hCfg;
showSubset = hFigWav.figData.showSubset;
if hCfg.showRaw
waveforms = hClust.meanWfGlobalRaw;
else
waveforms = hClust.meanWfGlobal;
... |
github | JaneliaSciComp/JRCLUST-main | getFigTimeFeatures.m | .m | JRCLUST-main/+jrclust/+views/private/getFigTimeFeatures.m | 2,986 | utf_8 | 39100e7576149d620cfe3faff4cc1187 | function [dispFeatures, spikeTimesSecs, YLabel, dispSpikes] = getFigTimeFeatures(hClust, iSite, iCluster,channel_idx)
%GETFIGTIMEFEATURES Compute features to display in FigTime on iSite
if nargin < 3 % get features off of background spikes
iCluster = [];
channel_idx = 1:length(hClust.spikesBySit... |
github | JaneliaSciComp/JRCLUST-main | doPlotFigPreview.m | .m | JRCLUST-main/+jrclust/+views/@PreviewController/private/doPlotFigPreview.m | 7,560 | utf_8 | b060779a1e1a77b6bf1d99339da280f1 | function hFigPreview = doPlotFigPreview(hFigPreview, figData, fKeepView, hCfg)
%DOPLOTFIGPREVIEW
hWait = jrclust.utils.qMsgBox('Plotting...', 0, 1);
nSites = size(figData.tracesFilt, 2);
XDataSamp = figData.windowBounds(1):figData.windowBounds(2);
XData = XDataSamp / hCfg.sampleRate;
tlimSecs ... |
github | JaneliaSciComp/JRCLUST-main | validateFigs.m | .m | JRCLUST-main/+jrclust/@Config/validateFigs.m | 2,392 | utf_8 | 31887f5f1d42704555bc87fa2f6bbf8d | function validateFigs(obj)
%% validates figure list and positions, and fills in with defaults if no positions specified
if ~isempty(obj.figPos)
if numel(obj.figList)~=numel(obj.figPos)
error('Error parsing params: size of figList does not match size of figPos in param file!');
end
... |
github | JaneliaSciComp/JRCLUST-main | readRawROI.m | .m | JRCLUST-main/+jrclust/+detect/@IntanRecording/readRawROI.m | 2,990 | utf_8 | 0920dff8a8582214747997d91b2eb85c | function roi = readRawROI(obj, rows, cols)
%READRAWROI Get a region of interest by rows/cols from the raw file
% How many data blocks remain in this file?
bytesRemaining = obj.fSizeBytes - obj.headerOffset;
dataPresent = (bytesRemaining > 0);
if (dataPresent)
if ~obj.rawIsOpen
o... |
github | JaneliaSciComp/JRCLUST-main | CARRealign.m | .m | JRCLUST-main/+jrclust/+detect/@DetectController/CARRealign.m | 1,367 | utf_8 | cb6022177e6debe0e3fde9ae85ec13a2 | function [spikeWindows, spikeTimes] = CARRealign(obj, spikeWindows, samplesIn, spikeTimes, neighbors)
%CARREALIGN Realign spike peaks after applying local CAR
if ~strcmpi(obj.hCfg.getOr('vcSpkRef', 'nmean'), 'nmean')
return;
end
% find where true peaks are not in the correct place after applyin... |
github | JaneliaSciComp/JRCLUST-main | cancelOverlap.m | .m | JRCLUST-main/+jrclust/+detect/@DetectController/cancelOverlap.m | 3,671 | utf_8 | 93eaafc502267ac1a0ffadd7c2b7b8d4 | function [spikeWindowsOut, spikeWindows2Out] = cancelOverlap(obj, spikeWindows, spikeWindows2, spikeTimes, spikeSites, spikeSites2, siteThresh)
% Overlap detection. only return one stronger than other
[spikeTimes, spikeWindows, spikeWindows2] = jrclust.utils.tryGather(spikeTimes, spikeWindows, spikeWindows2);
... |
github | JaneliaSciComp/JRCLUST-main | detectOneRecording.m | .m | JRCLUST-main/+jrclust/+detect/@DetectController/detectOneRecording.m | 11,552 | utf_8 | a78b2a2a8a35ba660050ef03e2014ee4 | function recData = detectOneRecording(obj, hRec, fids, impTimes, impSites, siteThresh)
%DETECTONERECORDING Detect spikes in a single Recording
if nargin < 4
impTimes = [];
end
if nargin < 5
impSites = [];
end
if nargin < 6
siteThresh = [];
end
rawFid = fids(1);
... |
github | JaneliaSciComp/JRCLUST-main | planLoad.m | .m | JRCLUST-main/+jrclust/+detect/@DetectController/planLoad.m | 1,885 | utf_8 | 491d207b8c382accf6a037b00ccc6f4b | function [nLoads, nSamplesLoad, nSamplesFinal] = planLoad(obj, hRec)
%PLANLOAD Get number of samples to load in each chunk of a file
nBytesSubset = subsetBytes(hRec, obj.hCfg.loadTimeLimits*obj.hCfg.sampleRate);
bps = jrclust.utils.typeBytes(obj.hCfg.dataType);
% nColumns in data matrix
nSamples =... |
github | JaneliaSciComp/JRCLUST-main | samplesToWindows.m | .m | JRCLUST-main/+jrclust/+detect/@DetectController/samplesToWindows.m | 4,752 | utf_8 | abe22f3e7035a046248fb2c3c3130ebf | function spikeData = samplesToWindows(obj, spikeData)
%SAMPLESTOWINDOWS Get spatiotemporal windows around spiking events as 3D arrays
% returns spikesRaw nSamples x nSites x nSpikes
samplesRaw = spikeData.samplesRaw;
samplesFilt = spikeData.samplesFilt;
spikeTimes = spikeData.spikeTimes;
spike... |
github | JaneliaSciComp/JRCLUST-main | bandpassFilter.m | .m | JRCLUST-main/+jrclust/+filters/bandpassFilter.m | 4,286 | utf_8 | a4c38c6e1fcb0145d283a7999cf482fb | function samplesOut = bandpassFilter(samplesIn, hCfg)
%BANDPASSFILTER Summary of this function goes here
try
hCfg.updateLog('bpFilt', sprintf('Applying bandpass filter to %d samples', size(samplesIn, 1)), 1, 0);
samplesOut = filtfiltChain(single(samplesIn), hCfg);
catch ME
hCfg.updat... |
github | JaneliaSciComp/JRCLUST-main | fftClean.m | .m | JRCLUST-main/+jrclust/+filters/fftClean.m | 3,724 | utf_8 | 3c1e907bb96551454cff286d2468d779 | function samplesOut = fftClean(samplesIn, fftThresh, hCfg)
%FFTCLEAN Remove high-frequency noise from samples
if fftThresh == 0 || isempty(samplesIn)
samplesOut = samplesIn;
return;
end
hCfg.updateLog('fftClean', 'Applying FFT-based cleanup', 1, 0);
nSamples = size(samplesIn, 1); %... |
github | JaneliaSciComp/JRCLUST-main | filtCAR.m | .m | JRCLUST-main/+jrclust/+filters/filtCAR.m | 3,103 | utf_8 | e93c2eebae063b8fe89c0fe146e3e6b2 | function [samplesOut, channelMeans] = filtCAR(samplesIn, windowPre, windowPost, trimPad, hCfg)
%FILTCAR Apply user-specified filter and common-average referencing
if nargin < 3
windowPre = [];
end
if nargin < 4
windowPost = [];
end
if nargin < 5
trimPad = 1;
end
... |
github | JaneliaSciComp/JRCLUST-main | sgFilter.m | .m | JRCLUST-main/+jrclust/+filters/sgFilter.m | 1,863 | utf_8 | 57c6f39308c6cc9dbc40ec77edf578f1 | function samplesOut = sgFilter(samplesIn, nDiffOrder)
%SGFILTER Savitzky-Golay filter
% works for a vector, matrix and tensor
fInvert_filter = 0;
useGPU = isa(samplesIn, 'gpuArray');
n1 = size(samplesIn,1);
if n1 == 1
n1 = size(samplesIn,2);
end
if nDiffOrder == 0
sampl... |
github | JaneliaSciComp/JRCLUST-main | computeSelfSim.m | .m | JRCLUST-main/+jrclust/+interfaces/@Clustering/computeSelfSim.m | 1,963 | utf_8 | c0ec76440bed5c89992c760f91c4aeef | function selfSim = computeSelfSim(obj, iCluster)
%COMPUTESELFSIM Get similarity between bottom and top half (vpp-wise) of cluster
if nargin < 2
iCluster = [];
end
if isempty(iCluster)
obj.hCfg.updateLog('selfSim', 'Computing cluster self-similarity', 1, 0);
selfSim = zeros(1, o... |
github | JaneliaSciComp/JRCLUST-main | computeCentroids.m | .m | JRCLUST-main/+jrclust/+interfaces/@Clustering/computeCentroids.m | 2,238 | utf_8 | 0bd8fad34dc0910e79a27ed64624e352 | function computeCentroids(obj, updateMe)
%COMPUTEPOSITIONS determine cluster position from spike position
if nargin < 2 || isempty(obj.clusterCentroids)
updateMe = [];
end
if isempty(updateMe)
centroids = zeros(obj.nClusters, 2);
clusters_ = 1:obj.nClusters;
else % selective... |
github | JaneliaSciComp/JRCLUST-main | syncHistFile.m | .m | JRCLUST-main/+jrclust/+interfaces/@Clustering/syncHistFile.m | 2,931 | utf_8 | c02defe25fbf50b4e2b9a81a3af53162 | function syncHistFile(obj)
%SYNCHISTFILE Sync up history file with current history
d = dir(obj.hCfg.histFile);
if isempty(d) || obj.nSpikes == 0 % file does not exist
fclose(fopen(obj.hCfg.histFile, 'w')); % truncate history file
d = dir(obj.hCfg.histFile);
end
if obj.nSpikes == 0
... |
github | JaneliaSciComp/JRCLUST-main | computeWaveformSim.m | .m | JRCLUST-main/+jrclust/+interfaces/@Clustering/computeWaveformSim.m | 6,092 | utf_8 | dd9869f7e8cc0a044e267181d0040c28 | function computeWaveformSim(obj, updateMe)
%COMPUTWAVEFORMSIM Compute waveform-based similarity scores for all clusters
if nargin < 2 || isempty(obj.waveformSim)
updateMe = [];
end
if isempty(obj.meanWfGlobal)
return;
end
% these guys are not in the default param set, but can b... |
github | JaneliaSciComp/JRCLUST-main | revert.m | .m | JRCLUST-main/+jrclust/+interfaces/@Clustering/revert.m | 6,515 | utf_8 | 2f6f0ecc9198a33ffd725eb971dd4e17 | function success = revert(obj, revertTo)
%REVERT Delete history
success = 0;
if revertTo < 0 || revertTo > obj.nEdits
return;
end
% load history from file
if exist(obj.hCfg.histFile, 'file') ~= 2
error('history file %s not found!', obj.hCfg.histFile);
end
fidHist = fope... |
github | JaneliaSciComp/JRCLUST-main | undeleteUnit.m | .m | JRCLUST-main/+jrclust/+interfaces/@Clustering/undeleteUnit.m | 4,094 | utf_8 | 82282d0edfab25f6de1da21cc48fc9a6 | function res = undeleteUnit(obj, spikeClusters, unitID, indices, metadata)
%UNDELETEUNITS Speculatively undelete a unit, returning a snapshot of
%the spike table and metadata fields.
if nargin < 5
metadata = struct();
end
res = struct('spikeClusters', [], ...
'metadata', [])... |
github | JaneliaSciComp/JRCLUST-main | splitUnit.m | .m | JRCLUST-main/+jrclust/+interfaces/@Clustering/splitUnit.m | 4,962 | utf_8 | f2e92bc7d8b9d97eac4f2997b63082b5 | function res = splitUnit(obj, spikeClusters, unitID, unitPart, metadata)
%SPLITUNIT Speculatively split a unit, returning a snapshot of the
%spike table and metadata fields.
if nargin < 5
metadata = struct();
end
res = struct('spikeClusters', [], ...
'metadata', []);
nS... |
github | JaneliaSciComp/JRCLUST-main | unitWaveformSim.m | .m | JRCLUST-main/+jrclust/+interfaces/@Clustering/private/unitWaveformSim.m | 5,276 | utf_8 | 45b1683e7baf448cb6c405407bdfb359 | function unitSims = unitWaveformSim(meanWfSet, clusterSites, hCfg, scoreData, iCluster)
%UNITWAVEFORMSIM Mean waveform similarity scores for one cluster against all others
updateMe = scoreData.updateMe;
cviShift1 = scoreData.cviShift1;
cviShift2 = scoreData.cviShift2;
simScoreOld = scoreData.simScor... |
github | JaneliaSciComp/JRCLUST-main | autoSplit.m | .m | JRCLUST-main/+jrclust/+curate/@CurateController/autoSplit.m | 24,797 | utf_8 | a22990f93c51f86b5a0953795fbb15f0 | function autoSplit(obj, multisite)
%AUTOSPLIT
if numel(obj.selected) > 1
return;
end
if obj.isWorking
jrclust.utils.qMsgBox('An operation is in progress.');
return;
end
if obj.hClust.unitCount(obj.selected) < 2
msgbox('At least two spikes required for splitting')... |
github | JaneliaSciComp/JRCLUST-main | updateFigISI.m | .m | JRCLUST-main/+jrclust/+curate/@CurateController/updateFigISI.m | 2,942 | utf_8 | 2108d80e13a644aec27716e53e93be02 | function updateFigISI(obj)
%UPDATEFIGISI Plot return map
if isempty(obj.selected) || ~obj.hasFig('FigISI')
return;
end
nSpikes(1) = numel(obj.hClust.spikesByCluster{obj.selected(1)});
if numel(obj.selected)>1
nSpikes(2) = numel(obj.hClust.spikesByCluster{obj.selected(2)});
end ... |
github | JaneliaSciComp/JRCLUST-main | updateCursorFigWav.m | .m | JRCLUST-main/+jrclust/+curate/@CurateController/updateCursorFigWav.m | 1,654 | utf_8 | 3de8f7f14f0e634d9e7d232cc955a732 | function updateCursorFigWav(obj)
%UPDATECURSORFIGWAV Plot mean waveforms on top of selected cluster(s)
if isempty(obj.selected) || ~obj.hasFig('FigWav')
return;
end
hFigWav = obj.hFigs('FigWav');
plotSelectedMeansFun = @(x,y)plotSelectedMeans(hFigWav, obj.hClust, x, y, obj.maxAmp, obj.hCfg, ... |
github | JaneliaSciComp/JRCLUST-main | updateFigSim.m | .m | JRCLUST-main/+jrclust/+curate/@CurateController/updateFigSim.m | 3,992 | utf_8 | 97b46cf0c08acc49e11e53ec26725d0d | function updateFigSim(obj)
%UPDATEFIGSIM Update similarity score figure
if ~obj.hasFig('FigSim')
return;
end
plotFigSim(obj.hFigs('FigSim'), obj.hClust, obj.hCfg, obj.selected, obj.showSubset);
end
%% LOCAL FUNCTIONS
function hFigSim = plotFigSim(hFigSim, hClust, hCfg, selected, showSubset)
... |
github | JaneliaSciComp/JRCLUST-main | updateFigHist.m | .m | JRCLUST-main/+jrclust/+curate/@CurateController/updateFigHist.m | 2,077 | utf_8 | 0a09440d927c6cbf7e21d39c2d54e367 | function updateFigHist(obj)
%UPDATEFIGHIST Plot ISI histogram
if isempty(obj.selected) || ~obj.hasFig('FigHist')
return;
end
plotFigHist(obj.hFigs('FigHist'), obj.hClust, obj.hCfg, obj.selected);
end
%% LOCAL FUNCTIONS
function hFigHist = plotFigHist(hFigHist, hClust, hCfg, selected)
%PLOT... |
github | JaneliaSciComp/JRCLUST-main | updateFigCorr.m | .m | JRCLUST-main/+jrclust/+curate/@CurateController/updateFigCorr.m | 2,120 | utf_8 | c9afa1424b1996d4860e33d224df19d1 | function updateFigCorr(obj)
%UPDATEFIGCORR Plot cross correlation
if isempty(obj.selected) || ~obj.hasFig('FigCorr')
return;
end
plotFigCorr(obj.hFigs('FigCorr'), obj.hClust, obj.hCfg, obj.selected);
end
%% LOCAL FUNCTIONS
function hFigCorr = plotFigCorr(hFigCorr, hClust, hCfg, selected)
%... |
github | JaneliaSciComp/JRCLUST-main | updateFigPSTH.m | .m | JRCLUST-main/+jrclust/+curate/@CurateController/updateFigPSTH.m | 6,955 | utf_8 | f0738a893240f71aad9cc5d5b067854e | function updateFigPSTH(obj, doCreate)
%UPDATEFIGPSTH
if ~doCreate && (~obj.hasFig('FigTrial1') || ~obj.hasFig('FigTrial2'))
return;
end
if doCreate
[hFigTrial1, hFigTrial2] = doPlotFigPSTH(obj.hClust, [], [], obj.selected);
else
hFigTrial1 = obj.hFigs('FigTrial1');
i... |
github | JaneliaSciComp/JRCLUST-main | plotSpikeRaster.m | .m | JRCLUST-main/+jrclust/+curate/@CurateController/private/plotSpikeRaster.m | 22,307 | utf_8 | b29427c15f3ba89c49569d15d619f12a | function [xPoints, yPoints] = plotSpikeRaster(spikes,varargin)
% PLOTSPIKERASTER Create raster plot from binary spike data or spike times
% Efficiently creates raster plots with formatting support. Faster than
% common implementations. Multiple plot types and parameters available!
% Look at Parameters section bel... |
github | JaneliaSciComp/JRCLUST-main | getSiteFeatures.m | .m | JRCLUST-main/+jrclust/+features/getSiteFeatures.m | 3,839 | utf_8 | 135c82bfa678ea499e17be8c8429b907 | % function [mrFet12_, viSpk12_, n1_, n2_, viiSpk12_ord_] = fet12_site_(trFet_spk, S0, P, iSite, vlRedo_spk)
function [siteFeatures, spikes, n1, n2, spikeOrder] = getSiteFeatures(spikeFeatures, site, spikeData, hCfg)
%GETSITEFEATURES Get features occurring on primary and secondary (optionally tertiary) sites
[si... |
github | JaneliaSciComp/JRCLUST-main | spikePCA.m | .m | JRCLUST-main/+jrclust/+features/spikePCA.m | 3,141 | utf_8 | a809fa3606e52f01c9d50ca9e8bc9868 | function [features1, features2, features3] = spikePCA(spikeWindows, hCfg)
%SPIKEPCA Project spikes onto their principal components
% if strcmpi(hCfg.vcFet, 'pca')
prVecs = spikePrVecs(spikeWindows, hCfg);
% else
% mrPv_global = get0_('mrPv_global');
% if isempty(mrPv_global)
% ... |
github | JaneliaSciComp/JRCLUST-main | sortNat.m | .m | JRCLUST-main/+jrclust/+utils/sortNat.m | 3,392 | utf_8 | 498433183b844c5d271ba88620263f85 | %--------------------------------------------------------------------------
function [cs,index] = sortNat(c,mode)
%sort_nat: Natural order sort of cell array of strings.
% usage: [S,INDEX] = sort_nat(C)
%
% where,
% C is a cell array (vector) of strings to be sorted.
% S is C, sorted in n... |
github | JaneliaSciComp/JRCLUST-main | subsample.m | .m | JRCLUST-main/+jrclust/+utils/subsample.m | 1,217 | utf_8 | e82f8e8b1d845748f743dd943b0eb537 | function [vals, vi] = subsample(vals, k, dim)
%SUBSAMPLE Sample k items from vals, optionally along dim
if nargin < 3
dim = 2;
end
if isvector(vals)
doReshape = isrow(vals);
[vals, vi] = subsampleVec(vals(:), k);
% reshape sampled values if necessary
if doReshap... |
github | JaneliaSciComp/JRCLUST-main | detectPeaks.m | .m | JRCLUST-main/+jrclust/+utils/detectPeaks.m | 2,635 | utf_8 | ddb83097899d69049720c43cb51392ce | function [spikeTimes, spikeAmps, spikeSites] = detectPeaks(samplesIn, siteThresh, keepMe, hCfg)
%DETECTPEAKS Detect peaks for each site
samplesIn = jrclust.utils.tryGpuArray(samplesIn, hCfg.useGPU);
nSites = size(samplesIn, 2);
[spikesBySite, ampsBySite] = deal(cell(nSites, 1));
hCfg.updateLog('de... |
github | JaneliaSciComp/JRCLUST-main | meanSubtract.m | .m | JRCLUST-main/+jrclust/+utils/meanSubtract.m | 976 | utf_8 | 39d600752638caa293c5ec831a95ef4f | function vals = meanSubtract(vals, dim, hFun)
%MEANSUBTRACT Subtract mean (or other statistic) from vals
if nargin < 2
dim = 1;
end
if nargin < 3
hFun = @mean;
end
if ~reallyisa(vals, 'single') && ~reallyisa(vals, 'double')
vals = single(vals);
end
% have to res... |
github | JaneliaSciComp/JRCLUST-main | absPath.m | .m | JRCLUST-main/+jrclust/+utils/absPath.m | 2,577 | utf_8 | 15ef22602369c3e4645a47c0b20657e5 | function ap = absPath(pathname, basedir)
%ABSPATH Get the absolute path of pathname (file or directory)
% Returns empty str if pathname can't be found
if nargin < 2 || ~exist(basedir, 'dir')
basedir = pwd();
elseif ~isAbsPath(basedir)
basedir = fullfile(pwd(), basedir);
end
if... |
github | JaneliaSciComp/JRCLUST-main | info.m | .m | JRCLUST-main/+jrclust/+utils/info.m | 1,304 | utf_8 | c1cba019abf9a1514a48ed325d545169 | function md = info()
%INFO Get JRCLUST repository metadata
fid = fopen(fullfile(jrclust.utils.basedir(), 'json', 'jrc.json'), 'r', 'n', 'UTF-8');
fstr = fread(fid, '*char')';
fclose(fid);
md = jsondecode(fstr);
hash = gitHash();
if ~isempty(hash)
md.version.commitHash = hash;
e... |
github | JaneliaSciComp/JRCLUST-main | carReject.m | .m | JRCLUST-main/+jrclust/+utils/carReject.m | 2,779 | utf_8 | 2d2169a9bda0e7aaa89378f50de0a435 | % function [vlKeep_ref, channelMeansMAD] = carReject(vrWav_mean1, P)
function [keepMe, channelMeansMAD] = carReject(channelMeans, blankPerMs, blankThresh, sampleRate)
%CARREJECT
channelMeansMAD = [];
channelMeans = single(channelMeans);
blankWindow = ceil(sampleRate*blankPerMs/1000);
if blank... |
github | JaneliaSciComp/JRCLUST-main | mToStruct.m | .m | JRCLUST-main/+jrclust/+utils/mToStruct.m | 1,398 | utf_8 | e9b307abe3fa074c1b7855f742c62208 | function S = mToStruct(filename)
%MTOSTRUCT read and evaluate a .m script, convert workspace to struct
S = struct();
lines = jrclust.utils.readLines(filename);
lines = stripComments(lines);
if isempty(lines)
return;
end
try
eval(cell2mat(lines'));
wspace = whos();
... |
github | JaneliaSciComp/JRCLUST-main | mergePeaks.m | .m | JRCLUST-main/+jrclust/+utils/private/mergePeaks.m | 4,518 | utf_8 | 8d182d5e84ef95f634a4c4fe8793ee19 | function [spikeTimes, spikeAmps, spikeSites] = mergePeaks(spikesBySite, ampsBySite, hCfg)
%MERGEPEAKS Merge duplicate peak events
nSites = numel(spikesBySite);
spikeTimes = jrclust.utils.neCell2mat(spikesBySite);
spikeAmps = jrclust.utils.neCell2mat(ampsBySite);
spikeSites = jrclust.utils.neCell2mat... |
github | JaneliaSciComp/JRCLUST-main | detectPeaksSite.m | .m | JRCLUST-main/+jrclust/+utils/private/detectPeaksSite.m | 3,027 | utf_8 | 565bdacd7dce6718de33d4ff0002f066 | function [peakLocs, peaks, siteThresh] = detectPeaksSite(samplesIn, siteThresh, hCfg)
%DETECTPEAKSSITE Detect peaks on a given site, computing threshold if necessary
% determine threshold if it has still escaped us
MAX_SAMPLE_QQ = 300000;
if ~isempty(hCfg.evtManualThreshSamp)
siteThresh = hCfg.... |
github | JaneliaSciComp/JRCLUST-main | probe.m | .m | JRCLUST-main/@JRC/probe.m | 2,808 | utf_8 | 267ae5f679c3893d30825d7e40f87e75 | function probe(obj, probeFile)
%PROBE Plot a probe layout
if nargin > 1
[~, ~, ext] = fileparts(probeFile);
if isempty(ext) % a convenience for a forgetful mind
probeFile = [probeFile '.prb'];
end
probeFile_ = jrclust.utils.absPath(probeFile, fullfile(jrclust.utils.b... |
github | JaneliaSciComp/JRCLUST-main | activity.m | .m | JRCLUST-main/@JRC/activity.m | 2,936 | utf_8 | dda8df45b7d146a543ac4bdab5127de3 | function activity(obj)
%ACTIVITY Plot activity
if isempty(obj.res)
obj.loadFiles();
end
plotActivity(obj.res, obj.hCfg);
end
%% LOCAL FUNCTIONS
function plotActivity(spikeData, hCfg)
%DOPLOTACTIVITY Plot activity as a function of depth and time
tBin = 10; % activity every 10 sec
% ... |
github | JaneliaSciComp/JRCLUST-main | loadFiles.m | .m | JRCLUST-main/@JRC/loadFiles.m | 11,074 | utf_8 | e190d1c719a51a835b9c51e6812788c8 | function loadFiles(obj)
%LOADFILES Load results struct
if obj.isError
error(obj.errMsg);
end
if ~exist(obj.hCfg.resFile, 'file')
error('%s does not exist', obj.hCfg.resFile);
return;
end
try
obj.hCfg.updateLog('loadRes', sprintf('Loading %s', obj.hCfg.resFile), ... |
github | JaneliaSciComp/JRCLUST-main | bootstrap.m | .m | JRCLUST-main/@JRC/bootstrap.m | 12,650 | utf_8 | a2ce076e62d45618c1b4ccb323bc5548 | function bootstrap(obj, varargin)
%BOOTSTRAP Bootstrap a JRCLUST session
% metafile: optional string; path (or glob) to meta file(s)
if nargin > 1
metafile_ = jrclust.utils.absPath(varargin{1});
if isempty(metafile_) % TODO: warn?
metafile = '';
workingdir = pwd();
... |
github | CohenBerkeleyLab/BEHR-core-utils-master | BEHR_initial_setup.m | .m | BEHR-core-utils-master/BEHR_initial_setup.m | 19,737 | utf_8 | 372cbecdc1343d93cff8c38d21457b20 | function [ ] = BEHR_initial_setup( )
%BEHR_INITIAL_SETUP Perform the actions necessary to set up BEHR to run
% There are several steps to prepare the BEHR algorithm to run:
% 1) Clone the necessary repositories from GitHub
% 2) Identify the paths where OMI, MODIS, GLOBE, and WRF-Chem data
% reside.... |
github | CohenBerkeleyLab/BEHR-core-utils-master | compute_flight_vector.m | .m | BEHR-core-utils-master/Regrid_tools/Compute_Corner_Pts_ms/compute_flight_vector.m | 679 | utf_8 | 2db9799e3119ef22e7c99d0f1a697ae1 | %%compute_flight_vector
%%arr 12/10/2007
%JLL 2-18-2014: The flight vector is the straight line between two points
%on the earth's surface. It is the chord connecting those points, not the
%arc across the surface.
function [flightvector] = compute_flight_vector(lat, lon, lat1, lon1)
earthradius = 6378.5;
n... |
github | CohenBerkeleyLab/BEHR-core-utils-master | compute_corner_pts.m | .m | BEHR-core-utils-master/Regrid_tools/Compute_Corner_Pts_ms/compute_corner_pts.m | 1,436 | utf_8 | c809e3f1da3b689227cf8c9905002307 | %%compute_corner_pts
%%arr 12/10/2007
function [latcorner, loncorner] = compute_corner_pts(lat, lon, flightvector, fwhm)
earthradius = 6378.5; %km
n = length(lat);
latcorner = zeros(n,2);
loncorner = zeros(n,2);
for i = 1:n;
[x1,y1,z1] = sph2cart(lon(i)*pi/180,lat(i)*pi/180,earthradius); %JLL 17 M... |
github | CohenBerkeleyLab/BEHR-core-utils-master | weight_flight_dir.m | .m | BEHR-core-utils-master/Regrid_tools/Compute_Corner_Pts_ms/weight_flight_dir.m | 2,307 | utf_8 | 3cb09cb6603c792cc3b6c03a292f851f | %%weight_flight_dir
%%arr 12/10/2007
%distance is the distance to the satellite
function [wx] = weight_flight_dir(distance, x)
%assume that the fwhm of ifov is 1 deg: (JLL 2-19-2014: ifov =
%intrinsic field of view, c.f. http://www.knmi.nl/omi/research/instrument/characteristics.php)
%This is the ifov along... |
github | CohenBerkeleyLab/BEHR-core-utils-master | compute_edge_pts.m | .m | BEHR-core-utils-master/Regrid_tools/Compute_Corner_Pts_ms/compute_edge_pts.m | 1,579 | utf_8 | 7c33a3b56929d5041fe96de4fda230f0 | %%compute_edge_pts
%%arr 12/10/2007
function [latedge, lonedge] = compute_edge_pts(lat, lon)
n = length(lat);
latedge = zeros(n+1,1);
lonedge = zeros(n+1,1);
%the extrapolations
%JLL 5-12-2014: Assume that the pixel lat and lon is a linear function of
%"pixel number" and so calculate the edge of the fi... |
github | CohenBerkeleyLab/BEHR-core-utils-master | weight_distance.m | .m | BEHR-core-utils-master/Regrid_tools/Compute_Corner_Pts_ms/weight_distance.m | 758 | utf_8 | c4901b7273255d3788e9707a9fa914ac | %%weight_distance
%%arr 12/10/2007
%computes the array of weights on the ground as a function of the distance
%to the center of the ground pixel
function [fwhm] = weight_distance(distance)
%JLL 2-19-2014: These were commented out when I received the file.
%nsteps = 1001;
%start = -50;
%xend = 50;
%dx = ... |
github | CohenBerkeleyLab/BEHR-core-utils-master | compute_distance.m | .m | BEHR-core-utils-master/Regrid_tools/Compute_Corner_Pts_ms/compute_distance.m | 1,045 | utf_8 | 49532ac0754613512a0c765b5f7d9f1b | %%compute_distance
%%arr 12/10/2007
%JLl 2-19-2014: I believe that lat and lon SHOULD be single numbers but am
%not positive. This then returns the distance from the satellite to the
%latitude and longitude input.
function [distance] = compute_distance(lat, lon, satlat, satlon, satalt)
earthradius = 6378.5;
... |
github | CohenBerkeleyLab/BEHR-core-utils-master | fxn_corner_coordinates.m | .m | BEHR-core-utils-master/Regrid_tools/Compute_Corner_Pts_ms/fxn_corner_coordinates.m | 2,961 | utf_8 | 96c75caa5b83b8acabb93b2b1c3cee01 | %%corner_coordinates
%%arr 12/10/2007
%%JLL 3 Mar 2014 - Converted to a function to make more clear input and
%%output values.
%{
Latitude=zeros(60,y); Longitude=zeros(60,y); SpacecraftLatitude=zeros(60,y);
SpacecraftLongitude=zeros(60,y); SpacecraftAltitude=zeros(60,y)
where y = number of scanlines in the o... |
github | CohenBerkeleyLab/BEHR-core-utils-master | compute_fwhm.m | .m | BEHR-core-utils-master/Regrid_tools/Compute_Corner_Pts_ms/compute_fwhm.m | 456 | utf_8 | cba3a9e5634a9844a27519fa9236d567 | %%compute_fwhm
%%arr 12/10/2007
function [fwhm] = compute_fwhm(lat, lon, satlat, satlon, satalt)
n = length(lat);
fwhm = zeros(n,1);
distance = zeros(n,1);
for i = 1:n;
distance(i) = compute_distance(lat(i), lon(i), satlat, satlon, satalt); %This is the distance from the satellite to the lat/lon sp... |
github | CohenBerkeleyLab/BEHR-core-utils-master | compute_edge_pts_2014.m | .m | BEHR-core-utils-master/Regrid_tools/Compute_Corner_Pts_ms/compute_edge_pts_2014.m | 1,637 | utf_8 | 88e4ec96b9c141f1134437ba00c210bc | %%compute_edge_pts
%%arr 12/10/2007
function [latedge, lonedge] = compute_edge_pts(lat, lon)
n = length(lat);
latedge = zeros(n+1,1);
lonedge = zeros(n+1,1);
%the extrapolations
%JLL 5-12-2014: Assume that the pixel lat and lon is a linear function of
%"pixel number" and so calculate the edge of the fi... |
github | CohenBerkeleyLab/BEHR-core-utils-master | behr_data_check_parse.m | .m | BEHR-core-utils-master/Utils/behr_data_check_parse.m | 3,178 | utf_8 | 2a1efe441ff19ddfd8a9789f21b2de14 | function [ ] = behr_data_check_parse( Data_Chk )
%behr_data_check_parse Writes a text file with missing BEHR data.
% Takes the data structure from behr_data_check and writes out a text
% file in the current directory containing the information.
E = JLLErrors;
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% INPUT PARSING %%%%... |
github | CohenBerkeleyLab/BEHR-core-utils-master | cat_sat_data.m | .m | BEHR-core-utils-master/Utils/cat_sat_data.m | 10,701 | utf_8 | 7e92a78afa369ac3f91e13df3b778bfb | function [ varargout ] = cat_sat_data( filepath, datafields, varargin )
%CAT_SAT_DATA( FILEPATH, DATAFIELDS ) Concatenates data from OMI .mat files
% In some cases, one might wish to use satellite data from multiple days,
% but we import OMI data and process BEHR data into daily files. This
% function will load a... |
github | CohenBerkeleyLab/BEHR-core-utils-master | hdfreadmodis.m | .m | BEHR-core-utils-master/Utils/hdfreadmodis.m | 3,798 | utf_8 | 42142015479b117641fd5f4522c4928c | function [ data, fill_value, scale_factor, offset ] = hdfreadmodis( filename, dsetname, varargin )
%HDFREADMODIS Wrapper around HDFREAD that handles fills, scale, and offset for MODIS files
% DATA = HDFREADMODIS( FILENAME, DSETNAME ) - Reads in the dataset from
% FILENAME at internal path DSETNAME. Uses HDFREAD int... |
github | CohenBerkeleyLab/BEHR-core-utils-master | behr_data_check.m | .m | BEHR-core-utils-master/Utils/behr_data_check.m | 13,437 | utf_8 | 8a80c5f57a518197531024c37f8d540e | function [ Data_Struct ] = behr_data_check( )
%behr_data_check Checks for missing satellite files needed for BEHR
% BEHR requires 3 different satellite data sets:
% 1) The Level 2 OMNO2 files
% 2) Aqua-MODIS cloud product (MYD06_L2)
% 3) 16-day combined MODIS albedo (MCD43)
% This function will c... |
github | CohenBerkeleyLab/BEHR-core-utils-master | subset_behr_data_struct.m | .m | BEHR-core-utils-master/Utils/subset_behr_data_struct.m | 4,444 | utf_8 | d3010edd21ee09249cac53b82d099f47 | function Data = subset_behr_data_struct(Data, varargin)
% SUBSET_BEHR_DATA_STRUCT Subset fields of a BEHR data structure, keeping shape as much as possible
% DATA = SUBSET_BEHR_DATA_STRUCT(DATA, INDEX1, INDEX2, ...) Subsets the
% fields in DATA with INDEX1, INDEX2, etc. Each INDEX argument
% corresponds to one el... |
github | CohenBerkeleyLab/BEHR-core-utils-master | m_proj.m | .m | BEHR-core-utils-master/Utils/m_map/m_proj.m | 5,598 | utf_8 | 08103651696dcffd4901c8f2575f210d | function m_proj(proj,varargin)
% M_PROJ Initializes map projections info, putting the result into a structure
%
% M_PROJ('get') tells you the current state
% M_PROJ('set') gives you a list of all possibilities
% M_PROJ('set','proj name') gives info about a projection in the
% ... |
github | CohenBerkeleyLab/BEHR-core-utils-master | m_hatch.m | .m | BEHR-core-utils-master/Utils/m_map/m_hatch.m | 8,674 | utf_8 | 2c6e74cd312d1da0fdbb1287ec4cbe7a | function [xi,yi,x,y]=m_hatch(lon,lat,varargin);
% M_HATCH Draws hatched or speckled interiors to a patch
%
% M_HATCH(LON,LAT,STYL,ANGLE,STEP,...line parameters);
%
% INPUTS:
% X,Y - vectors of points.
% STYL - style of fill
% ANGLE,STEP - parameters for style
%
% E.g.
%
% ... |
github | CohenBerkeleyLab/BEHR-core-utils-master | m_grid.m | .m | BEHR-core-utils-master/Utils/m_map/m_grid.m | 27,478 | utf_8 | c3b2dec8e52e76f44663d1945ae83fe4 | function m_grid(varargin);
% M_GRID make a grid on a map.
% M_GRID('parameter','value',...) with any number (or no)
% optional parameters is used to draw a lat/long grid for a
% previously initialized map projection.
%
% The optional parameters allow the user
% to control the look of ... |
github | CohenBerkeleyLab/BEHR-core-utils-master | mp_utm.m | .m | BEHR-core-utils-master/Utils/m_map/private/mp_utm.m | 10,031 | utf_8 | 0f2bdbaae3627ac4ef3095faa5d099a5 | function [X,Y,vals,labI]=mp_utm(optn,varargin)
% MP_UTM Universal Transverse Mercator projection
% This function should not be used directly; instead it is
% is accessed by various high-level functions named M_*.
% mp_utm.m, Peter Lemmond (peter@whoi.edu)
% created mp_utm.m 13Aug98 from mp_tmer... |
github | CohenBerkeleyLab/BEHR-core-utils-master | mu_coast.m | .m | BEHR-core-utils-master/Utils/m_map/private/mu_coast.m | 23,340 | utf_8 | e311e8a8c34c939a523f620a92658064 | function [ncst,Area,k]=mu_coast(optn,varargin);
% MU_COAST Add a coastline to a given map.
% MU_COAST draw a coastline as either filled patches (slow) or
% lines (fast) on a given projection. It uses a coastline database with
% a resolution of about 1/4 degree.
%
% It is not meant to be... |
github | CohenBerkeleyLab/BEHR-core-utils-master | mu_util.m | .m | BEHR-core-utils-master/Utils/m_map/private/mu_util.m | 12,820 | utf_8 | be5db1c1bc7465b648f42f12205f8d0d | function varargout=mu_util(optn,varargin);
% MU_UTIL Various utility routines
% This function should not be used directly; instead it is
% is accessed by other high- and low-level functions.
% MU_UTIL is basically a driver for a number of lower-level routines collected
% together for convenience. T... |
github | CohenBerkeleyLab/BEHR-core-utils-master | find_wrf_path.m | .m | BEHR-core-utils-master/Utils/Constants/find_wrf_path.m | 2,796 | utf_8 | 7809e1038bdfbb11c945ea575366fefd | function [ wrf_path ] = find_wrf_path( region, profile_mode, this_date, varargin )
%FIND_WRF_PATH Returns the path to WRF profiles for the given date
% WRF_PATH = FIND_WRF_PATH( REGION, PROFILE_MODE, THIS_DATE ) Returns the
% proper path to the WRF-Chem profiles as WRF_PATH. Given PROFILE_MODE =
% 'monthly', will... |
github | CohenBerkeleyLab/BEHR-core-utils-master | temperature_prof_unit_test.m | .m | BEHR-core-utils-master/Tests/temperature_prof_unit_test.m | 2,499 | utf_8 | 3385cf53eef51962fe4d836fceccaaed | function [ success ] = temperature_prof_unit_test( test_data_input_dir )
%TEMPERATURE_PROF_UNIT_TEST Tests rNmcTmp2 against previous output
% SUCCESS = TEMPERATURE_PROF_UNIT_TEST() Reads the file
% "temperature_prof_test_data.mat" from the same directory as this
% function and runs rNmcTmp2 with the latitude, lon... |
github | CohenBerkeleyLab/BEHR-core-utils-master | check_myd06_files.m | .m | BEHR-core-utils-master/Downloading/check_myd06_files.m | 1,412 | utf_8 | 7338823c858168e63c52820a1c5fa917 | function check_myd06_files
% CHECK_MYD06_FILES Checks which MODIS cloud files cannot be opened
%
% I've been having trouble with certain MODIS cloud files being corrupted and
% unopenable using MATLAB's hdfinfo command, so this function will go through
% all the MYD06 files, try to open them, and if that fails, write t... |
github | CohenBerkeleyLab/BEHR-core-utils-master | rNmcTmp2.m | .m | BEHR-core-utils-master/AMF_tools/rNmcTmp2.m | 2,924 | utf_8 | 06c0a3f86e9770b545c4e816c66977ac | %%rNmcTmp2
%%arr 07/23/2008
%..........................................................................
% Returns vector of temperatures on input pressure grid,
% for nearest longitude and latitude in geographic grid
%
% New, simplified version (without write capability) that
% also interpolates profile onto ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.