Advanced usage
Some of the more nuanced, yet powerful features of the CS Calculator 2.0.
Add custom source
The CS Calculator 2.0 can perform calculations with its pre-built sources, as well as with custom user-inputted sources. To add a custom source:
Click on the Add Custom Source icon in the Source List panel.
The Add Custom Source modal will appear.
Fill in the Source Name, Manufacturer, CCT/Color, Lamp Type, Description, and SPD input fields.
Tip: Only the Source Name and SPD fields are required. The other fields are only used for filtering and organization.The Source Name field:
- Must be unique from any of the other sources.
The SPD field:
- Will accept relative or absolute SPDs, and convert them automatically to relative.
- Will accept any range of wavelengths, but will ultimately cut off anything outside the range .
- Will accept any wavelength step size.
- Must contain at least three data points.
- Must contain the same number of wavelengths and values.
If any of these criteria are not met, the Add Source button will be disabled.
Tip: Use the Toggle SPD Input Type button to be able to enter in wavelengths and values in seperate text boxes.
Download custom sources as JSON
Your custom sources can be downloaded so you can avoid having to input them every time you revisit the site.
Click the Download Custom Sources as JSON icon in the Source List panel.
Save the file from the download window that pops up.
Tip: This popup window might look slightly different depending on the browser you are using.Here is an example of the structure of the resulting file. This is an example of a JSON file containing two sources: a warm source, and a cool source.
{ "sources": [ { "id": "Warm Source", "manufacturer": "N/A", "cct": "4000 K", "lamp": "N/A", "info": "4000 K CCT, Warm circadian response source.", "spd": { "wavelength": [...], "value": [...] }, "custom": "true" }, { "id": "Cool Source", "manufacturer": "N/A", "cct": "6500 K", "lamp": "N/A", "info": "6500 K, cool response source.", "spd": { "wavelength": [...], "value": [...] }, "custom": "true" } ] }
Tip: If the resulting Source object in the downloaded JSON file is empty, check to make sure you've added one or more custom sources.
Upload custom sources from JSON
Once you've downloaded your custom sources as JSON, you can upload those sources back into the calculator without the hassle of manual input.
Click the Upload Custom Sources from JSON icon in the Source List panel.
An Upload Custom Sources from JSON modal will appear, click Browse... and select the JSON sources you wish to upload.
Tip: You can select and upload any number of JSON files at one time.Warning: Sources must have a unique id. If two or more of the sources you wish to upload share the same id, they will be ignored.Once you've selected the JSON files you wish to upload, click the Upload Sources button.
If the files you uploaded are valid, you will see your custom sources appear in the Source List panel and they will automatically be added to the Selected Sources panel in the Calculations pane.
Edit a Custom Source
Editing a custom source from within the CS Calculator 2.0 can be helpful so you don't have to upload an entirely new source everytime you want to make a change.
Click the Edit Source icon that appears in the Source List panel next to all custom sources.
Adjust any input fields in the Edit Custom Source modal that appear and click Edit Source. These input fields are the same as when adding a custom source.
Download metrics as text
Downloading the combined output metrics as text can be helpful in translating them into your own work, such as copy and pasting them into a Microsoft Excel spreadsheet.
Click the Download Metrics as Text icon in the Metrics panel.
Save the file from the download window that pops up.
Tip: This popup window might look slightly different depending on the browser you are using.Here is an example of the structure of the resulting file.
CS 0.206 CLA 2.0 161 Illuminance 200 Irradiance 9.7548e-1 Photon Flux 3.0397e+18 EML 110 CCT 2857 Duv 0.000 CRI 100.0 GAI 53.3 Chromaticity Coordinates (0.4475, 0.4075) CIE S-cone Irradiance 5.0839e-2 CIE M-cone Irradiance 2.3494e-1 CIE L-cone Irradiance 3.3137e-1 CIE Rhodopic Irradiance 1.6617e-1 CIE Melanopic Irradiance 1.3151e-1
Warning: Because of the way the web outputs this text content, it will not copy/paste nicely into Microsoft Excel; the resulting file from the download will, however.
Download combined SPDs as text
Downloading the combined SPDs as text can be helpful in translating them into your own work, such as copy and pasting them into a Microsoft Excel spreadsheet.
Click the Download Combined SPDs as Text icon in the Combined Source SPDs panel.
Choose whether to Download Relative SPD or Download Absolute SPD from the dropdown.
Save the file from the download window that pops up.
Tip: This popup window might look slightly different depending on the browser you are using.Here is an example of the structure of the resulting file.
380 0.0000013293803216772215 382 0.000001388033376605896 384 0.0000014484251156793788 386 0.000001510573695104725 388 0.0000015744964791381182 ...
Warning: Because of the way the web outputs this text content, it will not copy/paste nicely into Microsoft Excel; the resulting file from the download will, however.
Download all calculations as JSON
Should you want to experiment with the CS Calculator 2.0 data in your own programmatic work, you can download all the calculation data into a single JSON file.
Click the Download All Calculations as JSON icon in the Calculations tab.
Save the file from the download window that pops up.
Here is an example of the structure of the resulting file.
{ "version": "2.0.0", "date": "Fri Jul 16 2021 02:04:18 GMT-0400 (Eastern Daylight Time)", "sources": { "CIE A: Standard Incandescent": { "info": { "id": "CIE A: Standard Incandescent", "manufacturer": "Other", "cct": "2700 K", "lamp": "Incandescent", "desc": "CIE standard illuminant A ...", "spd": { "wavelengths": [...], "values": [...] } }, "lux": "200" } }, "input_variables": { "exposure_duration": "1", "distribution_scaler": "1" }, "combined_metrics": { "cs_2.0": "0.206", "cla_2.0": "161", "illuminance": "200", "irradiance": "9.7548e-1", "flux": "3.0397e+18", "eml": "110", "cct": "2857", "duv": "0.000", "cri": "100.0", "gai": "53.3", "chromaticity_coordinates": "(0.4475, 0.4075)", "cie_s-cone-irradiance": "5.0839e-2", "cie_m-cone_irradiance": "2.3494e-1", "cie_l-cone_irradiance": "3.3137e-1", "cie_rhodopic_irradiance": "1.6617e-1", "cie_melanopic_irradiance": "1.3151e-1" }, "combined_spd": { "relative": { "wavelengths": [...], "values": [...] }, "absolute": { "wavelengths": [...], "values": [...] } } }