publiclab / spectral-workbench Goto Github PK
View Code? Open in Web Editor NEWWeb-based tools for collecting, analyzing, and sharing data from a DIY spectrometer
Home Page: http://spectralworkbench.org
License: GNU General Public License v3.0
Web-based tools for collecting, analyzing, and sharing data from a DIY spectrometer
Home Page: http://spectralworkbench.org
License: GNU General Public License v3.0
could also use tags to refer to start:234
end:565
but this issue is mainly about the live interface to explore data. is flot good enough? D3?
D3 has this great interface: http://bl.ocks.org/mbostock/1667367
which also creates a tag link like #40
Fix for opera? http://stackoverflow.com/questions/14244357/twitter-bootstrap-dropdown-links-not-working-on-mobile
didn't work. try newer version of Bootstrap v2.x
and let people share them at spectralworkbench.org/macro/gemstones or something, or /app/foo
suggested by mr hans kok
Presently the way to download the raw image data is one at a time using the format http://spectralworkbench.org/system/photos/<id>/original/capture.png
. If the format is wrong, the filename is in the metadata for each spectrum.
If a bulk download of 60+ images is required for offline processing experiments, iterating this format will be a major strain on the server. Worse yet would be if the data wasn't downloaded, so that each experimental modification required a new download of 60+ images.
Desired is a system which will gather the raw images for a set of spectrum ids submit by the user. The backend will grab the images, compress them, and send them to the user in a single push.
For all images ever, it might be good if we back up the images to S3, DropBox, or some photo sharing site. Many external services have a bulk download button which does the process of compressing a large set of files and sending them as a single file to the user. This would certainly eliminate effort on our part.
I don't think S3 has that capability built in by default, but it will statically host files. Monthly caches could be put there, but that feels far too arbitrary.
This gizmo is small enough that it would be useful in field camps where there is no internet connectivity. Making available a RaspberryPi image that permitted "off-line" usage with possibly a locally stored database of popular exaple spectrograms would greatly improve the usefuleness of this appliance
assume this is in Analyze page, but @mkoistinen may correct me
in settings screen but also if you see nothing in your video output
Presently, if one calls http://spectralworkbench.org?format=xml
, all the spectra (possibly truncated at some arbitrary point) are returned with metadata and spetrum data.
spectral-workbench/webserver/app/controllers/spectrums_controller.rb
Lines 12 to 31 in 3902e7d
The index should contain just enough to decide which spectra to download without including the actual spectrum data. This is more friendly to front-end javascript decision making, but can also by used by offline massive processing applications.
There should be a similar call, however, which returns all the metadata and the spectral data. The concept is that the front end javascript has decided which spectra to grab, and will now make this new call to get it. So it'll also need some selectors, minimally a set of ids will suffice.
Possibly this interface could be called bulk or bulkdata.
Additionally, index and bulk should support csv and json on top of html and xml..
We should have a button that lets you choose a recent calibration, in the /capture interface. It should show an up-to-date list of recent calibrations, ajaxly in case the capture page hasn't been reloaded
We should have the button turn red when a new calibration is detected, via 10-sec AJAX polling, and display an alert that a new calibration is available with a button to use it.
after I save a set I no longer have access to the "more tools" pallette. I'd like to create a set adn then equalize the area underneath the spectra for purposes of comparison. To do that I have to re-build the set, adding in each of the spectra again.
I wish I could just apply transforms to saved sets.
Deprecated session secret setting
Previously, session secret was set directly on ActionController::Base; it's now config.secret_token.
More information: http://lindsaar.net/2010/4/7/rails_3_session_secret_and_session_store
The culprits:
- config/initializers/session_store.rb
Deprecated test_help path
You now must require 'rails/test_help' not just 'test_help'.
More information: http://weblog.rubyonrails.org/2009/9/1/gem-packaging-best-practices
The culprits:
- test/test_helper.rb
Soon-to-be-deprecated ActiveRecord calls
Methods such as find(:all), find(:first), finds with conditions, and the :joins option will soon be deprecated.
More information: http://m.onkey.org/2010/1/22/active-record-query-interface
The culprits:
- app/models/processed_spectrum.rb
- app/models/spectrum.rb
- app/controllers/spectrums_controller.rb
- app/models/processed_spectrum.rb
- app/models/spectrum.rb
- app/models/user.rb
- app/controllers/spectrums_controller.rb
- app/controllers/likes_controller.rb
Deprecated ActionMailer API
You're using the old ActionMailer API to send e-mails in a controller, model, or observer.
More information: http://lindsaar.net/2010/1/26/new-actionmailer-api-in-rails-3
The culprits:
- app/models/spectrum.rb
- app/models/spectra_set.rb
- app/models/user.rb
- app/controllers/users_controller.rb
- app/controllers/sets_controller.rb
- app/controllers/comments_controller.rb
Old ActionMailer class API
You're using the old API in a mailer class.
More information: http://lindsaar.net/2010/1/26/new-actionmailer-api-in-rails-3
The culprits:
- app/models/user_mailer.rb
- app/models/user_mailer.rb
The current version of Spectralworkbench is hard-coded to display reflectance spectra between 250 and 800nm. Since the webcam is sensitive past 800nm, could you add functionality in the UI to extend this display to spectra beyond 800nm (say 850nm or so)?
Thanks! -david mccloskey
this involves making the differences between logged-in and non-logged-in interfaces solely javascript-based; no erb template conditionals. And a $W.analyze.toggleLoggedIn()
call to switch them over. Maybe .logged-in
and .logged-out
classes?
Since migrating to rails 3 and ditching our previous authentication library, user unit testing is failing pretty hard. Run rake test
to try it out.
This should be possible via XML/JSON pretty easily.
offer to upload when reconnected. @Sreyanth - I remember you had some part of this working, right?
The CSV download of a spectrum is two (unlabeled) columns. I presume this is only the spectral data.
For JSON, XML, and HTML, the full set of metadata and data is included.
One issue that needs to be addressed is that the spectral data is always returned as embedded JSON (e.g. in XML it is <data>{ json stuff }</data>
).
The current format returned by the CSV is a good start towards demuxing the JSON into CSV, but we need to append/prepend the rest of the metadata as well as provide column names.
Addendum by @jywarren: include FWHM values in CSV; details in jywarren#137
Because open data and portability are good things(TM), we probably want to support open standards for this sort of data. The custom exports that currently exist certainly work, but might not be as portable or as easy to work with as open standards.
We might want to export some small amount of metadata regarding ownership and licensing for each spectra which I don't think is part of any standard.
@Fastie sez:
I just hit a spell when I couldn't "set sample row" and got the "Something went wrong." I tried many times on two different spectra and tried re-extracting from photo without success. I think things started working again when I tried "Detect brightest row." Afterwards, everything was fine. The offending spectra were http://spectralworkbench.org/analyze/spectrum/4514 and 4515
we experienced briefly (and undocumented) a problem when using a flipped spectra in the capture interface for calibration.
we were also were unable to get the capture spectra to calibrate
@Fastie sez:
Spectra calibrated with a macro ($w.calibrate(...)) never show up as a choice for calibrating while uploading or from the analyze page. This means that it is not possible to use some well-calibrated spectra for calibration. The macro feature offers a workaround, but it would be nice to calibrate on upload using a spectrum carefully calibrated with a macro.
building on @Sreyanth's work
I have attached two screenshots from my Galaxy Note 3 smartphone. I am using the smartphone DIY instructions and the back facing camera. I found first that the online spectralworkbench utility does not work with both Chrome (back facing camera only displays 'black' with nothing covering camera!) and Opera. I can only use it properly with current Firefox. The screenshots come from the DIY spec/smartphone pointed at a perfectly white display on a 12" tablet. Why when I perform the capture does NOTHING SHOW UP! I have also tried to point it at a compact fluorescent, but same thing happens. What am I doing wrong?
Thank you,
Jason
This is a complex UI question as well as a technical/hardware one.
We have a terminology collision here; extraction in spectroscopy can refer to extracting something from a sample with solvents. But what I mean here is a means, like Infragrammar (http://publiclab.org/wiki/infragrammar), to specify how data should be taken from an image.
Another collision is "recipes" -- here I mean like a parseable expression, but in #64 "recipes" refers to something different; the steps in an experimental method. The feature in this issue needs renaming.
This could include start/end pixels for a cross section, whether to take the average or sum of the pixel color values, etc.
The recipe might be stored as a tag, such as start:151,355
, end:454,1266
and rgb:average
or rgb:sum
presumably we'd have to enforce certain rules for namespaces like rgb: or start: -- maybe most recent wins; also, when you add such tags, it should enter the changes in a log
$("#placeholder").bind("plotclick", function (event, pos, item) {
alert("You clicked at " + pos.x + ", " + pos.y);
// axis coordinates for other axes, if present, are in pos.x2, pos.x3, ...
// if you need global screen coordinates, they are pos.pageX, pos.pageY
if (item) {
highlight(item.series, item.datapoint);
alert("You clicked a point!");
}
});
Needs some thought on user interface
see examples on dashboard
also, reverse order of sets on profile
Perhaps based on http://codemirror.net/
This needs much UI design work. Big project.
I'm not sure why I have to re-calibrate after I select a new sample row. is this a bug?
@feranick sez:
Currently wavenumbers and wavelength are used as units. Sometimes eV are needed as well as a unit. It would be great to have that as an option for the x axis; the conversion is: eV = 1239.82/wavelength
Great discussion on this by @keflavich here: jywarren#132
For the life of me, I cannot get SpectralWorkbench to subtract a baseline spectrum. Was this feature removed? I am using the latest version of FireFox on a PC.
subtract-from:<id>
and calibrated-from:<id>
Clicking on such tags would go to the source, not a listing of that tag.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.