geodesymiami / mimtpy

MIami Multi Track tools in Python (or MIami Modelling Tools)
10 stars 6 forks source link

concatenate_chunks.py error #12

Closed falkamelung closed 2 years ago

falkamelung commented 2 years ago

Hi @ranneylxr

When I run as given by --help I get an error:

concatenate_chunks.py $TE/ChamanBigSenAT144.template --outdir mimtpy --datatype velocity
/work2/05861/tg851601/stampede2/codet/rsmas_insar/sources/MimtPy

Traceback (most recent call last):
  File "/work2/05861/tg851601/stampede2/codet/rsmas_insar/sources/MimtPy/mimtpy/concatenate_chunks.py", line 264, in <module>
    main()
  File "/work2/05861/tg851601/stampede2/codet/rsmas_insar/sources/MimtPy/mimtpy/concatenate_chunks.py", line 238, in main
    if inpsdict['mimtpy.chunk'] == 'yes':
KeyError: 'mimtpy.chunk'

Am I doing something stupid? When I say

concatenate_chunks.py --chunks ChamanChunk{2*,3*}SenAT144 --project ChamanBigSenAT144 --datatype velocity  --outdir mimtpy

it works fine.

falkamelung commented 2 years ago

I see that you use $SCRATCHDIR in the script. Lets avoid this. We should first have a version where all files are given with full path. Then, if —project is given it calls a module that sets the paths and does globs to find the S1 file

Currently you would call it being in $SRATCHDIR. That is different to all our scripts.So the ‘normal way’ would be

cd $SRATCHDIR/GujaratBigSenDT10
concatenate_chunks.py —chunks $SCRATCHDIR/GujaratChunk2{1,2,3}SenDT107  --datatype timeseries                                         --outdir mimtpy
concatenate_chunks.py —chunks $SCRATCHDIR/GujaratChunk2{1,2,3}SenDT107  --datatype timeseries -—project GujaratBigSenDT10             --outdir mimtpy
concatenate_chunks.py —chunks $SCRATCHDIR/GujaratChunk2{1,2,3}SenDT107  --datatype timeseries -—project $SCRATCHDIR/GujaratBigSenDT10 --outdir mimtpy
concatenate_chunks.py —chunks ../GujaratChunk2{1,2,3}SenDT107           --datatype timeseries                                         --outdir mimtpy

For convenience you could also call it::

cd $SRATCHDIR
concatenate_chunks.py —chunks GujaratChunk2{1,2,3}SenDT107              --datatype timeseries -—project GujaratBigSenDT10 --outdir mimtpy
concatenate_chunks.py —chunks GujaratChunk2{1,2,3}SenDT107              --datatype timeseries -—project $SCRATCHDIR/GujaratBigSenDT10 --outdir mimtpy
concatenate_chunks.py —chunks $SCRATCHDIR/GujaratChunk2{1,2,3}SenDT107  --datatype timeseries -—project SCRATCHDIR/GujaratBigSenDT10  --outdir mimtpy

I hope the convention is clear. If something is given without path it starts where you are. We just have to get this right once!

Falk

falkamelung commented 2 years ago

It works. So I moved suggestions to the "suggestion issue" and closing this.