Skip to content

Commit be66171

Browse files
committed
Fixed issue with material properties right above model boundary.
1 parent ce91b81 commit be66171

5 files changed

Lines changed: 30 additions & 6 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@
3030

3131
# Debug files
3232
*.dSYM/
33+
34+
.DS_Store

.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>CCA</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.python.pydev.PyDevBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.python.pydev.pythonNature</nature>
16+
</natures>
17+
</projectDescription>

.pydevproject

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<?eclipse-pydev version="1.0"?><pydev_project>
3+
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
4+
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
5+
</pydev_project>

data/config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ depth = 50000
1414
depth_interval = 500
1515

1616
# Corners, in UTM projection.
17-
top_left_corner_e = 504472.106530
17+
top_left_corner_e = 504472.106530
1818
top_left_corner_n = 4050290.088321
1919
bottom_left_corner_e = 779032.901477
2020
bottom_left_corner_n = 3699450.983449
21-
top_right_corner_e = 905367.666914
22-
top_right_corner_n = 4366503.431060
21+
top_right_corner_e = 905367.666914
22+
top_right_corner_n = 4366503.431060
2323
bottom_right_corner_e = 1181157.928029
2424
bottom_right_corner_n = 4014713.414724

src/cca.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ int cca_query(cca_point_t *points, cca_properties_t *data, int numpoints) {
137137
point_utm_n = sin_rotation_angle * temp_utm_e + cos_rotation_angle * temp_utm_n;
138138

139139
// Which point base point does that correspond to?
140-
load_x_coord = floor(point_utm_e / total_width_m * configuration->nx);
141-
load_y_coord = floor(point_utm_n / total_height_m * configuration->ny);
140+
load_x_coord = floor(point_utm_e / total_width_m * (configuration->nx - 1));
141+
load_y_coord = floor(point_utm_n / total_height_m * (configuration->ny - 1));
142142

143143
// And on the Z-axis?
144144
load_z_coord = (configuration->depth / configuration->depth_interval - 1) -
145145
floor(points[i].depth / configuration->depth_interval);
146146

147147
// Are we outside the model's X and Y boundaries?
148-
if (load_x_coord > configuration->nx - 1 || load_y_coord > configuration->ny - 1 || load_x_coord < 0 || load_y_coord < 0) {
148+
if (load_x_coord > configuration->nx - 2 || load_y_coord > configuration->ny - 2 || load_x_coord < 0 || load_y_coord < 0) {
149149
data[i].vp = -1;
150150
data[i].vs = -1;
151151
data[i].rho = -1;

0 commit comments

Comments
 (0)