meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
applications:applications [2022/03/07 23:31] joetulenkoapplications:applications [2023/02/16 05:11] (current) gregbalco
Line 2: Line 2:
  
 Here are some examples we have come up with so far. Please email any of us on the project [[balcs@bgc.org|Greg Balco]], [[benjamin.laabs@ndsu.edu|Ben Laabs]], and/or [[jtulenko@bgc.org|Joe Tulenko]] with your ideas so we can add them to the list! Here are some examples we have come up with so far. Please email any of us on the project [[balcs@bgc.org|Greg Balco]], [[benjamin.laabs@ndsu.edu|Ben Laabs]], and/or [[jtulenko@bgc.org|Joe Tulenko]] with your ideas so we can add them to the list!
- 
-**1) Analysis layer examples: the ICE-D X OCTOPUS web application** 
-The [[http://octopus.x.ice-d.org|ICE-D X OCTOPUS]] web application is not very much like the rest of the ICE-D focus area applications because it doesn't rely on an ICE-D-maintained back end database. Instead, its data layer is the [[https://earth.uow.edu.au|OCTOPUS database of cosmogenic-nuclide data used for erosion rate estimates]]. Also, the web application accesses those data by interacting with a Geoserver web feature server rather than a MySQL database. However, it does use ICE-D middle layer applications (the web service implementation of the online erosion rate calculator), so it's a good example of an analysis-layer application that uses both data-layer and middle-layer services. Also, it highlights the idea that you can mix and match data- and middle-layer servives from various places to do what you need to do. Finally, it's a pretty simple web application with a fairly minimal amount of code.  
- 
-The source code for the ICE-D X OCTOPUS web app can be viewed [[https://github.com/balcs/ice-d-x-octopus|here]]. It is written in Python 2.7, uses the [[https://webapp2.readthedocs.io/en/latest/|webapp2]] application framework, and runs on Google App Engine. Unfortuately this is kind of obsolete because GAE has been migrating to Python 3 and different web app frameworks (so I am not sure if you could install and run it on a newly created GAE project), but it is a nice simple example of how a transparent-middle-layer application can work.  
  
 ---- ----
  
-**2) Data-model comparison between LGM and penultimate moraine ages, and model output from simulations over multiple glaciations** (ie the ice sheet influence on regional climate example). **Hypothesis:** if the impact from ice sheets on re-arranging large-scale atmospheric circulation and thus modulating regional climate is actually significant, we should be able to use climate model output to predict the geospatial patterns of moraine preservation over multiple glacial cycles. This could be tested by comparing moraine ages and geospatial patterns from the database with model output to see where there is good fit between model output and data and where there isn't. +**1) Data-model comparison between LGM and penultimate moraine ages, and model output from simulations over multiple glaciations** (ie the ice sheet influence on regional climate example). **Hypothesis:** if the impact from ice sheets on re-arranging large-scale atmospheric circulation and thus modulating regional climate is actually significant, we should be able to use climate model output to predict the geospatial patterns of moraine preservation over multiple glacial cycles. This could be tested by comparing moraine ages and geospatial patterns from the database with model output to see where there is good fit between model output and data and where there isn't. 
  
 See the example output figure below and {{ :applications:ice_sheet_influence_exercise.pdf |find a link to the tutorial here.}} See the example output figure below and {{ :applications:ice_sheet_influence_exercise.pdf |find a link to the tutorial here.}}
Line 18: Line 13:
 ----  ---- 
  
-**3) Testing global expression of Younger Dryas**+**2) Testing global expression of Younger Dryas**
 Please find a tutorial and some matlab scripts used to generate some of the plots found in a recent paper from Greg Balco ([[https://www.annualreviews.org/doi/abs/10.1146/annurev-earth-081619-052609|Balco, 2021]]) in this example. Please find a tutorial and some matlab scripts used to generate some of the plots found in a recent paper from Greg Balco ([[https://www.annualreviews.org/doi/abs/10.1146/annurev-earth-081619-052609|Balco, 2021]]) in this example.
  
Line 28: Line 23:
 ----  ---- 
  
-**4) Post-Glacial Greenland ice-sheet retreat time-distance diagram** following up on a workshop at the University at Buffalo, we attempted to generate a time-distance diagram of SW Greenland Ice Sheet retreat and you can find the matlab script here.+**3) Post-Glacial Greenland ice-sheet retreat time-distance diagram** following up on a workshop at the University at Buffalo, we attempt to generate a time-distance diagram of SW Greenland Ice Sheet retreat and you can find the matlab script here to generate the following results: 
 + 
 +{{:applications:westgreenland_tdd_fig1.png?nolink&275|}}{{:applications:westgreenland_tdd_fig2.png?nolink&675|}} 
 + 
 + 
 +The script combs through the new database and selects all ages from 'boulder' samples specifically from ICE-D Greenland that exist within the bounds box on the first figure and then plots the ages against longitude to convincingly show that as you move from the coast inland, ages generally get younger and track the recession of the Greenland Ice Sheet through the Holocene. 
 + 
 +<code> 
 + 
 +% Does deglaciation TDD for west Greenland.... 
 +clear all; close all; 
 + 
 +%% For MAC users use this set of code to connect to the database 
 +% First set up SSH tunnel on port 12345. 
 +%dbc = database('iced','reader','beryllium-10','Vendor','MySQL','server','localhost','port',12345); 
 + 
 +%% For WINDOWS users use this set of code to connect to the database 
 +dbc = database('ICED2', 'reader', 'beryllium-10'); 
 + 
 +%% get all samples 
 + 
 +q1 = ['select iced.base_sample.lat_DD, iced.base_sample.lon_DD ' ... 
 +    'from iced.base_sample,iced.base_application_sites,iced.base_application ' ... 
 +    'where iced.base_sample.site_id = iced.base_application_sites.site_id ' ... 
 +    'and iced.base_application_sites.application_id = iced.base_application.id ' ... 
 +    'and iced.base_application.Name = "Greenland"']; 
 + 
 +result1 = fetch(dbc,q1); 
 + 
 +%% get West Greenland samples 
 + 
 +blats = [64.8 71]; 
 +%blats = [61 71]; 
 +blons = [-60 -48]; 
 + 
 +q2 = ['select iced.base_sample.lat_DD, iced.base_sample.lon_DD ' ... 
 +    ' from iced.base_sample,iced.base_application_sites,iced.base_application ' ... 
 +    ' where iced.base_sample.lat_DD < ' sprintf('%0.1f',blats(2)) ... 
 +    ' and iced.base_sample.lon_DD < ' sprintf('%0.1f',blons(2)) ... 
 +    ' and iced.base_sample.lat_DD > ' sprintf('%0.1f',blats(1)) ... 
 +    ' and iced.base_sample.lon_DD > ' sprintf('%0.1f',blons(1)) ... 
 +    ' and iced.base_sample.site_id = iced.base_application_sites.site_id ' ... 
 +    ' and iced.base_application_sites.application_id = iced.base_application.id ' ... 
 +    ' and iced.base_application.Name = "Greenland"']; 
 + 
 +result2 = fetch(dbc,q2); 
 + 
 +locs1 = cell2mat(table2cell(result1)); 
 +locs2 = cell2mat(table2cell(result2)); 
 + 
 +%% get age data from everything 
 + 
 +q3 = ['select iced.base_sample.lat_DD, iced.base_sample.lon_DD, ' ... 
 +    'iced.base_calculatedages.t_St,iced.base_calculatedages.t_LSDn,iced.base_calculatedages.dtint_St, ' ... 
 +    'iced.base_calculatedages.dtext_St ' ... 
 +    'from iced.base_sample, iced.base_calculatedages, iced.base_application_sites,iced.base_application' ... 
 +    ' where iced.base_sample.id = iced.base_calculatedages.sample_unique_id ' ... 
 +    ' and iced.base_sample.site_id = iced.base_application_sites.site_id ' ... 
 +    ' and iced.base_application_sites.application_id = iced.base_application.id ' ... 
 +    ' and iced.base_application.Name = "Greenland"' ... 
 +    ' and lat_DD < ' sprintf('%0.1f',blats(2)) ' and lon_DD < ' sprintf('%0.1f',blons(2)) ' and lat_DD > ' sprintf('%0.1f',blats(1)) ' and lon_DD > ' sprintf('%0.1f',blons(1))]; 
 + 
 +result3 = fetch(dbc,q3); 
 + 
 +%%  
 + 
 +ages1 = cell2mat(table2cell(result3)); 
 + 
 +% And just from boulders 
 +q4 = [q3 ' and iced.base_sample.what like "%boulder"']; 
 + 
 +result4 = fetch(dbc,q4); 
 + 
 +ages2 = cell2mat(table2cell(result4)); 
 + 
 +close(dbc); 
 + 
 +%%  
 + 
 +figure(1); clf;  
 +% Center on Greenland Summit 
 +gisplat = 72 + 36/60; 
 +gisplon = -38.5; 
 + 
 +xl = [-0.18 0.15]; 
 +yl = [-0.25 0.25]; 
 + 
 +tx = xl(1) + 0.95*diff(xl); 
 +ty = yl(1) + 0.06*diff(yl); 
 +ts = 14; 
 + 
 +mw = 0.005; 
 +awx = (1 - 5*mw)/4; 
 +awy = (1-2*mw); 
 + 
 +axesm('mapprojection','eqdazim','origin',[gisplat gisplon 0]); 
 + 
 +%axesm('globe','grid','on'
 + 
 + 
 +g1 = geoshow('landareas.shp'); 
 +set(get(g1,'children'),'facecolor',[0.9 0.9 0.9]); 
 +set(gca,'xlim',xl);  
 +set(gca,'ylim',yl); 
 +hold on; 
 + 
 + 
 +% Plot all samples 
 +plotm(locs1(:,1),locs1(:,2),'ko','markerfacecolor',[0.7 0.7 1]); 
 +% Plot only samples in west greenland selection box 
 +plotm(locs2(:,1),locs2(:,2),'ko','markerfacecolor',[0.2 0.2 1]); 
 + 
 + 
 +plotm(blats([1 1 2 2 1]),blons([1 2 2 1 1]),'b','linewidth',1); 
 + 
 + 
 + 
 +
 + 
 +set(gca,'box','off','xcolor',[1 1 1],'ycolor',[1 1 1]); 
 +%plotm(gisplat,gisplon,'ko','markerfacecolor','w'); 
 +%text(tx,ty,[sprintf('%0.0f',100*f2) '%'],'fontsize',ts,'horizontalalignment','right'); 
 + 
 +hg = gridm('on'); 
 +set(hg,'clipping','on'); 
 +set(hg,'linestyle','-','color',[0.75 0.75 0.75]); 
 + 
 +temp = jet(12); 
 +for a = 1:12 
 +    maxage = 11000 - (a-1).*500; 
 +    minage = maxage - 500; 
 +    these = find(ages2(:,3) < maxage & ages2(:,3) > minage); 
 +    if length(these) > 0 
 +        plotm(ages2(these,1),ages2(these,2),'o','color',[0.5 0.5 0.5],'markerfacecolor',temp(a,:));drawnow; 
 +    end 
 +end 
 + 
 + 
 + 
 + 
 + 
 +%% Plot 
 + 
 +figure(2); clf;  
 +%plot(ages1(:,2),ages1(:,3),'bo','markerfacecolor',[0.5 0.5 1]); 
 +hold on; 
 + 
 +for a = 1:size(ages2,1) 
 +    xx = [1 1].*ages2(a,2); 
 +    yy = ages2(a,3) + [-1 1].*ages2(a,5); 
 +    plot(xx,yy,'r'); hold on; 
 +end 
 + 
 +plot(ages2(:,2),ages2(:,3),'ko','markerfacecolor','r'); 
 +set(gca,'ylim',[5000 15000]); grid on; 
 + 
 +%% Plot proposed cold periods from Young and others, etc.  
 + 
 +hold on; 
 + 
 +events = [11620 10410 9090 8050 7300]; 
 +devents = [430 350 260 220 310]; 
 + 
 +for a = 1:length(events) 
 +    xx = [-54 -49]; yy = [events(a) events(a)]; 
 +    plot(xx,yy,'b','linewidth',1); 
 +    xx = [-54 -49 -49 -54 -54]; 
 +    yy = [events(a)-devents(a) events(a)-devents(a) events(a)+devents(a) events(a)+devents(a) events(a)-devents(a)]; 
 +    patch(xx,yy,[0.8 0.8 1],'edgecolor','none','facealpha',0.1); 
 +end 
 +  
 +%% filter for better AEP performance 
 +p1 = polyfit([-53.5 -49.88],[11500 6426],1); 
 +px = [-54 -49]; py = polyval(p1,px); %plot(px,py,'g'); 
 + 
 +predt = polyval(p1,ages2(:,2)); 
 +okclip = find(abs(predt - ages2(:,3)) < 1000); 
 +plot(ages2(okclip,2), ages2(okclip,3),'ko','markersize',8); 
 + 
 +aept = ages2(okclip,3); 
 +aepdt = ages2(okclip,5); 
 +aepz = -ages2(okclip,2).*100 - 4900; 
 + 
 +% Get bounding curve 
 + 
 +out = aep_bound(aept,aepz,0); 
 +figure(2); 
 +aept_out = out.t; aepx_out = -(out.z + 4900)./100; 
 +plot(aepx_out,aept_out,'k');  
 + 
 +%% MCS bounding curve 
 + 
 +% Interestingly, this is weirdly pathological because at the westings where 
 +% there are a lot of data, almost all the random iterations have one 
 +% outlier that pulls it out. So it actually doesn't really work.  
 + 
 +if 1 
 + 
 +figure;  
 +plot(aept,aepz,'ro'); hold on; drawnow; 
 +p1 = plot(1000,1000,'ro'); 
 +ni = 100; 
 +intt = 6500:10:12000; 
 +for a = 1:ni 
 +    thist = randn(size(aept)).*aepdt + aept; 
 +    thisz = aepz; 
 +    out = aep_bound(thist,thisz,0); 
 +    delete(p1); 
 +    p1 = plot(thist,thisz,'bo'); 
 +    plot(out.t,out.z,'k'); drawnow; pause; 
 +    %inty(a,:) = interp1(out.t,out.z,intt); 
 +    %plot(intt,inty(a,:),'k'); 
 +    disp(a); 
 +end 
 + 
 +end 
 +     
 +%%  
 + 
 +if 1 
 +     
 +    % Make figure comparing this to Holocene "events"  
 + 
 +    figure; 
 +    diffx = diff(aepx_out)./diff(aept_out); 
 +    for a = 1:length(diffx) 
 +        xx = [aept_out(a) aept_out(a+1) aept_out(a+1)]; 
 +        if a == length(diffx) 
 +            yy = -[diffx(a) diffx(a) diffx(a)]; 
 +        else 
 +            yy = -[diffx(a) diffx(a) diffx(a+1)]; 
 +        end 
 +        plot(xx,yy,'r'); hold on; 
 +    end 
 + 
 + 
 +    set(gca,'xlim',[6000 12000]); 
 +    grid on; 
 +    for a = 1:length(events) 
 +        yy = [0 5e-3]; xx = [events(a) events(a)]; 
 +        plot(xx,yy,'b','linewidth',1); 
 +        yy = [0 5e-3 5e-3 0 0]; 
 +        xx = [events(a)-devents(a) events(a)-devents(a) events(a)+devents(a) events(a)+devents(a) events(a)-devents(a)]; 
 +        patch(xx,yy,[0.8 0.8 1],'edgecolor','none','facealpha',0.1); 
 +    end 
 +     
 +end 
 + 
 +</code>
  
 ---- ----
  
-**5) Determining if measurement precision has gotten better through time**+**4) Determining if measurement precision has gotten better through time**
 This is a somewhat simple and fun exercise to investigate whether or not we as a community have been making progressively better measurements (ie improvements to field sample techniques, lab extraction procedures, AMS measurements, etc that should hopefully be leading to more precise cosmo measurements). This is a somewhat simple and fun exercise to investigate whether or not we as a community have been making progressively better measurements (ie improvements to field sample techniques, lab extraction procedures, AMS measurements, etc that should hopefully be leading to more precise cosmo measurements).
  
Line 61: Line 304:
 <code> <code>
  
-%%%% A matlab script for extracting all samples from the database that have sample collection date info+%%%% A matlab script for extracting all 10Be measurements from the alpine/entire database that have sample collection date info
 %%%% and plotting their % measurement uncertainty against collection date %%%% and plotting their % measurement uncertainty against collection date
 %%%% to see if we collectively as a community have gotten any better over the years  %%%% to see if we collectively as a community have gotten any better over the years 
Line 77: Line 320:
 % assuming you set up an ODBC connection: % assuming you set up an ODBC connection:
  
-dbc = database('ICED-ALPINE','reader','beryllium-10');+dbc = database('ICED2','reader','beryllium-10');
  
 % here is some code from Greg Balco for connecting to the database from a % here is some code from Greg Balco for connecting to the database from a
Line 99: Line 342:
 % AMS measurement error into one table: % AMS measurement error into one table:
  
-q1 = ['select samples.sample_namesamples.date_collected, Be10_Al26_quartz.N10_atoms_g, Be10_Al26_quartz.delN10_atoms_g, calculated_ages.t_LSDn ' ... +%% Query to extract all 10Be data from the alpine database 
-    ' from samplesBe10_Al26_quartzcalculated_ages ' ... + 
-    ' where samples.sample_name Be10_Al26_quartz.sample_name ' ... +q1 = ['select iced.base_sample.nameiced.base_sample.date_collected, iced._be10_al26_quartz.N10_atoms_g, iced._be10_al26_quartz.delN10_atoms_g, iced.base_calculatedages.t_LSDn ' ... 
-    ' and samples.sample_name calculated_ages.sample_name '... +    ' from iced.base_sampleiced._be10_al26_quartziced.base_calculatedages, iced.base_site, iced.base_application_sites ' ... 
-    ' and samples.date_collected is not null '... +    ' where iced.base_sample.id iced._be10_al26_quartz.sample_id ' ... 
-    ' and Be10_Al26_quartz.N10_atoms_g is not null '... +    ' and iced.base_sample.id iced.base_calculatedages.sample_unique_id ' ... 
-    ' and Be10_Al26_quartz.delN10_atoms_g is not null '... +    ' and iced.base_sample.site_id = iced.base_site.id ' ... 
-    ' and samples.date_collected not like "0000-00-00" '... +    ' and iced.base_site.id = iced.base_application_sites.site_id ' ... 
-    ' and samples.date_collected not like "0001-01-12" '];+    ' and iced.base_sample.date_collected is not null ' ... 
 +    ' and iced._be10_al26_quartz.N10_atoms_g is not null ' ... 
 +    ' and iced._be10_al26_quartz.delN10_atoms_g is not null ' ... 
 +    ' and iced.base_sample.date_collected not like "0000-00-00" ' ... 
 +    ' and iced.base_sample.date_collected not like "0001-01-12" ' ... 
 +    ' and iced.base_application_sites.application_id = 2 ']; 
 + 
 +%% If you would like to try the entire database (not just the alpine database) use this query instead of the first one 
 + 
 +%q1 = ['select iced.base_sample.name, iced.base_sample.date_collected, iced._be10_al26_quartz.N10_atoms_g, iced._be10_al26_quartz.delN10_atoms_g, iced.base_calculatedages.t_LSDn ' ... 
 +%    ' from iced.base_sample, iced._be10_al26_quartz, iced.base_calculatedages ' ... 
 +%    ' where iced.base_sample.id = iced._be10_al26_quartz.sample_id ' ... 
 +%    ' and iced.base_sample.id = iced.base_calculatedages.sample_unique_id ' ... 
 +%    ' and iced.base_sample.date_collected is not null ' ... 
 +%    ' and iced._be10_al26_quartz.N10_atoms_g is not null ' ... 
 +%    ' and iced._be10_al26_quartz.delN10_atoms_g is not null ' ... 
 +%    ' and iced.base_calculatedages.t_LSDn not like "0" ' ... 
 +%    ' and iced.base_sample.date_collected not like "0000-00-00" ' ... 
 +%    ' and iced.base_sample.date_collected not like "0001-01-12" ']; 
 + 
 +%% gather the data and organize it into cell arrays that can be used for plotting
  
 % now, we want to store these selections as a table in matlab % now, we want to store these selections as a table in matlab
Line 129: Line 392:
 % collected (year + month/12 + day/30) and the age of each sample to make % collected (year + month/12 + day/30) and the age of each sample to make
 % a scatterplot of percent error versus time (with marker size dictated by age) % a scatterplot of percent error versus time (with marker size dictated by age)
 +
 +%% Figure 1 - percent error by date measured without detrending the influence of sample concentration
  
 fig1 = figure(1) fig1 = figure(1)
Line 153: Line 418:
 % (see the script below and the resulting figure that demonstrates this  % (see the script below and the resulting figure that demonstrates this 
 % what-appears-to-be a power relationship. % what-appears-to-be a power relationship.
 +
 +%% Figure 2 establishing the relationship between sample concentration and percent error
  
 fig2 = figure(2) fig2 = figure(2)
Line 190: Line 457:
 %this is an attempt to detrend the data in concentration vs percent error %this is an attempt to detrend the data in concentration vs percent error
 %space and plot the detrended data against date of measurement. Anyway... %space and plot the detrended data against date of measurement. Anyway...
 +
 +%% Figure 3 plotting percent error by date measured after accounting for influence of concentration on percent error
  
 fig3 = figure(3) fig3 = figure(3)
Line 214: Line 483:
 ---- ----
  
-**6) Is there a correlation between Al/Be ratios and sample elevation?**+**5) Is there a correlation between Al/Be ratios and sample elevation?**
 This example is based off a recent publication ([[https://www.mdpi.com/2076-3263/11/10/402|Halsted et al., 2021]]) that found there is a correlation between Al / Be ratios and elevation that likely needs to be taken into account. This example is based off a recent publication ([[https://www.mdpi.com/2076-3263/11/10/402|Halsted et al., 2021]]) that found there is a correlation between Al / Be ratios and elevation that likely needs to be taken into account.
  
Line 239: Line 508:
 % assuming you set up an ODBC connection: % assuming you set up an ODBC connection:
  
-dbc = database('ICED-ALPINE','reader','beryllium-10');+dbc = database('ICED2','reader','beryllium-10');
  
 % here is some code from Greg Balco for connecting to the database from a % here is some code from Greg Balco for connecting to the database from a
Line 263: Line 532:
 % dictating marker size). % dictating marker size).
  
-q1 = ['select samples.sample_name, samples.elv_m, Be10_Al26_quartz.N10_atoms_g, Be10_Al26_quartz.delN10_atoms_g, Be10_Al26_quartz.N26_atoms_g, '... +%% Query to extract all 10Be Al26 pairs from the alpine database
-' Be10_Al26_quartz.delN26_atoms_g, calculated_ages.t_LSDn '... +
-from samples, Be10_Al26_quartz, calculated_ages '... +
-' where samples.sample_name = Be10_Al26_quartz.sample_name '... +
-' and samples.sample_name = calculated_ages.sample_name '... +
-' and samples.elv_m is not null and Be10_Al26_quartz.N10_atoms_g is not null and Be10_Al26_quartz.N26_atoms_g is not null '... +
-' and Be10_Al26_quartz.N26_atoms_g > 1000 and Be10_Al26_quartz.N26_atoms_g not like 0 '];+
  
-% this will store all data in a table that we can format into cell arrays +q1 = ['select iced.base_sample.name, ' ... 
-for plotting with the following code:+' iced.base_sample.elv_m, ' ... 
 +' iced._be10_al26_quartz.N10_atoms_g, ' ... 
 +' iced._be10_al26_quartz.delN10_atoms_g, ' ... 
 +' iced._be10_al26_quartz.N26_atoms_g, ' ... 
 +' iced._be10_al26_quartz.delN26_atoms_g, ' ... 
 +' iced.base_calculatedages.t_LSDn ' ... 
 +' from iced.base_sample, iced._be10_al26_quartz, iced.base_calculatedages, iced.base_site, iced.base_application_sites ' ... 
 +' where iced.base_sample.id = iced._be10_al26_quartz.sample_id ' ... 
 +' and iced.base_sample.id = iced.base_calculatedages.sample_unique_id ' ... 
 +' AND iced.base_sample.site_id = iced.base_site.id ' ... 
 +' and iced.base_site.id = iced.base_application_sites.site_id ' ... 
 +' and iced.base_sample.elv_m is not NULL ' ... 
 +' and iced._be10_al26_quartz.N10_atoms_g is not NULL ' ... 
 +' and iced._be10_al26_quartz.N26_atoms_g is not null ' ... 
 +' and iced._be10_al26_quartz.N26_atoms_g > 1000 ' ... 
 +' and iced._be10_al26_quartz.N26_atoms_g not like 0 ' ... 
 +' and iced.base_application_sites.application_id = 2 ']; 
 + 
 +%% If you would like to try the entire database (not just the alpine database) use this query instead of the first one 
 +% Worth noting that in this query, we have not isolated the samples that 
 +% have strictly simple exposure histories so there are probably lot of 
 +% samples in the dataset that are below the simple exposure ratio line 
 + 
 +%q1 = ['select iced.base_sample.name, ' ... 
 +%' iced.base_sample.elv_m, ' ... 
 +%' iced._be10_al26_quartz.N10_atoms_g, ' ... 
 +%' iced._be10_al26_quartz.delN10_atoms_g, ' ... 
 +%' iced._be10_al26_quartz.N26_atoms_g, ' ... 
 +%' iced._be10_al26_quartz.delN26_atoms_g, ' ... 
 +%' iced.base_calculatedages.t_LSDn ' ... 
 +%' from iced.base_sample, iced._be10_al26_quartz, iced.base_calculatedages ' ... 
 +%' where iced.base_sample.id = iced._be10_al26_quartz.sample_id ' ... 
 +%' and iced.base_sample.id = iced.base_calculatedages.sample_unique_id ' ... 
 +%' and iced.base_sample.elv_m is not NULL ' ... 
 +%' and iced._be10_al26_quartz.N10_atoms_g is not NULL ' ... 
 +%' and iced._be10_al26_quartz.N26_atoms_g is not null ' ... 
 +%' and iced._be10_al26_quartz.N26_atoms_g > 1000 ' ... 
 +%' and iced._be10_al26_quartz.N26_atoms_g not like 0 ' ... 
 +% and iced.base_calculatedages.t_LSDn not like 0 ' ... 
 +%' AND iced.base_sample.name NOT LIKE "MH12-47"']; 
 + 
 +%% gather the data and organize it into cell arrays that can be used for plotting
  
 samples.table = fetch(dbc,q1); samples.table = fetch(dbc,q1);
Line 283: Line 587:
 samples.error = double((samples.cell_array(:,4)./samples.cell_array(:,2)).*(((samples.cell_array(:,3)./samples.cell_array(:,2)).^2)+((samples.cell_array(:,5)./samples.cell_array(:,4)).^2)).^0.5); samples.error = double((samples.cell_array(:,4)./samples.cell_array(:,2)).*(((samples.cell_array(:,3)./samples.cell_array(:,2)).^2)+((samples.cell_array(:,5)./samples.cell_array(:,4)).^2)).^0.5);
  
-%now time to plot it all!+%% The code to maka a figure plotting up all of the samples by elevation vs Al/Be ratio
  
 +fig1 = figure(1)
 errorbar(samples.cell_array(:,1), (samples.cell_array(:,4)./samples.cell_array(:,2)), samples.error, 'vertical', 'LineStyle','none') errorbar(samples.cell_array(:,1), (samples.cell_array(:,4)./samples.cell_array(:,2)), samples.error, 'vertical', 'LineStyle','none')
 hold on hold on
Line 291: Line 596:
     'MarkerEdgeColor',[0 0 0], 'MarkerFaceColor', [0 .7 .7], 'SizeData', (samples.cell_array(:,6)./1000),...     'MarkerEdgeColor',[0 0 0], 'MarkerFaceColor', [0 .7 .7], 'SizeData', (samples.cell_array(:,6)./1000),...
     'LineWidth', 0.5)     'LineWidth', 0.5)
 +ylim([0 15])
 xlabel('Elevation (m)','FontSize',16) xlabel('Elevation (m)','FontSize',16)
 ylabel('[Al-26] / [Be-10]','FontSize',16) ylabel('[Al-26] / [Be-10]','FontSize',16)
Line 308: Line 614:
 ---- ----
  
-**7) Heinrich Stadials aridity drives glacier retreat in the Mediterranean?**+**6) Heinrich Stadials aridity drives glacier retreat in the Mediterranean?**
 This example is a follow up to a paper recently published in Nature Geoscience ([[https://www.nature.com/articles/s41561-021-00703-6|Allard et al., 2021]]) that found that glaciers in the region may have been retreating during Heinrich Stadials due to more arid conditions.  This example is a follow up to a paper recently published in Nature Geoscience ([[https://www.nature.com/articles/s41561-021-00703-6|Allard et al., 2021]]) that found that glaciers in the region may have been retreating during Heinrich Stadials due to more arid conditions. 
  
Line 319: Line 625:
 ---- ----
  
-**8) Identifying regions of possible heavy moraine degradation** (using the moraine ages and land degradation models incorporated into the middle layer of calculations) and **comparing identified areas of high degradation to geohazards** (plate boundaries and areas of high seismic activity). +**7) Identifying regions of possible heavy moraine degradation** (using the moraine ages and land degradation models incorporated into the middle layer of calculations) and **comparing identified areas of high degradation to geohazards** (plate boundaries and areas of high seismic activity). 
 **Hypothesis:** if geohazards actually present a notable obstacle to moraine dating through moraine degradation, then we should be able to find instances of high moraine degradation coinciding with high seismic activity. **Hypothesis:** if geohazards actually present a notable obstacle to moraine dating through moraine degradation, then we should be able to find instances of high moraine degradation coinciding with high seismic activity.