Bulk processing with GPT - command not found

what is these things in your file??
echo “Executing :” “gptPath{graphXmlPath} -e -t targetFile{sourceFile}”
#echo “===============”
#gptPath{graphXmlPath} -e -p parameterFilePath?t{targetFile} sourceFile{gptPath} graphXmlPath?e?t{targetFile} ${sourceFile}

there is some wrong characters…

Yes, Samira, your are right, the file under windows, looks fine, however under linux, some strange charterers appear, That’s might be because of copy , paste and transferring between windows and linux VM,

I reached half of the solution, the cause of this error,

The ^M is a carriage return character. Linux uses the line feed character to mark the end of a line, whereas Windows uses the two-character sequence CR LF. file has Windows line endings, which is confusing Linux.

To convert the line endings from DOS/Windows style to Unix style, there’s a tool called dos2unix . install it using:

sudo apt-get install dos2unix

Then simply convert files’ line endings in both ways using

dos2unix FILENAME
unix2dos FILENAME

Then I got this result

I don’t see the results in out folder,

(this error makes favour to me, I read a lot of things about linux and shell script :grinning:) but still I don’t know , where the results are and if something still wrong?)

where is your last line in your bash file? why you removed it?

{gptPath} {graphXmlPath} -e -t {targetFile} {sourceFile}

before done in for loop in your bash file

don’t remove anything just add this before done:

this%20line

It gives this error, command not found,

this%20line

1 Like

I’m reading in the same solution, but let’s try up,

@Samira.h and @marpet Tremendous thanks to your effort, it runs now,

But

Is it possible to keep this form of bash as a base, and then change according to the future operators?

1 Like

of course you can. your welcome and good luck active researcher…:wink:

2 Likes

Continuing the processing preparing the data from SNAP2STAMPS using bash, I think it is an easy way of processing the data,

applying backgeocoding and ESD, using bash needs to determine the master image, otherwise it is selected automatically.

How it is possible add up the selected master image path in bash file? And I Think the loop should be changed to be different slaves with the same master, And how we could get one resulted product.

This was my actual intention by providing the example script. Unfortunately, there seem to be some hurdles.
If you have a look at the Wiki page, can you tell how it should be improved?
https://senbox.atlassian.net/wiki/spaces/SNAP/pages/70503475/Bulk+Processing+with+GPT

I’d write a few general points in here, and I’ll keep continue writing later on,

For now, I’d suggest separate the linux and windwos, under this topic, Description of the Scripts, avoiding the confusion could happen,

And to be

Linux,
Explanations, Script, example,

Windows,
Explanations, Script, example,

Other point, I’d suggest, adding parameter, this point is not clear at least to me, how to add them, in separate file Or within the script file, as they explained in the example,

resolution=20

down=Min

up=Bicubic

flag=First

An example of the Linux script I downloaded and used, needs many edits, to be ready in use, after the last edit I succeeded to use the edited script of launching different operators, of course by creating different XML according to the operator.

An Important issue, I’d suggest to be added for example, I asked a question in here,

In general, I’d say adding part of how to edit the script according to the use is important, also it is needed to add a link of the characters meaning, for example echo, $, what are their important in the script? for example

Here is good Link could be added up

And this one as well Link2

this%20line ,

Might be, some examples of the errors could be occurred are worthen to mention.

Two points come to my mind now,

I’d suggest two things,

add up the link of related matters are already asked within the STEP FORUM,

add short explanation related to the operators implementation,
Could all operators of processing S1, S2, S3 be done using Bulk processing with gbt? Or Not?

How the loop could be edited?

An example of run gpt using a python script is worth adding up,

Here also a nice example,

But it needs some explanation, How to add this part? How to edit manually the XML file, and this is related to this error,

This could be other example regarding the bug in ProductSet-Reader operator in SNAP

Briefly to add a part, how to edit the XML file, step by step is highly requested,

Thanks for the input. I’ve put a task into our ticket system
SNAP-1090

1 Like

Hi Marco,

A question comes to mind now, How it’s possible to view an image let say S1 SLC IW1 Burst 1 using gpt?

I’m thinking something like to view the image using gpt, and then continue processing the image using gpt with viewing the results.

Hi Falah,

there is no direct way of doing this with gpt. You could use a python script to create and display an image.
For creating the image you can use pconvert or the is actually a hidden operator.
If you know it’s name you can use it.
If you type
gpt -h writeRGB
you’ll get the help for.


however, there are resaons why this one is not public. It is not well documented it lacks features and it is not properly tested. So, you can try it on your own risk :wink:

Also, I think your request is very uncommon. Usually, one uses gpt for batch processing because he doesn’t want user interaction. If you want user interaction you can use the desktop SNAP.
So, I wonder what’s the actual driver behind your request?

Good morning Marco,

The reason is, view any in between result of gpt in the fly as well, no need to save anything, for instance, let say I’m doing the following process,

Read — > Apply orbit ----> ThermalNoiseRemoval—>write,

We could add up a view in the fly like this,

Read —> View ---->Apply orbit ---->View----> ThermalNoiseRemoval—>write,

Something like this, checking up in between results. Also could adding up some tools like zoom in and zoom out.

Something important,

Checking up in between results, We could also add up some choices like to continue the process, or re-set the parameters of each an individual operator.