Welcome to the BEAM Forum!

We encourage you to sign in our forum and participate in the BEAM community. The forum is maintained by the BEAM project team who will most likely answer your questions within 24 hours (except during common holidays) - if not done by other community members. Collaborate, share your knowledge and learn from other users!

If you don't find what you are looking for, please also consider the following external forums:

Combination View Flat View Tree View
Threads [ Previous | Next ]
Ordering of source products when using GPF.createProduct()
Ordering of source products when using GPF.createProduct()
gpf programming beam java beam api
10/20/14 4:26 AM
Hello BEAM dev team,

In the API method
1GPF.createProduct(String operatorName, Map<String,Object> parameters, Product... sourceProducts)
are the order of source products maintained as they are passed into the Operator?

I use this method to test a GPF operator which takes 2 source products where the order is important: the first is expected to be a source product and the second is an optional mask product.
The test worked fine with SeaDAS7.1/BEAM4.11. However, after updating the test environment to use BEAM 5.0 libraries*, the source products get switched as they are passed into the Operator and cause the test to fail.

(* the libraries include beam-gpf-5.0.1.jar and beam-core-5.0.3-SNAPSHOT.jar)

The order of source products is maintained when the Operator is used via gpt tool with Graph XML files.

Flag Flag
RE: Ordering of source products when using GPF.createProduct()
Answer Answer (Unmark)
10/20/14 8:44 AM as a reply to Kutila Gunasekera.
Hello Kutila,

it is better to use the method you suggested only if the order of the source products is not important.
If your operator has two different source products it is better to have two different fields and name them different.
You can then use the createProduct method with the source product map.

1GPF.createProduct(String operatorName, Map<String, Object> parameters, Map<String, Product> sourceProducts)

An example for this kind of usage is the CollocateOp.

Flag Flag