Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
shalava
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Due to inactivity, this project is scheduled to be deleted on 2036-01-29.
Why is this scheduled?
Show more breadcrumbs
rheolef
shalava
Commits
17d44db6
Commit
17d44db6
authored
5 years ago
by
EXT noe bernabeu
Browse files
Options
Downloads
Patches
Plain Diff
add xyz2geofield
parent
22db912e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xyz2geofield.sh
+82
-0
82 additions, 0 deletions
xyz2geofield.sh
with
82 additions
and
0 deletions
xyz2geofield.sh
0 → 100644
+
82
−
0
View file @
17d44db6
xe
=
`
awk
{
'print $1'
}
tmp/domain_input.gdat
`
ye
=
`
awk
{
'print $2'
}
tmp/domain_input.gdat
`
south
=
`
awk
{
'print $3'
}
tmp/domain_input.gdat
`
est
=
`
awk
{
'print $4'
}
tmp/domain_input.gdat
`
north
=
`
awk
{
'print $5'
}
tmp/domain_input.gdat
`
west
=
`
awk
{
'print $6'
}
tmp/domain_input.gdat
`
reso
=
`
awk
{
'print 0.01*$7'
}
tmp/domain_input.gdat
`
reso_dim
=
`
awk
{
'print $7'
}
tmp/domain_input.gdat
`
xmin
=
`
awk
{
'print $8'
}
tmp/domain_input.gdat
`
xmax
=
`
awk
{
'print $9'
}
tmp/domain_input.gdat
`
ymin
=
`
awk
{
'print $10'
}
tmp/domain_input.gdat
`
ymax
=
`
awk
{
'print $11'
}
tmp/domain_input.gdat
`
rm
tmp/domain_input.gdat
echo
"x_source = "
$xe
echo
"y_source = "
$ye
echo
"resolution = "
$reso_dim
echo
"xmin = "
$xmin
echo
"xmax = "
$xmax
echo
"ymin = "
$ymin
echo
"ymax = "
$ymax
awk
'{if (($1 >= '
$xmin
')&&($1<='
$xmax
')&&($2 >= '
$ymin
')&&($2<='
$ymax
')) {printf "%0.6f %0.6f %0.6f \n",0.01*($1-'
$xmin
'),0.01*($2-'
$ymin
'),0.01*$3}}'
$1
>
DEMadim.xyz
nxny
=
`
wc
-l
DEMadim.xyz |
awk
'{print $1}'
`
echo
$nxny
x0
=
`
head
-n
1 DEMadim.xyz |
awk
'{print $2}'
`
nx
=
`
awk
'{if ($2 != '
$x0
') {nl_val=NR; exit}} END{print nl_val-1;}'
DEMadim.xyz
`
ny
=
$((
(
$nxny
)/
$nx
))
echo
$nx
echo
$ny
xmin
=
`
head
-n
1 DEMadim.xyz |
awk
'{print $1}'
`
xmax
=
`
tail
-n
1 DEMadim.xyz |
awk
'{print $1}'
`
ymin
=
`
tail
-n
1 DEMadim.xyz |
awk
'{print $2}'
`
ymax
=
`
head
-n
1 DEMadim.xyz |
awk
'{print $2}'
`
$2
/mkgeo_grid_2d_var
-t
$((
$nx
-
1
))
$((
$ny
-
1
))
-a
$xmin
-b
$xmax
-c
$ymin
-d
$ymax
-order-ji
-v4
>
DEM.geo
geo
-upgrade
DEM.geo
>
tmp.geo
mv
tmp.geo DEM.geo
>
DEM.field
echo
"field"
>>
DEM.field
echo
"1
$nxny
"
>>
DEM.field
echo
"DEM.geo"
>>
DEM.field
echo
"P1"
>>
DEM.field
awk
'{print $3}'
DEMadim.xyz
>
z_tmp
cat
DEM.field z_tmp
>
DEM_tmp
mv
DEM_tmp DEM.field
rm
z_tmp
rm
DEMadim.xyz
>
grille.dmn
echo
"EdgeDomainNames"
>>
grille.dmn
echo
"4"
>>
grille.dmn
echo
"bottom"
>>
grille.dmn
echo
"right"
>>
grille.dmn
echo
"top"
>>
grille.dmn
echo
"left"
>>
grille.dmn
>
grille.bamgcad
echo
"MeshVersionFormatted"
>>
grille.bamgcad
echo
" 0"
>>
grille.bamgcad
echo
" Dimension"
>>
grille.bamgcad
echo
" 2"
>>
grille.bamgcad
echo
" Vertices"
>>
grille.bamgcad
echo
" 4"
>>
grille.bamgcad
echo
"
$xmin
$ymin
1"
>>
grille.bamgcad
echo
"
$xmax
$ymin
2"
>>
grille.bamgcad
echo
"
$xmax
$ymax
3"
>>
grille.bamgcad
echo
"
$xmin
$ymax
4"
>>
grille.bamgcad
echo
" Edges"
>>
grille.bamgcad
echo
" 4"
>>
grille.bamgcad
echo
" 1 2 101"
>>
grille.bamgcad
echo
" 2 3 102"
>>
grille.bamgcad
echo
" 3 4 103"
>>
grille.bamgcad
echo
" 4 1 104"
>>
grille.bamgcad
echo
" hVertices"
>>
grille.bamgcad
echo
"
$reso
$reso
$reso
$reso
"
>>
grille.bamgcad
bamg
-g
grille.bamgcad
-o
grille.bamg
-nbv
5000000
bamg2geo grille.bamg grille.dmn
>
grille.geo
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment