publiclab/spectral-workbench

View on GitHub
app/views/spectrums/_sidebar.html.erb

Summary

Maintainability
Test Coverage
<div class="sidebar">
    <div class="box search">
        <form action="/spectra/search" method='get'>
            <input class='text' type='text' name='q' value='<%= params[:id] %>'/>
            <input type='submit' value='search' />
        </form>
    </div>

    <div class="box">
        <h2>Buy a spectrometer kit</h2>
        <% if !APP_CONFIG["local"] %>
        <!--<p><a href="http://shop.breadpig.com/collections/publiclaboratory/products/desktop-spectrometry-kit"><img style="margin-left:3px;border:3px solid #999;" src="http://publiclaboratory.org/images/bkit-widget-small.png" /></a>-->
        </p>
        <% end %>
        <p>And an <a href="http://publiclaboratory.org/sites/default/files/PLOTS%20DIY%20Spectrometer%20Guide%20v1.0.pdf">illustrated guide</a>. Or, <a href="http://publiclab.org/wiki/video-spectrometer-construction">learn how to make one yourself</a> as part of an open-source research effort of the <a href="http://publiclaboratory.org">Public Laboratory</a> community.</p>
    </div>

    <div class="box">
        <h2>What is spectrometry?</h2>

        <p>Spectrometry can reveal the composition of unknown materials -- either from samples you take from a site, or (with more difficulty) from a distance. It is used by NASA to identify substances on other planets. Typically, full-spectrum light (such as the sun) shines through a thin slice of the sample, which filters (absorbs) certain colors and allows others to pass through. This light can be split up by color using a prism, and the missing (absorbed) colors can be identified. Finally, the brightness of all the colors is compared to a database of known samples to find a match.</p>
        <p>Things can get more complicated, as when there are multiple substances in a sample, or when a substance is dissolved in water. Spectrometry is a broad and complex field, but some simple techniques have been successfully used in the field -- such as identifying Poly-Aromatic Hydrocarbons (PAHs, a common contaminant from oil) by shining strong UV light through a sample, and measuring what colors it fluoresces. You can read more about the kinds of spectrometry we're attempting <a href="http://publiclaboratory.org/tool/spectrometer">on the PLOTS website.</a></p>
    </div>

    <div class="box">
        <h2>Recent comments</h2>

        <% @comments.each do |comment| %>
            <p><b><%= time_ago_in_words(comment.created_at) %> ago, <%= comment.author %> wrote:</b>
            <%= sanitize(truncate(comment.body,40,"...")) %> <br /><a href="/spectra/show/<%= comment.spectrum_id %>">Read more &raquo;</a></p>
            <% if logged_in? && current_user.role == "admin" %><p><a href="/comments/delete/<%= comment.id %>">Delete</a></p><% end %>
        <% end %>

    </div>

</div>