Exemplo n.º 1
0
  public ArrayList<SpaceProcessingChainComponent> create_output_spaces()
      throws SPECCHIOClientException {
    output_spaces = new ArrayList<SpaceProcessingChainComponent>();

    define_output_spaces();

    SpaceProcessingChainComponent spcc = null;
    if (cal_spaces.length > 0) {
      spcc = new SpaceProcessingChainComponent(owner, cal_spaces[0]);
    }

    // check if the new space is valid
    // if a module cannot create a space, then it sets the dimension to zero
    if (spcc != null && cal_spaces[0] != null && cal_spaces[0].getDimensionality() > 0) {
      spcc.set_space_name(output_space_definitions.get(0).space_name);
      set_spectrum_ids_in_output_space(cal_spaces[0]);
      output_spaces.add(spcc);
    } else {
      JOptionPane.showMessageDialog(
          owner,
          "Cannot create output space because the input spectra have no wavelength reference. \nPlease set a sensor with the correct wvls in the metadata editor.");
    }

    return output_spaces;
  }
Exemplo n.º 2
0
  public void transform() throws SPECCHIOClientException {

    // as the ids are already set, we just need to load the data
    SpaceProcessingChainComponent output_space = get_main_output_space();
    if (output_space != null) {
      Space new_output_space = specchio_client.loadSpace(output_space.getSpace());
      output_space.setSpace(new_output_space);
    }
  }