Probléme d'extraction des données

Résolu/Fermé
CYG - 21 mars 2008 à 17:35
 CYG - 25 mars 2008 à 17:14
Bonjour,

mon probléme consiste à modifier des chaînes de caractére dans le fichier<interferogram.out>, voici l'extrait du fichier qui m intéresse:

*******************************************************************
*_Start_subtr_refdem:
*******************************************************************
Method: NOT_USED
Additional_azimuth_shift: 0
Additional_range_shift: 0
Data_output_file: diff
Data_output_format: complex_real4
First_line (w.r.t. original_master): 8400
Last_line (w.r.t. original_master): 16224
First_pixel (w.r.t. original_master): 2790
Last_pixel (w.r.t. original_master): 3952
Multilookfactor_azimuth_direction: 5
Multilookfactor_range_direction: 1
Number of lines (multilooked): 1565
Number of pixels (multilooked): 1163
*******************************************************************
* End_subtr_refdem:_NORMAL
*******************************************************************

Current time: Thu Mar 13 15:23:49 2008


*******************************************************************
*_Start_filtphase:
*******************************************************************
Method_phasefilt: goldstein: size, alpha, overlap: 32 0.9 11
1D Smoothing kernel for |spectrum|: 0.111111 0.222222 0.333333 0.222222 0.111111
Input_file: diff
Data_output_file: diff.filt
Data_output_format: complex_real4
First_line (w.r.t. original_master): 8400
Last_line (w.r.t. original_master): 16224
First_pixel (w.r.t. original_master): 2790
Last_pixel (w.r.t. original_master): 3952
Multilookfactor_azimuth_direction: 5
Multilookfactor_range_direction: 1
Number of lines (multilooked): 1565
Number of pixels (multilooked): 1163
*******************************************************************
* End_filtphase:_NORMAL
*******************************************************************

Current time: Thu Mar 13 15:24:04 2008


*====================================================================*
| |
Following part is appended at: Mon Jan 28 16:22:33 2008
| |
*--------------------------------------------------------------------*

*******************************************************************
*_Start_slant2h:
*******************************************************************
Method: schwabisch
Data_output_file: demradar
Data_output_format: real4
First_line (w.r.t. original_master): 8400
Last_line (w.r.t. original_master): 16634
First_pixel (w.r.t. original_master): 2790
Last_pixel (w.r.t. original_master): 3969
Multilookfactor_azimuth_direction: 5
Multilookfactor_range_direction: 1
Ellipsoid (name,a,b): WGS84 6.378137e+06 6.3567523e+06
*******************************************************************
* End_slant2h:_NORMAL
*******************************************************************


Current time: Mon Jan 28 16:12:04 2008


j'ai besoin de changer les lignes soulignées et les rendre comme celle en gras,
dans tout le fichier interferogram.out les lignes:

First_line (w.r.t. original_master):
Last_line (w.r.t. original_master):
First_pixel (w.r.t. original_master):
Last_pixel (w.r.t. original_master):


contiennent les mémes informations sauf les 4 derniers(soulignées) qui sont différentes

j attends vos propositions;

merci d avance;

CYG

2 réponses

jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 4 897
21 mars 2008 à 17:49
J'ai rien compris à ce que tu veux faire !? ;-\

Affiche plutôt "avant" => "après"...
0
salut,

*******************************************************************
*_Start_subtr_refdem:
*******************************************************************
Method: NOT_USED
Additional_azimuth_shift: 0
Additional_range_shift: 0
Data_output_file: diff
Data_output_format: complex_real4
First_line (w.r.t. original_master): 8400
Last_line (w.r.t. original_master): 16224
First_pixel (w.r.t. original_master): 2790
Last_pixel (w.r.t. original_master): 3952
Multilookfactor_azimuth_direction: 5
Multilookfactor_range_direction: 1
Number of lines (multilooked): 1565
Number of pixels (multilooked): 1163
*******************************************************************
* End_subtr_refdem:_NORMAL
*******************************************************************

Current time: Thu Mar 13 15:23:49 2008


*******************************************************************
*_Start_filtphase:
*******************************************************************
Method_phasefilt: goldstein: size, alpha, overlap: 32 0.9 11
1D Smoothing kernel for |spectrum|: 0.111111 0.222222 0.333333 0.222222 0.111111
Input_file: diff
Data_output_file: diff.filt
Data_output_format: complex_real4
First_line (w.r.t. original_master): 8400
Last_line (w.r.t. original_master): 16224
First_pixel (w.r.t. original_master): 2790
Last_pixel (w.r.t. original_master): 3952
Multilookfactor_azimuth_direction: 5
Multilookfactor_range_direction: 1
Number of lines (multilooked): 1565
Number of pixels (multilooked): 1163
*******************************************************************
* End_filtphase:_NORMAL
*******************************************************************

Current time: Thu Mar 13 15:24:04 2008


*====================================================================*
| |
Following part is appended at: Mon Jan 28 16:22:33 2008
| |
*--------------------------------------------------------------------*

*******************************************************************
*_Start_slant2h:
*******************************************************************
Method: schwabisch
Data_output_file: demradar
Data_output_format: real4
First_line (w.r.t. original_master): 8400
Last_line (w.r.t. original_master): 16634
First_pixel (w.r.t. original_master): 2790
Last_pixel (w.r.t. original_master): 3969
Multilookfactor_azimuth_direction: 5
Multilookfactor_range_direction: 1
Ellipsoid (name,a,b): WGS84 6.378137e+06 6.3567523e+06
*******************************************************************
* End_slant2h:_NORMAL
*******************************************************************


aprés


*******************************************************************
*_Start_subtr_refdem:
*******************************************************************
Method: NOT_USED
Additional_azimuth_shift: 0
Additional_range_shift: 0
Data_output_file: diff
Data_output_format: complex_real4
First_line (w.r.t. original_master): 8400
Last_line (w.r.t. original_master): 16224
First_pixel (w.r.t. original_master): 2790
Last_pixel (w.r.t. original_master): 3952

Multilookfactor_azimuth_direction: 5
Multilookfactor_range_direction: 1
Number of lines (multilooked): 1565
Number of pixels (multilooked): 1163
*******************************************************************
* End_subtr_refdem:_NORMAL
*******************************************************************

Current time: Thu Mar 13 15:23:49 2008


*******************************************************************
*_Start_filtphase:
*******************************************************************
Method_phasefilt: goldstein: size, alpha, overlap: 32 0.9 11
1D Smoothing kernel for |spectrum|: 0.111111 0.222222 0.333333 0.222222 0.111111
Input_file: diff
Data_output_file: diff.filt
Data_output_format: complex_real4
First_line (w.r.t. original_master): 8400
Last_line (w.r.t. original_master): 16224
First_pixel (w.r.t. original_master): 2790
Last_pixel (w.r.t. original_master): 3952

Multilookfactor_azimuth_direction: 5
Multilookfactor_range_direction: 1
Number of lines (multilooked): 1565
Number of pixels (multilooked): 1163
*******************************************************************
* End_filtphase:_NORMAL
*******************************************************************

Current time: Thu Mar 13 15:24:04 2008


*====================================================================*
| |
Following part is appended at: Mon Jan 28 16:22:33 2008
| |
*--------------------------------------------------------------------*

*******************************************************************
*_Start_slant2h:
*******************************************************************
Method: schwabisch
Data_output_file: demradar
Data_output_format: real4
First_line (w.r.t. original_master): 8400
Last_line (w.r.t. original_master): 16634
First_pixel (w.r.t. original_master): 2790
Last_pixel (w.r.t. original_master): 3969

Multilookfactor_azimuth_direction: 5
Multilookfactor_range_direction: 1
Ellipsoid (name,a,b): WGS84 6.378137e+06 6.3567523e+06
*******************************************************************
* End_slant2h:_NORMAL
*******************************************************************



merci d avance

CYG
0
jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 4 897
21 mars 2008 à 19:16
En partant sur le même principe qu'hier, voilà ce que ça peut donner, mais n'ayant pas tous les éléments en mains, je me base sur ce que j'ai...
[tmpfs]$ sed -n '1,/End/{/First\|Last/p}' plop > <gras>tmp

[tmpfs]$ cat tmp
First_line (w.r.t. original_master): 8400
Last_line (w.r.t. original_master): 16224
First_pixel (w.r.t. original_master): 2790
Last_pixel (w.r.t. original_master): 3952

[tmpfs]$ sed '
/_Start_slant2h/,/End_slant2h:/ {
    /First_line/,/Last_pixel/ {
        :z
        N
        /Last_pixel/ !b z
        s/^.*$/cat tmp/e
}
}' plop

*******************************************************************
*_Start_subtr_refdem:
*******************************************************************
Method: NOT_USED
Additional_azimuth_shift: 0
Additional_range_shift: 0
Data_output_ diff
Data_output_format: complex_real4
First_line (w.r.t. original_master): 8400
Last_line (w.r.t. original_master): 16224
First_pixel (w.r.t. original_master): 2790
Last_pixel (w.r.t. original_master): 3952
Multilookfactor_azimuth_direction: 5
Multilookfactor_range_direction: 1
Number of lines (multilooked): 1565
Number of pixels (multilooked): 1163
*******************************************************************
* End_subtr_refdem:_NORMAL
*******************************************************************

Current time: Thu Mar 13 15:23:49 2008


*******************************************************************
*_Start_filtphase:
*******************************************************************
Method_phasefilt: goldstein: size, alpha, overlap: 32 0.9 11
1D Smoothing kernel for |spectrum|: 0.111111 0.222222 0.333333 0.222222 0.111111
Input_ diff
Data_output_ diff.filt
Data_output_format: complex_real4
First_line (w.r.t. original_master): 8400
Last_line (w.r.t. original_master): 16224
First_pixel (w.r.t. original_master): 2790
Last_pixel (w.r.t. original_master): 3952
Multilookfactor_azimuth_direction: 5
Multilookfactor_range_direction: 1
Number of lines (multilooked): 1565
Number of pixels (multilooked): 1163
*******************************************************************
* End_filtphase:_NORMAL
*******************************************************************

Current time: Thu Mar 13 15:24:04 2008


*====================================================================*
| |
Following part is appended at: Mon Jan 28 16:22:33 2008
| |
*--------------------------------------------------------------------*

*******************************************************************
*_Start_slant2h:
*******************************************************************
Method: schwabisch
Data_output_ demradar
Data_output_format: real4
First_line (w.r.t. original_master): 8400
Last_line (w.r.t. original_master): 16224
First_pixel (w.r.t. original_master): 2790
Last_pixel (w.r.t. original_master): 3952
Multilookfactor_azimuth_direction: 5
Multilookfactor_range_direction: 1
Ellipsoid (name,a,b): WGS84 6.378137e+06 6.3567523e+06
*******************************************************************
* End_slant2h:_NORMAL
*******************************************************************


Current time: Mon Jan 28 16:12:04 2008

[tmpfs]$
;-))
0
bonjour;

j ai essayé la commande < sed -n '1,/End/{/First\|Last/p}' interferogram.out > tmp > mais le fichier résultant <tmp> est vide, vous pouvez m'expliquez cette commande pour que je puisse l adapter à mon fichier interferogram.out

merci d avance;

CYG
0
jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 4 897 > CYG
25 mars 2008 à 10:24
Re-

En fait cette commande dans sa 1ère partie (1,/End/) cible l'intervalle de lignes compris entre la 1ère ligne du fichier et la 1ère ligne comprenant la chaîne "End", puis dans cet intervalle on demande l'affichage des lignes contenant soit le motif "First" soit le motif "Last" (/First\|Last/p) et d'envoyer le résultat dans le fichier "tmp"...

Ce qui en principe devrait remplir le fichier "tmp" avec :
First_line (w.r.t. original_master): 8400
Last_line (w.r.t. original_master): 16224
First_pixel (w.r.t. original_master): 2790
Last_pixel (w.r.t. original_master): 3952


:-))
0
CYG > jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020
25 mars 2008 à 17:01
merci jipicy maintenant ça marche;

CYG
0
jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 4 897 > CYG
25 mars 2008 à 17:04
Cool, mais où était l'erreur ?
0
CYG > jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020
25 mars 2008 à 17:14
ce que je vous ai donné c étai juste un extrait de mon fichier, il fallait que je change juste l interval de lignes et ça marchai, grace à ton explication,
merci;
CYG
0