Spectral Workbench 2.0 API The Spectral Workbench 2 API is very different from the v1 API. It is...
Public Lab is an open community which collaboratively develops accessible, open source, Do-It-Yourself technologies for investigating local environmental health and justice issues.
47 CURRENT | warren |
December 07, 2017 21:36
| about 7 years ago
Spectral Workbench 2.0 APIThe Spectral Workbench 2 API is very different from the v1 API. It is structured around a series of JavaScript classes. These are reasonably well documented with inline comments in the source code, but we'll summarize the overall structure and major points here: Core classes
API classes
UI classes
REST API methodsThere is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. UIToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro (from the legacy 1.0 API) can be found here: https://gist.github.com/jywarren/4945996 UnitsUnits are not a class, but data is passed around in a variety of contexts, and it's useful to know exactly what's being referred to. Data space is space as defined within the stored data, in JSON format. It is typically measured in units of nanometer wavelengths, but in uncalibrated spectra, this may not be available. Data is also made up of a series of points, which is almost certain to correspond to pixels in the original image, since that is where they are generated from. This means that there should be an equal number of points to the pixel width of the spectrum source image. Pixels, and therefore points, should be assumed to be equally spaced. Note that the complete data space may not be displayed due to wavelength range limits set via tagging. Image space is space measured in pixels in the original source image of the spectrum. This may not match what is displayed on a given page, as images may be scaled to fit the interface or graph. Note that the complete image space may not be displayed due to wavelength range limits set via tagging. Display space is space measured as displayed on the screen. The graph and displayed image should be of equal pixel dimensions. Display space may not map directly to data or image space, as it only displays what is not masked out due to wavelength rage limits set via tagging. ConversionsFor example, to convert an x-coordinate
Uploading dataSpectral Workbench allows for upload of numerical spectral data in JSON or CSV formats. The CSV format accepted is 400,24 410,44 420,42 430,45 440,20 Note that it requires commas; if you need to change from spaces to commas, or otherwise tweak your format, see this note by @dhaffnersr. The JSON format accepted is as follows: [ { "average": 64.3, "r": 69, "g": 46, "b": 78, "wavelength": 269.0 }, { "average": 35.5, "r": 33, "g": 19, "b": 41, "wavelength": 432.2 }, { "average": 31.2, "r": 33, "g": 19, "b": 41, "wavelength": 958.5 } ] 1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
46 | warren |
April 27, 2016 17:08
| over 8 years ago
Spectral Workbench 2.0 APIThe Spectral Workbench 2 API is very different from the v1 API. It is structured around a series of JavaScript classes. These are reasonably well documented with inline comments in the source code, but we'll summarize the overall structure and major points here: Core classes
API classes
UI classes
REST API methodsThere is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. UIToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro (from the legacy 1.0 API) can be found here: https://gist.github.com/jywarren/4945996 UnitsUnits are not a class, but data is passed around in a variety of contexts, and it's useful to know exactly what's being referred to. Data space is space as defined within the stored data, in JSON format. It is typically measured in units of nanometer wavelengths, but in uncalibrated spectra, this may not be available. Data is also made up of a series of points, which is almost certain to correspond to pixels in the original image, since that is where they are generated from. This means that there should be an equal number of points to the pixel width of the spectrum source image. Pixels, and therefore points, should be assumed to be equally spaced. Note that the complete data space may not be displayed due to wavelength range limits set via tagging. Image space is space measured in pixels in the original source image of the spectrum. This may not match what is displayed on a given page, as images may be scaled to fit the interface or graph. Note that the complete image space may not be displayed due to wavelength range limits set via tagging. Display space is space measured as displayed on the screen. The graph and displayed image should be of equal pixel dimensions. Display space may not map directly to data or image space, as it only displays what is not masked out due to wavelength rage limits set via tagging. ConversionsFor example, to convert an x-coordinate
Uploading dataSpectral Workbench allows for upload of numerical spectral data in JSON or CSV formats. The CSV format accepted is 400,24 410,44 420,42 430,45 440,20 Note that it requires commas; if you need to change from spaces to commas, or otherwise tweak your format, see this note by @dhaffnersr. The JSON format accepted is as follows: [ { "average": 64.3, "r": 69, "g": 46, "b": 78, "wavelength": 269.0 }, { "average": 35.5, "r": 33, "g": 19, "b": 41, "wavelength": 432.2 }, { "average": 31.2, "r": 33, "g": 19, "b": 41, "wavelength": 958.5 } ] 1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
45 | warren |
April 16, 2016 19:10
| almost 9 years ago
Spectral Workbench 2.0 APIThe Spectral Workbench 2 API is very different from the v1 API. It is structured around a series of JavaScript classes. These are reasonably well documented with inline comments in the source code, but we'll summarize the overall structure and major points here: Core classes
API classes
UI classes
REST API methodsThere is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. UIToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro (from the legacy 1.0 API) can be found here: https://gist.github.com/jywarren/4945996 UnitsUnits are not a class, but data is passed around in a variety of contexts, and it's useful to know exactly what's being referred to. Data space is space as defined within the stored data, in JSON format. It is typically measured in units of nanometer wavelengths, but in uncalibrated spectra, this may not be available. Data is also made up of a series of points, which is almost certain to correspond to pixels in the original image, since that is where they are generated from. This means that there should be an equal number of points to the pixel width of the spectrum source image. Pixels, and therefore points, should be assumed to be equally spaced. Note that the complete data space may not be displayed due to wavelength range limits set via tagging. Image space is space measured in pixels in the original source image of the spectrum. This may not match what is displayed on a given page, as images may be scaled to fit the interface or graph. Note that the complete image space may not be displayed due to wavelength range limits set via tagging. Display space is space measured as displayed on the screen. The graph and displayed image should be of equal pixel dimensions. Display space may not map directly to data or image space, as it only displays what is not masked out due to wavelength rage limits set via tagging. ConversionsFor example, to convert an x-coordinate
Uploading dataSpectral Workbench allows for upload of numerical spectral data in JSON or CSV formats. The CSV format accepted is 400,24 410,44 420,42 430,45 440,20 The JSON format accepted is as follows: [ { "average": 64.3, "r": 69, "g": 46, "b": 78, "wavelength": 269.0 }, { "average": 35.5, "r": 33, "g": 19, "b": 41, "wavelength": 432.2 }, { "average": 31.2, "r": 33, "g": 19, "b": 41, "wavelength": 958.5 } ] 1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
44 | warren |
April 16, 2016 19:05
| almost 9 years ago
Spectral Workbench 2.0 APIThe Spectral Workbench 2 API is very different from the v1 API. It is structured around a series of JavaScript classes. These are reasonably well documented with inline comments in the source code, but we'll summarize the overall structure and major points here: Core classes
API classes
UI classes
REST API methodsThere is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. UIToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro (from the legacy 1.0 API) can be found here: https://gist.github.com/jywarren/4945996 UnitsUnits are not a class, but data is passed around in a variety of contexts, and it's useful to know exactly what's being referred to. Data space is space as defined within the stored data, in JSON format. It is typically measured in units of nanometer wavelengths, but in uncalibrated spectra, this may not be available. Data is also made up of a series of points, which is almost certain to correspond to pixels in the original image, since that is where they are generated from. This means that there should be an equal number of points to the pixel width of the spectrum source image. Pixels, and therefore points, should be assumed to be equally spaced. Note that the complete data space may not be displayed due to wavelength range limits set via tagging. Image space is space measured in pixels in the original source image of the spectrum. This may not match what is displayed on a given page, as images may be scaled to fit the interface or graph. Note that the complete image space may not be displayed due to wavelength range limits set via tagging. Display space is space measured as displayed on the screen. The graph and displayed image should be of equal pixel dimensions. Display space may not map directly to data or image space, as it only displays what is not masked out due to wavelength rage limits set via tagging. ConversionsFor example, to convert an x-coordinate
Uploading dataSpectral Workbench allows for upload of numerical spectral data in JSON or CSV formats. The CSV format accepted is
The JSON format accepted is as follows:
1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
43 | warren |
April 16, 2016 19:00
| almost 9 years ago
Spectral Workbench 2.0 APIThe Spectral Workbench 2 API is very different from the v1 API. It is structured around a series of JavaScript classes. These are reasonably well documented with inline comments in the source code, but we'll summarize the overall structure and major points here: Core classes
API classes
UI classes
REST API methodsThere is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. UIToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro (from the legacy 1.0 API) can be found here: https://gist.github.com/jywarren/4945996 UnitsUnits are not a class, but data is passed around in a variety of contexts, and it's useful to know exactly what's being referred to. Data space is space as defined within the stored data, in JSON format. It is typically measured in units of nanometer wavelengths, but in uncalibrated spectra, this may not be available. Data is also made up of a series of points, which is almost certain to correspond to pixels in the original image, since that is where they are generated from. This means that there should be an equal number of points to the pixel width of the spectrum source image. Pixels, and therefore points, should be assumed to be equally spaced. Note that the complete data space may not be displayed due to wavelength range limits set via tagging. Image space is space measured in pixels in the original source image of the spectrum. This may not match what is displayed on a given page, as images may be scaled to fit the interface or graph. Note that the complete image space may not be displayed due to wavelength range limits set via tagging. Display space is space measured as displayed on the screen. The graph and displayed image should be of equal pixel dimensions. Display space may not map directly to data or image space, as it only displays what is not masked out due to wavelength rage limits set via tagging. ConversionsFor example, to convert an x-coordinate
Uploading dataSpectral Workbench allows for upload of numerical spectral data in JSON or CSV formats. The CSV format accepted is
The JSON format accepted is as follows:
1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
42 | warren |
April 16, 2016 18:37
| almost 9 years ago
Spectral Workbench 2.0 APIThe Spectral Workbench 2 API is very different from the v1 API. It is structured around a series of JavaScript classes. These are reasonably well documented with inline comments in the source code, but we'll summarize the overall structure and major points here: Core classes
API classes
UI classes
REST API methodsThere is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. UIToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro (from the legacy 1.0 API) can be found here: https://gist.github.com/jywarren/4945996 UnitsUnits are not a class, but data is passed around in a variety of contexts, and it's useful to know exactly what's being referred to. Data space is space as defined within the stored data, in JSON format. It is typically measured in units of nanometer wavelengths, but in uncalibrated spectra, this may not be available. Data is also made up of a series of points, which is almost certain to correspond to pixels in the original image, since that is where they are generated from. This means that there should be an equal number of points to the pixel width of the spectrum source image. Pixels, and therefore points, should be assumed to be equally spaced. Note that the complete data space may not be displayed due to wavelength range limits set via tagging. Image space is space measured in pixels in the original source image of the spectrum. This may not match what is displayed on a given page, as images may be scaled to fit the interface or graph. Note that the complete image space may not be displayed due to wavelength range limits set via tagging. Display space is space measured as displayed on the screen. The graph and displayed image should be of equal pixel dimensions. Display space may not map directly to data or image space, as it only displays what is not masked out due to wavelength rage limits set via tagging. ConversionsFor example, to convert an x-coordinate
Uploading dataSpectral Workbench allows for upload of numerical spectral data in JSON or CSV formats. The CSV format accepted is
The JSON format accepted is as follows:
1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
41 | warren |
April 11, 2016 18:19
| almost 9 years ago
Spectral Workbench 2.0 APIThe Spectral Workbench 2 API is very different from the v1 API. It is structured around a series of JavaScript classes. These are reasonably well documented with inline comments in the source code, but we'll summarize the overall structure and major points here: Core classes
API classes
UI classes
REST API methodsThere is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. UIToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro (from the legacy 1.0 API) can be found here: https://gist.github.com/jywarren/4945996 UnitsUnits are not a class, but data is passed around in a variety of contexts, and it's useful to know exactly what's being referred to. Data space is space as defined within the stored data, in JSON format. It is typically measured in units of nanometer wavelengths, but in uncalibrated spectra, this may not be available. Data is also made up of a series of points, which is almost certain to correspond to pixels in the original image, since that is where they are generated from. This means that there should be an equal number of points to the pixel width of the spectrum source image. Pixels, and therefore points, should be assumed to be equally spaced. Note that the complete data space may not be displayed due to wavelength range limits set via tagging. Image space is space measured in pixels in the original source image of the spectrum. This may not match what is displayed on a given page, as images may be scaled to fit the interface or graph. Note that the complete image space may not be displayed due to wavelength range limits set via tagging. Display space is space measured as displayed on the screen. The graph and displayed image should be of equal pixel dimensions. Display space may not map directly to data or image space, as it only displays what is not masked out due to wavelength rage limits set via tagging. ConversionsFor example, to convert an x-coordinate
Uploading dataSpectral Workbench allows for upload of numerical spectral data in JSON format. The format accepted is as follows:
1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
40 | warren |
April 11, 2016 18:01
| almost 9 years ago
Spectral Workbench 2.0 APIThe Spectral Workbench 2 API is very different from the v1 API. It is structured around a series of JavaScript classes. These are reasonably well documented with inline comments in the source code, but we'll summarize the overall structure and major points here: Core classes
API classes
UI classes
REST API methodsThere is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. UIToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro (from the legacy 1.0 API) can be found here: https://gist.github.com/jywarren/4945996 UnitsUnits are not a class, but data is passed around in a variety of contexts, and it's useful to know exactly what's being referred to. Data space is space as defined within the stored data, in JSON format. It is typically measured in units of nanometer wavelengths, but in uncalibrated spectra, this may not be available. Data is also made up of a series of points, which is almost certain to correspond to pixels in the original image, since that is where they are generated from. This means that there should be an equal number of points to the pixel width of the spectrum source image. Pixels, and therefore points, should be assumed to be equally spaced. Note that the complete data space may not be displayed due to wavelength range limits set via tagging. Image space is space measured in pixels in the original source image of the spectrum. This may not match what is displayed on a given page, as images may be scaled to fit the interface or graph. Note that the complete image space may not be displayed due to wavelength range limits set via tagging. Display space is space measured as displayed on the screen. The graph and displayed image should be of equal pixel dimensions. Display space may not map directly to data or image space, as it only displays what is not masked out due to wavelength rage limits set via tagging. ConversionsFor example, to convert an x-coordinate
Uploading dataSpectral Workbench allows for upload of numerical spectral data in JSON format. The format accepted is as follows:
1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
39 | warren |
April 11, 2016 17:53
| almost 9 years ago
Spectral Workbench 2.0 APIThe Spectral Workbench 2 API is very different from the v1 API. It is structured around a series of JavaScript classes. These are reasonably well documented with inline comments in the source code, but we'll summarize the overall structure and major points here: Core classes
API classes
UI classes
REST API methodsThere is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. UIToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro (from the legacy 1.0 API) can be found here: https://gist.github.com/jywarren/4945996 UnitsUnits are not a class, but data is passed around in a variety of contexts, and it's useful to know exactly what's being referred to. Data space is space as defined within the stored data, in JSON format. It is typically measured in units of nanometer wavelengths, but in uncalibrated spectra, this may not be available. Data is also made up of a series of points, which is almost certain to correspond to pixels in the original image, since that is where they are generated from. This means that there should be an equal number of points to the pixel width of the spectrum source image. Pixels, and therefore points, should be assumed to be equally spaced. Note that the complete data space may not be displayed due to wavelength range limits set via tagging. Image space is space measured in pixels in the original source image of the spectrum. This may not match what is displayed on a given page, as images may be scaled to fit the interface or graph. Note that the complete image space may not be displayed due to wavelength range limits set via tagging. Display space is space measured as displayed on the screen. The graph and displayed image should be of equal pixel dimensions. Display space may not map directly to data or image space, as it only displays what is not masked out due to wavelength rage limits set via tagging. ConversionsFor example, to convert an x-coordinate
Uploading dataSpectral Workbench allows for upload of numerical spectral data in JSON format. The format accepted is as follows:
1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
38 | warren |
April 11, 2016 17:52
| almost 9 years ago
Spectral Workbench 2.0 APIThe Spectral Workbench 2 API is very different from the v1 API. It is structured around a series of JavaScript classes. These are reasonably well documented with inline comments in the source code, but we'll summarize the overall structure and major points here: Core classes
API classes
UI classes
REST API methodsThere is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. UIToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro (from the legacy 1.0 API) can be found here: https://gist.github.com/jywarren/4945996 UnitsUnits are not a class, but data is passed around in a variety of contexts, and it's useful to know exactly what's being referred to. Data space is space as defined within the stored data, in JSON format. It is typically measured in units of nanometer wavelengths, but in uncalibrated spectra, this may not be available. Data is also made up of a series of points, which is almost certain to correspond to pixels in the original image, since that is where they are generated from. This means that there should be an equal number of points to the pixel width of the spectrum source image. Pixels, and therefore points, should be assumed to be equally spaced. Note that the complete data space may not be displayed due to wavelength range limits set via tagging. Image space is space measured in pixels in the original source image of the spectrum. This may not match what is displayed on a given page, as images may be scaled to fit the interface or graph. Note that the complete image space may not be displayed due to wavelength range limits set via tagging. Display space is space measured as displayed on the screen. The graph and displayed image should be of equal pixel dimensions. Display space may not map directly to data or image space, as it only displays what is not masked out due to wavelength rage limits set via tagging. ConversionsFor example, to convert an x-coordinate
Uploading dataSpectral Workbench allows for upload of numerical spectral data in JSON format. The format accepted is as follows:
1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
37 | warren |
April 11, 2016 17:51
| almost 9 years ago
Spectral Workbench 2.0 APIThe Spectral Workbench 2 API is very different from the v1 API. It is structured around a series of JavaScript classes. These are reasonably well documented with inline comments in the source code, but we'll summarize the overall structure and major points here: Core classes
API classes
UI classes
REST API methodsThere is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. UIToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro (from the legacy 1.0 API) can be found here: https://gist.github.com/jywarren/4945996 UnitsUnits are not a class, but data is passed around in a variety of contexts, and it's useful to know exactly what's being referred to. Data space is space as defined within the stored data, in JSON format. It is typically measured in units of nanometer wavelengths, but in uncalibrated spectra, this may not be available. Data is also made up of a series of points, which is almost certain to correspond to pixels in the original image, since that is where they are generated from. This means that there should be an equal number of points to the pixel width of the spectrum source image. Pixels, and therefore points, should be assumed to be equally spaced. Note that the complete data space may not be displayed due to wavelength range limits set via tagging. Image space is space measured in pixels in the original source image of the spectrum. This may not match what is displayed on a given page, as images may be scaled to fit the interface or graph. Note that the complete image space may not be displayed due to wavelength range limits set via tagging. Display space is space measured as displayed on the screen. The graph and displayed image should be of equal pixel dimensions. Display space may not map directly to data or image space, as it only displays what is not masked out due to wavelength rage limits set via tagging. ConversionsFor example, to convert an x-coordinate
1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
36 | warren |
January 27, 2016 15:28
| almost 9 years ago
Spectral Workbench 2.0 API(under construction) The Spectral Workbench 2 (link to introduction post) API is very different from the v1 API. It is structured around a series of JavaScript classes. These are reasonably well documented with inline comments in the source code, but we'll summarize the overall structure and major points here: Core classes
API classes
UI classes
REST API methodsThere is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. UIToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro (from the legacy 1.0 API) can be found here: https://gist.github.com/jywarren/4945996 UnitsUnits are not a class, but data is passed around in a variety of contexts, and it's useful to know exactly what's being referred to. Data space is space as defined within the stored data, in JSON format. It is typically measured in units of nanometer wavelengths, but in uncalibrated spectra, this may not be available. Data is also made up of a series of points, which is almost certain to correspond to pixels in the original image, since that is where they are generated from. This means that there should be an equal number of points to the pixel width of the spectrum source image. Pixels, and therefore points, should be assumed to be equally spaced. Note that the complete data space may not be displayed due to wavelength range limits set via tagging. Image space is space measured in pixels in the original source image of the spectrum. This may not match what is displayed on a given page, as images may be scaled to fit the interface or graph. Note that the complete image space may not be displayed due to wavelength range limits set via tagging. Display space is space measured as displayed on the screen. The graph and displayed image should be of equal pixel dimensions. Display space may not map directly to data or image space, as it only displays what is not masked out due to wavelength rage limits set via tagging. ConversionsFor example, to convert an x-coordinate
1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
35 | warren |
January 27, 2016 15:28
| almost 9 years ago
Spectral Workbench 2.0 API(under construction) The Spectral Workbench 2 (link to introduction post) API is very different from the v1 API. It is structured around a series of JavaScript classes. These are reasonably well documented with inline comments in the source code, but we'll summarize the overall structure and major points here: Core classes
API classes
UI classes
REST API methodsThere is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. UIToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro (from the legacy 1.0 API) can be found here: https://gist.github.com/jywarren/4945996 UnitsUnits are not a class, but data is passed around in a variety of contexts, and it's useful to know exactly what's being referred to. Data space is space as defined within the stored data, in JSON format. It is typically measured in units of nanometer wavelengths, but in uncalibrated spectra, this may not be available. Data is also made up of a series of points, which is almost certain to correspond to pixels in the original image, since that is where they are generated from. This means that there should be an equal number of points to the pixel width of the spectrum source image. Pixels, and therefore points, should be assumed to be equally spaced. Note that the complete data space may not be displayed due to wavelength range limits set via tagging. Image space is space measured in pixels in the original source image of the spectrum. This may not match what is displayed on a given page, as images may be scaled to fit the interface or graph. Note that the complete image space may not be displayed due to wavelength range limits set via tagging. Display space is space measured as displayed on the screen. The graph and displayed image should be of equal pixel dimensions. Display space may not map directly to data or image space, as it only displays what is not masked out due to wavelength rage limits set via tagging. ConversionsFor example, to convert an x-coordinate
1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
34 | warren |
January 27, 2016 15:24
| almost 9 years ago
Spectral Workbench 2.0 API(under construction) The Spectral Workbench 2 API is very different from the v1 API. It is structured around a series of JavaScript classes. These are reasonably well documented with inline comments in the source code, but we'll summarize the overall structure and major points here: Core classes
API classes
UI classes
REST API methodsThere is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. UIToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro (from the legacy 1.0 API) can be found here: https://gist.github.com/jywarren/4945996 UnitsUnits are not a class, but data is passed around in a variety of contexts, and it's useful to know exactly what's being referred to. Data space is space as defined within the stored data, in JSON format. It is typically measured in units of nanometer wavelengths, but in uncalibrated spectra, this may not be available. Data is also made up of a series of points, which is almost certain to correspond to pixels in the original image, since that is where they are generated from. This means that there should be an equal number of points to the pixel width of the spectrum source image. Pixels, and therefore points, should be assumed to be equally spaced. Note that the complete data space may not be displayed due to wavelength range limits set via tagging. Image space is space measured in pixels in the original source image of the spectrum. This may not match what is displayed on a given page, as images may be scaled to fit the interface or graph. Note that the complete image space may not be displayed due to wavelength range limits set via tagging. Display space is space measured as displayed on the screen. The graph and displayed image should be of equal pixel dimensions. Display space may not map directly to data or image space, as it only displays what is not masked out due to wavelength rage limits set via tagging. ConversionsFor example, to convert an x-coordinate
1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
33 | warren |
January 27, 2016 15:13
| almost 9 years ago
2.0 API(under construction) The Spectral Workbench 2 API is very different from the v1 API. It is structured around a series of JavaScript classes: Core classes
API classes
UI classes
There is also a REST API for accessing data in various formats programmatically. GraphA Graph is the basic display unit of Spectral Workbench, including at minimum a graph of some data, means to display, resize, refresh, and format the display, and perform unit conversions on that data. The Graph class is used in both spectrum and set display, and wraps a d3 line graph, using the NVD3 chart generator. View commented code for more detail. DatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. View commented code for more detail. SpectrumView commented code for more detail. SetView commented code for more detail. ImageAs Spectral Workbench uses an image from your spectrometer, the Image class manages the display of the image alongside the Graph class, when viewing individual spectra. Much of this class relates to the resizing and display of the spectrum image for spectra with wavelength range limits, as the image is kept aligned with the graph data as much as possible. View commented code for more detail. TagTagging is used to categorize and describe spectra, and to make them easier to search. View commented code for more detail. PowerTagPowerTags, now known as Operations, are a type of tag used to manipulate spectral data in a reversible way. Operations are displayed to the right side of the screen in a separate area, and ordered by timestamp. Operations typically generate Snapshots of data, which are a flat copy of the spectrum's data after all Operations up to the current one have been run. View commented code for more detail. APIThe API class has three main components, the Core API, Operations, and the Legacy API. CoreCommonly used/useful API methods. View commented code for more detail. OperationsCode for individual operations that may be applied to spectra, in standardized format. As opposed to PowerTag, the class that defines common behaviors for all operations. View commented code for more detail. ToolPaneView commented code for more detail. ToolPaneTypesView commented code for more detail. REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro can be found here: https://gist.github.com/jywarren/4945996 1.0 APIThe v1.0 Spectral Workbench API has been deprecated; its documentation has been archived here: https://publiclab.org/wiki/spectral-workbench-api-v1 |
Revert | |
32 | warren |
January 21, 2016 17:30
| about 9 years ago
This is a planning page for the in-development Spectral Workbench API. PurposeThe API (starting with the macro system, below) will make it possible for anyone to develop new functions, like:
MacrosWe're building a simple API so people can write macros without a lot of fuss. There are 2 places to use macros - in the "Analyze" interface and in the "Capture" interface. The former is for performing operations on existing data, the latter for manipulating data while actually using your spectrometer. Both use the same library and have access to many (but not all) of the same functions. A simple macro saving and sharing system is now live at: https://spectralworkbench.org/macros Getting startedTo create a macro we have a simple editor you can enter JavaScript code into. The basic template (copy paste this and build on it!) is like this:
If you are already logged into Spectral Workbench, you can begin by clicking here: https://spectralworkbench.org/macros/new A very simple command to run in the macro console (works as of Oct 14 2012) would be:
Which opens a new tab with the current image data as a PNG. For now, you can use any of the below variables and methods in a Javascript console such as found in Chrome, Safari, or Firebug on Firefox. Variables and methodsA range of variables and methods will be available to use in your macros. To start with, you can read through the existing framework here: https://github.com/jywarren/spectral-workbench/blob/master/webserver/public/javascripts/capture.js
Saving client-side processed dataYou should also be able to manipulate the JSON representation of data on the client side and save it to the server using the following URL format:
where
Upcoming variables and methods
ExamplesPlease add your own if you like: Saving image data offline REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro can be found here: https://gist.github.com/jywarren/4945996 2.0 API(under construction) The Spectral Workbench 2.0 API is very different from the v1.0 API. It is structured around a series of JavaScript classes: GraphDatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. SpectrumSetImageTagAPIToolPane |
Revert | |
31 | warren |
September 18, 2015 15:16
| over 9 years ago
This is a planning page for the in-development Spectral Workbench API. PurposeThe API (starting with the macro system, below) will make it possible for anyone to develop new functions, like:
MacrosWe're building a simple API so people can write macros without a lot of fuss. There are 2 places to use macros - in the "Analyze" interface and in the "Capture" interface. The former is for performing operations on existing data, the latter for manipulating data while actually using your spectrometer. Both use the same library and have access to many (but not all) of the same functions. A simple macro saving and sharing system is now live at: https://spectralworkbench.org/macros Getting startedTo create a macro we have a simple editor you can enter JavaScript code into. The basic template (copy paste this and build on it!) is like this:
If you are already logged into Spectral Workbench, you can begin by clicking here: https://spectralworkbench.org/macros/new A very simple command to run in the macro console (works as of Oct 14 2012) would be:
Which opens a new tab with the current image data as a PNG. For now, you can use any of the below variables and methods in a Javascript console such as found in Chrome, Safari, or Firebug on Firefox. Variables and methodsA range of variables and methods will be available to use in your macros. To start with, you can read through the existing framework here: https://github.com/jywarren/spectral-workbench/blob/master/webserver/public/javascripts/capture.js
Saving client-side processed dataYou should also be able to manipulate the JSON representation of data on the client side and save it to the server using the following URL format:
where
Upcoming variables and methods
ExamplesPlease add your own if you like: Saving image data offline REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro can be found here: https://gist.github.com/jywarren/4945996 2.0 API(under construction) The Spectral Workbench 2.0 API is very different from the v1.0 API. It is structured around a series of JavaScript classes: GraphDatumA Datum comes in two types, Spectrums and Sets. These share a number of methods, properties and behaviors. SpectrumSetImageTagAPIToolPane |
Revert | |
30 | warren |
July 06, 2015 14:23
| over 9 years ago
This is a planning page for the in-development Spectral Workbench API. PurposeThe API (starting with the macro system, below) will make it possible for anyone to develop new functions, like:
MacrosWe're building a simple API so people can write macros without a lot of fuss. There are 2 places to use macros - in the "Analyze" interface and in the "Capture" interface. The former is for performing operations on existing data, the latter for manipulating data while actually using your spectrometer. Both use the same library and have access to many (but not all) of the same functions. A simple macro saving and sharing system is now live at: https://spectralworkbench.org/macros Getting startedTo create a macro we have a simple editor you can enter JavaScript code into. The basic template (copy paste this and build on it!) is like this:
If you are already logged into Spectral Workbench, you can begin by clicking here: https://spectralworkbench.org/macros/new A very simple command to run in the macro console (works as of Oct 14 2012) would be:
Which opens a new tab with the current image data as a PNG. For now, you can use any of the below variables and methods in a Javascript console such as found in Chrome, Safari, or Firebug on Firefox. Variables and methodsA range of variables and methods will be available to use in your macros. To start with, you can read through the existing framework here: https://github.com/jywarren/spectral-workbench/blob/master/webserver/public/javascripts/capture.js
Saving client-side processed dataYou should also be able to manipulate the JSON representation of data on the client side and save it to the server using the following URL format:
where
Upcoming variables and methods
ExamplesPlease add your own if you like: Saving image data offline REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro can be found here: https://gist.github.com/jywarren/4945996 |
Revert | |
29 | warren |
June 08, 2015 14:58
| over 9 years ago
This is a planning page for the in-development Spectral Workbench API. PurposeThe API (starting with the macro system, below) will make it possible for anyone to develop new functions, like:
MacrosWe're building a simple API so people can write macros without a lot of fuss. There are 2 places to use macros - in the "Analyze" interface and in the "Capture" interface. The former is for performing operations on existing data, the latter for manipulating data while actually using your spectrometer. Both use the same library and have access to many (but not all) of the same functions. A simple macro saving and sharing system is now live at: https://spectralworkbench.org/macros Getting startedTo create a macro we have a simple editor you can enter JavaScript code into. The basic template (copy paste this and build on it!) is like this:
If you are already logged into Spectral Workbench, you can begin by clicking here: https://spectralworkbench.org/macros/new A very simple command to run in the macro console (works as of Oct 14 2012) would be:
Which opens a new tab with the current image data as a PNG. For now, you can use any of the below variables and methods in a Javascript console such as found in Chrome, Safari, or Firebug on Firefox. Variables and methodsA range of variables and methods will be available to use in your macros. To start with, you can read through the existing framework here: https://github.com/jywarren/spectral-workbench/blob/master/webserver/public/javascripts/capture.js
Upcoming variables and methods
ExamplesPlease add your own if you like: Saving image data offline REST APIThere are a variety of calls possible to access data programmatically with a REST API:
Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro can be found here: https://gist.github.com/jywarren/4945996 |
Revert | |
28 | warren |
September 23, 2014 00:12
| over 10 years ago
This is a planning page for the in-development Spectral Workbench API. PurposeThe API (starting with the macro system, below) will make it possible for anyone to develop new functions, like:
MacrosWe're building a simple API so people can write macros without a lot of fuss. There are 2 places to use macros - in the "Analyze" interface and in the "Capture" interface. The former is for performing operations on existing data, the latter for manipulating data while actually using your spectrometer. Both use the same library and have access to many (but not all) of the same functions. A simple macro saving and sharing system is now live at: https://spectralworkbench.org/macros Getting startedTo create a macro we have a simple editor you can enter JavaScript code into. The basic template (copy paste this and build on it!) is like this:
If you are already logged into Spectral Workbench, you can begin by clicking here: https://spectralworkbench.org/macros/new A very simple command to run in the macro console (works as of Oct 14 2012) would be:
Which opens a new tab with the current image data as a PNG. For now, you can use any of the below variables and methods in a Javascript console such as found in Chrome, Safari, or Firebug on Firefox. Variables and methodsA range of variables and methods will be available to use in your macros. To start with, you can read through the existing framework here: https://github.com/jywarren/spectral-workbench/blob/master/webserver/public/javascripts/capture.js
Upcoming variables and methods
ExamplesPlease add your own if you like: Saving image data offline Submitting spectra via POST requestIt is possible for logged-in users to POST to: https://spectralworkbench.org/spectrums with the following parameters:
This could enable periodic timed submission of data. However, we discourage users from abusing the API by submitting every minute or every second, which might force us to disable this form of submitting data. Please submit only 1 pixel tall images instead of whole images, and submit a maximum of once per hour. An periodic sampling macro can be found here: https://gist.github.com/jywarren/4945996 |
Revert |