calzone 1.1.7__tar.gz → 1.1.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {calzone-1.1.7 → calzone-1.1.8}/Cargo.toml +1 -1
- {calzone-1.1.7/src/python/calzone.egg-info → calzone-1.1.8}/PKG-INFO +1 -1
- {calzone-1.1.7 → calzone-1.1.8}/pyproject.toml +1 -1
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry/map.rs +30 -3
- {calzone-1.1.7 → calzone-1.1.8}/src/python/calzone/__init__.py +1 -1
- {calzone-1.1.7 → calzone-1.1.8/src/python/calzone.egg-info}/PKG-INFO +1 -1
- {calzone-1.1.7 → calzone-1.1.8}/COPYING.LESSER +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/LICENSE +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/MANIFEST.in +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/README.md +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/setup.cfg +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/calzone.h +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/cxx.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry/bytes.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry/goupil.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry/materials/gate.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry/materials/hash.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry/materials.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry/materials.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry/mesh.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry/mesh.h +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry/mesh.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry/mulder.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry/solids.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry/solids.h +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry/volume.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/geometry.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/lib.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/python/calzone/__main__.py +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/python/calzone.egg-info/SOURCES.txt +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/python/calzone.egg-info/dependency_links.txt +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/python/calzone.egg-info/entry_points.txt +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/python/calzone.egg-info/requires.txt +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/python/calzone.egg-info/top_level.txt +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/geometry.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/geometry.h +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/physics.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/physics.h +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/physics.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/random.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/random.h +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/random.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/sampler.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/sampler.h +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/sampler.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/source.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/source.h +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/source.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/tracker.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/tracker.h +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation/tracker.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/simulation.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/utils/convert.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/utils/data.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/utils/error.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/utils/error.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/utils/export.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/utils/extract.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/utils/float.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/utils/io.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/utils/namespace.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/utils/numpy.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/utils/os.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/utils/units.cc +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/utils/units.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/src/utils.rs +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/tests/test_examples.py +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/tests/test_geometry.py +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/tests/test_materials.py +0 -0
- {calzone-1.1.7 → calzone-1.1.8}/tests/test_simulation.py +0 -0
|
@@ -4,7 +4,7 @@ use crate::utils::extract::{Extractor, Property, Tag};
|
|
|
4
4
|
use crate::utils::float::f64x3;
|
|
5
5
|
use crate::utils::io::{dump_stl, PathString};
|
|
6
6
|
use crate::utils::numpy::{PyArray, PyArrayMethods, PyUntypedArray};
|
|
7
|
-
use geotiff::GeoTiff;
|
|
7
|
+
use geotiff::{GeoTiff, RasterType};
|
|
8
8
|
use geo_types::geometry::Coord;
|
|
9
9
|
use pyo3::prelude::*;
|
|
10
10
|
use pyo3::types::PyDict;
|
|
@@ -486,12 +486,39 @@ impl Map {
|
|
|
486
486
|
(x, y)
|
|
487
487
|
};
|
|
488
488
|
|
|
489
|
+
let raster_type = match geotiff.geo_key_directory.raster_type
|
|
490
|
+
.unwrap_or(RasterType::Undefined) {
|
|
491
|
+
RasterType::RasterPixelIsArea => RasterType::RasterPixelIsArea,
|
|
492
|
+
RasterType::RasterPixelIsPoint => RasterType::RasterPixelIsPoint,
|
|
493
|
+
_ => if geotiff
|
|
494
|
+
.get_value_at::<f64>(&Coord { x: x0, y: y0 }, 0)
|
|
495
|
+
.or_else(|| geotiff.get_value_at::<f64>(&Coord { x: x1, y: y0 }, 0))
|
|
496
|
+
.or_else(|| geotiff.get_value_at::<f64>(&Coord { x: x0, y: y1 }, 0))
|
|
497
|
+
.or_else(|| geotiff.get_value_at::<f64>(&Coord { x: x1, y: y1 }, 0))
|
|
498
|
+
.is_none() {
|
|
499
|
+
RasterType::RasterPixelIsPoint
|
|
500
|
+
} else {
|
|
501
|
+
RasterType::RasterPixelIsArea
|
|
502
|
+
},
|
|
503
|
+
};
|
|
504
|
+
let (x0, x1, dx, y0, y1, dy) = match raster_type {
|
|
505
|
+
RasterType::RasterPixelIsArea => {
|
|
506
|
+
let dx = (x1 - x0) / (nx as f64);
|
|
507
|
+
let dy = (y1 - y0) / (ny as f64);
|
|
508
|
+
(x0 + 0.5 * dx, x1 - 0.5 * dx, dx, y0 + 0.5 * dy, y1 - 0.5 * dy, dy)
|
|
509
|
+
},
|
|
510
|
+
RasterType::RasterPixelIsPoint => {
|
|
511
|
+
let dx = (x1 - x0) / ((nx - 1) as f64);
|
|
512
|
+
let dy = (y1 - y0) / ((ny - 1) as f64);
|
|
513
|
+
(x0, x1, dx, y0, y1, dy)
|
|
514
|
+
},
|
|
515
|
+
_ => unreachable!(),
|
|
516
|
+
};
|
|
517
|
+
|
|
489
518
|
let array = PyArray::<f32>::empty(py, &[ny, nx])?;
|
|
490
519
|
let size = nx * ny;
|
|
491
520
|
if size > 0 {
|
|
492
521
|
let z = unsafe { array.slice_mut()? };
|
|
493
|
-
let dx = (x1 - x0) / ((nx - 1) as f64);
|
|
494
|
-
let dy = (y1 - y0) / ((ny - 1) as f64);
|
|
495
522
|
for iy in 0..ny {
|
|
496
523
|
let y = if iy == ny - 1 { y1 } else { y0 + iy as f64 * dy };
|
|
497
524
|
for ix in 0..nx {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|