-
Notifications
You must be signed in to change notification settings - Fork 0
/
convert.flow
executable file
·45 lines (45 loc) · 5.31 KB
/
convert.flow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Project: adams
# Date: 2024-05-24 15:20:48
# User: fracpete
# Charset: UTF-8
# Modules: adams-bootstrapp,adams-compress,adams-core,adams-db,adams-event,adams-excel,adams-heatmap,adams-imaging,adams-imaging-boofcv,adams-json,adams-math,adams-matlab,adams-meta,adams-ml,adams-net,adams-odf,adams-pdf,adams-pyro4,adams-python,adams-r,adams-rats-core,adams-rats-net,adams-rats-redis,adams-rats-rest,adams-rats-webservice,adams-redis,adams-rest,adams-security,adams-spectral-2dim-core,adams-spectral-2dim-handheld,adams-spectral-2dim-r,adams-spectral-2dim-rats,adams-spectral-2dim-webservice,adams-spectral-3way-core,adams-spectral-app,adams-spreadsheet,adams-terminal,adams-visualstats,adams-webservice,adams-webservice-core,adams-weka-lts,adams-xml,adams-yaml
#
adams.flow.control.Flow -annotation "Expects two sub-dirs in the same dir as the flow:\\n- raw\\n- output\\nThe raw directory must contain the CSV files." -error-handling ACTORS_DECIDE_TO_STOP_ON_ERROR -flow-execution-listener adams.flow.execution.NullListener -flow-restart-manager adams.flow.control.flowrestart.NullManager
adams.flow.standalone.CallableActors
adams.flow.sink.SpectrumDisplay -name Soil -display-type adams.flow.core.displaytype.Default -writer adams.gui.print.NullWriter -color-provider adams.gui.visualization.core.DefaultColorProvider -paintlet "adams.gui.visualization.spectrum.SpectrumPaintlet -always-show-markers false -anti-aliasing-enabled false" -plot-updater "adams.flow.sink.spectrumdisplay.SimplePlotUpdater -update-interval 50"
adams.flow.standalone.SetVariable -var-name wavenumber_header_row -var-value 1
adams.flow.standalone.SetVariable -name "SetVariable (2)" -var-name wavenumber_regex -var-value n(.*)
adams.flow.standalone.SetVariable -name "SetVariable (3)" -var-name columns_with_wavenumbers -var-value 2-last
adams.flow.standalone.SetVariable -name "SetVariable (5)" -var-name rows_with_samples -var-value 2-last
adams.flow.standalone.SetVariable -name "SetVariable (6)" -var-name columns_with_meta -var-value ""
adams.flow.standalone.SetVariable -name "SetVariable (8)" -var-name row_sample_data_names -var-value 1
adams.flow.standalone.SetVariable -name "SetVariable (9)" -var-name id_column -var-value 1
adams.flow.source.Variable -var-name flow_dir -conversion adams.data.conversion.StringToString
adams.flow.control.Tee -name "Read sample data and put in storage"
adams.flow.transformer.AppendName -suffix "raw/Soil engineering properties_2.csv" -use-forward-slashes true
adams.flow.transformer.SpreadSheetFileReader -reader "adams.data.io.input.CsvSpreadSheetReader -data-row-type adams.data.spreadsheet.DenseDataRow -spreadsheet-type adams.data.spreadsheet.DefaultSpreadSheet -no-header true"
adams.flow.transformer.Convert -conversion "adams.data.conversion.SpreadSheetRowsToSampleData -row-sampledata-names 1 -rows-sampledata-values 2-last -cols-sampledata 1-last -col-id 1"
adams.flow.transformer.Convert -name "Convert (2)" -conversion adams.data.conversion.SampleDataArrayToMap
adams.flow.transformer.SetStorageValue -storage-name sampledata_map
adams.flow.control.Tee -name "Read spectra"
adams.flow.transformer.AppendName -suffix raw/Raw_NIR_spectra.csv -use-forward-slashes true
adams.flow.transformer.SpreadSheetFileReader -name "SpreadSheetFileReader (2)" -reader "adams.data.io.input.CsvSpreadSheetReader -data-row-type adams.data.spreadsheet.DenseDataRow -spreadsheet-type adams.data.spreadsheet.DefaultSpreadSheet -no-header true"
adams.flow.transformer.Convert -conversion "adams.data.conversion.SpreadSheetRowsToSpectra -row-wave-number @{wavenumber_header_row} -wave-number-regexp @{wavenumber_regex} -cols-amplitude @{columns_with_wavenumbers} -rows-amplitude @{rows_with_samples} -row-sampledata-names @{row_sample_data_names} -cols-sampledata @{columns_with_meta} -col-id @{id_column}"
adams.flow.transformer.ArrayToSequence
adams.flow.control.TryCatch -error-post-processors adams.flow.control.errorpostprocessor.Null
adams.flow.control.SubProcess -name try
adams.flow.transformer.MergeSampleDataFromMap -storage-name sampledata_map
adams.flow.transformer.SetStorageValue -storage-name spectrum
adams.flow.control.Tee -name display -skip true
adams.flow.sink.CallableSink -callable Soil
adams.flow.transformer.InstanceGenerator -generator "adams.data.instances.SimpleInstanceGenerator -add-sample-id true -additional Depth[S] -additional mc[N] -additional CEC[N] -additional tclay[N] -additional PL[N] -additional LL[N] -additional PI[N] -additional LS[N] -additional Ac[N] -additional COLE[N] -no-additional-prefix true -field VS[N] -wave-number-as-suffix true"
adams.flow.transformer.WekaInstanceBuffer
adams.flow.transformer.SetStorageValue -name "SetStorageValue (2)" -storage-name data
adams.flow.control.SubProcess -name catch
adams.flow.control.Tee -name display -skip true
adams.flow.sink.CallableSink -callable Soil
adams.flow.transformer.PassThrough
adams.flow.control.Trigger -name "Save CSV"
adams.flow.standalone.SetVariable -var-name output_file -var-value @{flow_dir}/output/all.csv -expand-value true
adams.flow.source.StorageValue -storage-name data -conversion adams.data.conversion.UnknownToUnknown
adams.flow.sink.WekaFileWriter -output @{output_file} -use-custom true -saver "weka.core.converters.SpreadSheetSaver -writer \"adams.data.io.output.CsvSpreadSheetWriter -always-quote-text true\""