mirror of
https://code.it4i.cz/sccs/easyconfigs-it4i.git
synced 2025-04-17 20:20:49 +01:00

new file: i/IRODS/IRODS-0.7.3.eb new file: l/libxc/libxc-5.1.5-intel-2020a.eb new file: n/NodeODM/NodeODM-2.2.0-GCCcore-11.3.0.eb new file: o/ODM/ODM-2.8.7/.dockerignore new file: o/ODM/ODM-2.8.7/.github/workflows/publish-docker-and-wsl.yaml new file: o/ODM/ODM-2.8.7/.github/workflows/publish-docker-gpu.yaml new file: o/ODM/ODM-2.8.7/.github/workflows/publish-snap.yml new file: o/ODM/ODM-2.8.7/.github/workflows/publish-windows.yml new file: o/ODM/ODM-2.8.7/.github/workflows/test-build-prs.yaml new file: o/ODM/ODM-2.8.7/.gitignore new file: o/ODM/ODM-2.8.7/.gitmodules new file: o/ODM/ODM-2.8.7/CNAME new file: o/ODM/ODM-2.8.7/CONTRIBUTING.md new file: o/ODM/ODM-2.8.7/Dockerfile new file: o/ODM/ODM-2.8.7/LICENSE new file: o/ODM/ODM-2.8.7/README.md new file: o/ODM/ODM-2.8.7/SuperBuild/CMakeLists.txt new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-Ceres.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-Entwine.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-FPCFilter.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-GFlags.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-Hexer.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-LASzip.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-MvsTexturing.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-Obj2Tiles.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-OpenCV.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-OpenMVS.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-OpenSfM.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-PCL.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-PDAL.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-PyPopsift.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/External-Untwine.cmake new file: o/ODM/ODM-2.8.7/SuperBuild/cmake/ExternalProject-Setup.cmake new file: o/ODM/ODM-2.8.7/VERSION new file: o/ODM/ODM-2.8.7/code_of_conduct.md new file: o/ODM/ODM-2.8.7/configure.py new file: o/ODM/ODM-2.8.7/configure.sh new file: o/ODM/ODM-2.8.7/console.bat new file: o/ODM/ODM-2.8.7/contrib/blender/README.md new file: o/ODM/ODM-2.8.7/contrib/blender/common.py new file: o/ODM/ODM-2.8.7/contrib/blender/odm_photo.py new file: o/ODM/ODM-2.8.7/contrib/blender/odm_video.py new file: o/ODM/ODM-2.8.7/contrib/blender/photo_360.blend new file: o/ODM/ODM-2.8.7/contrib/blender/photo_vr.blend new file: o/ODM/ODM-2.8.7/contrib/grass/README.md new file: o/ODM/ODM-2.8.7/contrib/grass/odm_grass.py new file: o/ODM/ODM-2.8.7/contrib/mergepreview/README.md new file: o/ODM/ODM-2.8.7/contrib/mergepreview/mergepreview.py new file: o/ODM/ODM-2.8.7/contrib/ndvi/README.md new file: o/ODM/ODM-2.8.7/contrib/ndvi/agricultural_indices.py new file: o/ODM/ODM-2.8.7/contrib/ndvi/ndvi.py new file: o/ODM/ODM-2.8.7/contrib/ndvi/rename_sentera_agx710_multispectral_tif.py new file: o/ODM/ODM-2.8.7/contrib/orthorectify/README.md new file: o/ODM/ODM-2.8.7/contrib/orthorectify/orthorectify.py new file: o/ODM/ODM-2.8.7/contrib/orthorectify/run.sh new file: o/ODM/ODM-2.8.7/contrib/pc2dem/README.md new file: o/ODM/ODM-2.8.7/contrib/pc2dem/pc2dem.py new file: o/ODM/ODM-2.8.7/contrib/resize/README.md new file: o/ODM/ODM-2.8.7/contrib/resize/requirements.txt new file: o/ODM/ODM-2.8.7/contrib/resize/resize.py new file: o/ODM/ODM-2.8.7/contrib/shell/odm_exif2utm.sh new file: o/ODM/ODM-2.8.7/contrib/visveg/readme.md new file: o/ODM/ODM-2.8.7/contrib/visveg/vegind.py new file: o/ODM/ODM-2.8.7/docker/README new file: o/ODM/ODM-2.8.7/docker/g++ new file: o/ODM/ODM-2.8.7/docker/gcc new file: o/ODM/ODM-2.8.7/docs/issue_template.md new file: o/ODM/ODM-2.8.7/gpu.Dockerfile new file: o/ODM/ODM-2.8.7/innosetup.iss new file: o/ODM/ODM-2.8.7/licenses/libext_copyright.txt new file: o/ODM/ODM-2.8.7/licenses/libx11_copyright.txt new file: o/ODM/ODM-2.8.7/licenses/license.md new file: o/ODM/ODM-2.8.7/odm_docker_readme.txt new file: o/ODM/ODM-2.8.7/opendm/__init__.py new file: o/ODM/ODM-2.8.7/opendm/boundary.py new file: o/ODM/ODM-2.8.7/opendm/camera.py new file: o/ODM/ODM-2.8.7/opendm/cogeo.py new file: o/ODM/ODM-2.8.7/opendm/concurrency.py new file: o/ODM/ODM-2.8.7/opendm/config.py new file: o/ODM/ODM-2.8.7/opendm/context.py new file: o/ODM/ODM-2.8.7/opendm/cropper.py new file: o/ODM/ODM-2.8.7/opendm/cutline.py new file: o/ODM/ODM-2.8.7/opendm/dem/__init__.py new file: o/ODM/ODM-2.8.7/opendm/dem/commands.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/__init__.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/bounds/__init__.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/bounds/types.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/bounds/utils.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/extra_dimensions/__init__.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/extra_dimensions/dimension.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/extra_dimensions/distance_dimension.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/extra_dimensions/extended_dimension.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/extra_dimensions/partition_dimension.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/grid/__init__.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/grid/builder.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/io/__init__.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/io/las_io.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/partition/__init__.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/partition/one_partition.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/partition/partition_plan.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/partition/quad_partitions.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/partition/selector.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/partition/surrounding_partitions.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/point_cloud.py new file: o/ODM/ODM-2.8.7/opendm/dem/ground_rectification/rectify.py new file: o/ODM/ODM-2.8.7/opendm/dem/merge.py new file: o/ODM/ODM-2.8.7/opendm/dem/pdal.py new file: o/ODM/ODM-2.8.7/opendm/dem/utils.py new file: o/ODM/ODM-2.8.7/opendm/dls.py new file: o/ODM/ODM-2.8.7/opendm/entwine.py new file: o/ODM/ODM-2.8.7/opendm/gcp.py new file: o/ODM/ODM-2.8.7/opendm/geo.py new file: o/ODM/ODM-2.8.7/opendm/get_image_size.py new file: o/ODM/ODM-2.8.7/opendm/gpu.py new file: o/ODM/ODM-2.8.7/opendm/gsd.py new file: o/ODM/ODM-2.8.7/opendm/io.py new file: o/ODM/ODM-2.8.7/opendm/location.py new file: o/ODM/ODM-2.8.7/opendm/log.py new file: o/ODM/ODM-2.8.7/opendm/loghelpers.py new file: o/ODM/ODM-2.8.7/opendm/mesh.py new file: o/ODM/ODM-2.8.7/opendm/multispectral.py new file: o/ODM/ODM-2.8.7/opendm/nvm.py new file: o/ODM/ODM-2.8.7/opendm/ogctiles.py new file: o/ODM/ODM-2.8.7/opendm/orthophoto.py new file: o/ODM/ODM-2.8.7/opendm/osfm.py new file: o/ODM/ODM-2.8.7/opendm/photo.py new file: o/ODM/ODM-2.8.7/opendm/point_cloud.py new file: o/ODM/ODM-2.8.7/opendm/progress.py new file: o/ODM/ODM-2.8.7/opendm/pseudogeo.py new file: o/ODM/ODM-2.8.7/opendm/remote.py new file: o/ODM/ODM-2.8.7/opendm/report/dsm_gradient.png new file: o/ODM/ODM-2.8.7/opendm/report/overlap_color_map.txt new file: o/ODM/ODM-2.8.7/opendm/report/overlap_diagram_legend.png new file: o/ODM/ODM-2.8.7/opendm/rollingshutter.py new file: o/ODM/ODM-2.8.7/opendm/shots.py new file: o/ODM/ODM-2.8.7/opendm/system.py new file: o/ODM/ODM-2.8.7/opendm/thermal.py new file: o/ODM/ODM-2.8.7/opendm/thermal_tools/__init__.py new file: o/ODM/ODM-2.8.7/opendm/thermal_tools/dji_unpack.py new file: o/ODM/ODM-2.8.7/opendm/thermal_tools/flir_unpack.py new file: o/ODM/ODM-2.8.7/opendm/thermal_tools/thermal_utils.py new file: o/ODM/ODM-2.8.7/opendm/tiles/color_relief.txt new file: o/ODM/ODM-2.8.7/opendm/tiles/gdal2tiles.py new file: o/ODM/ODM-2.8.7/opendm/tiles/hsv_merge.py new file: o/ODM/ODM-2.8.7/opendm/tiles/tiler.py new file: o/ODM/ODM-2.8.7/opendm/types.py new file: o/ODM/ODM-2.8.7/opendm/utils.py new file: o/ODM/ODM-2.8.7/opendm/vendor/__init__.py new file: o/ODM/ODM-2.8.7/opendm/vendor/gdal_fillnodata.py new file: o/ODM/ODM-2.8.7/portable.Dockerfile new file: o/ODM/ODM-2.8.7/requirements.txt new file: o/ODM/ODM-2.8.7/run.bat new file: o/ODM/ODM-2.8.7/run.py new file: o/ODM/ODM-2.8.7/run.sh new file: o/ODM/ODM-2.8.7/snap/snapcraft.yaml new file: o/ODM/ODM-2.8.7/snap/snapcraft21.yaml new file: o/ODM/ODM-2.8.7/stages/__init__.py new file: o/ODM/ODM-2.8.7/stages/dataset.py new file: o/ODM/ODM-2.8.7/stages/mvstex.py new file: o/ODM/ODM-2.8.7/stages/odm_app.py new file: o/ODM/ODM-2.8.7/stages/odm_dem.py new file: o/ODM/ODM-2.8.7/stages/odm_filterpoints.py new file: o/ODM/ODM-2.8.7/stages/odm_georeferencing.py new file: o/ODM/ODM-2.8.7/stages/odm_meshing.py new file: o/ODM/ODM-2.8.7/stages/odm_orthophoto.py new file: o/ODM/ODM-2.8.7/stages/odm_postprocess.py new file: o/ODM/ODM-2.8.7/stages/odm_report.py new file: o/ODM/ODM-2.8.7/stages/openmvs.py new file: o/ODM/ODM-2.8.7/stages/run_opensfm.py new file: o/ODM/ODM-2.8.7/stages/splitmerge.py new file: o/ODM/ODM-2.8.7/start-dev-env.sh new file: o/ODM/ODM-2.8.7/test.sh new file: o/ODM/ODM-2.8.7/tests/assets/.gitignore new file: o/ODM/ODM-2.8.7/tests/assets/gcp_extras.txt new file: o/ODM/ODM-2.8.7/tests/assets/gcp_latlon_south.txt new file: o/ODM/ODM-2.8.7/tests/assets/gcp_latlon_valid.txt new file: o/ODM/ODM-2.8.7/tests/assets/gcp_michigan_feet_valid.txt new file: o/ODM/ODM-2.8.7/tests/assets/gcp_utm_north_valid.txt new file: o/ODM/ODM-2.8.7/tests/assets/images/DJI_0002.JPG new file: o/ODM/ODM-2.8.7/tests/assets/reconstruction.json new file: o/ODM/ODM-2.8.7/tests/assets/sample.json new file: o/ODM/ODM-2.8.7/tests/test_camera.py new file: o/ODM/ODM-2.8.7/tests/test_gcp.py new file: o/ODM/ODM-2.8.7/tests/test_osfm.py new file: o/ODM/ODM-2.8.7/tests/test_remote.py new file: o/ODM/ODM-2.8.7/tests/test_types.py new file: o/ODM/ODM-2.8.7/vcpkg-requirements.txt new file: o/ODM/ODM-2.8.7/win32env.bat new file: o/ODM/ODM-2.8.7/winrun.bat new file: o/ODM/v2.8.7.tar.gz new file: y/Yambo/Yambo-5.1.0-intel-2020a.eb new file: y/Yambo/Yambo-5.1.0-intel-2020a.eb.bak_20220715124556_61837 new file: y/Yambo/Yambo-5.1.0-intel-2021a.eb.old deleted: y/Yambo/Yambo-5.1.0-intel-2021a.eb
146 lines
5.7 KiB
Python
146 lines
5.7 KiB
Python
"""
|
|
MicaSense Downwelling Light Sensor Utilities
|
|
|
|
Copyright 2017 MicaSense, Inc.
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
this software and associated documentation files (the "Software"), to deal in the
|
|
Software without restriction, including without limitation the rights to use,
|
|
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
Software, and to permit persons to whom the Software is furnished to do so,
|
|
subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
"""
|
|
|
|
|
|
import numpy as np
|
|
# for DLS correction, we need the sun position at the time the image was taken
|
|
# this can be computed using the pysolar package (ver 0.6)
|
|
# https://pypi.python.org/pypi/Pysolar/0.6
|
|
# we import multiple times with checking here because the case of Pysolar is
|
|
# different depending on the python version :(
|
|
import imp
|
|
|
|
havePysolar = False
|
|
|
|
try:
|
|
import pysolar.solar as pysolar
|
|
havePysolar = True
|
|
except ImportError:
|
|
try:
|
|
import Pysolar.solar as pysolar
|
|
havePysolar = True
|
|
except ImportError:
|
|
import pysolar.solar as pysolar
|
|
havePysolar = True
|
|
finally:
|
|
if not havePysolar:
|
|
print("Unable to import pysolar")
|
|
|
|
def fresnel(phi):
|
|
return __multilayer_transmission(phi, n=[1.000277,1.6,1.38])
|
|
|
|
# define functions to compute the DLS-Sun angle:
|
|
def __fresnel_transmission(phi, n1=1.000277, n2=1.38, polarization=[.5, .5]):
|
|
"""compute fresnel transmission between media with refractive indices n1 and n2"""
|
|
# computes the reflection and transmittance
|
|
# for incidence angles phi for transition from medium
|
|
# with refractive index n1 to n2
|
|
# teflon e.g. n2=1.38
|
|
# polycarbonate n2=1.6
|
|
# polarization=[.5,.5] - unpolarized light
|
|
# polarization=[1.,0] - s-polarized light - perpendicular to plane of incidence
|
|
# polarization=[0,1.] - p-polarized light - parallel to plane of incidence
|
|
f1 = np.cos(phi)
|
|
f2 = np.sqrt(1-(n1/n2*np.sin(phi))**2)
|
|
Rs = ((n1*f1-n2*f2)/(n1*f1+n2*f2))**2
|
|
Rp = ((n1*f2-n2*f1)/(n1*f2+n2*f1))**2
|
|
T = 1.-polarization[0]*Rs-polarization[1]*Rp
|
|
if T > 1: T= 0.
|
|
if T < 0: T = 0.
|
|
if np.isnan(T): T = 0.
|
|
return T
|
|
|
|
def __multilayer_transmission(phi, n, polarization=[.5, .5]):
|
|
T = 1.0
|
|
phi_eff = np.copy(phi)
|
|
for i in range(0,len(n)-1):
|
|
n1 = n[i]
|
|
n2 = n[i+1]
|
|
phi_eff = np.arcsin(np.sin(phi_eff)/n1)
|
|
T *= __fresnel_transmission(phi_eff, n1, n2, polarization=polarization)
|
|
return T
|
|
|
|
# get the position of the sun in North-East-Down (NED) coordinate system
|
|
def ned_from_pysolar(sunAzimuth, sunAltitude):
|
|
"""Convert pysolar coordinates to NED coordinates."""
|
|
elements = (
|
|
np.cos(sunAzimuth) * np.cos(sunAltitude),
|
|
np.sin(sunAzimuth) * np.cos(sunAltitude),
|
|
-np.sin(sunAltitude),
|
|
)
|
|
return np.array(elements).transpose()
|
|
|
|
# get the sensor orientation in North-East-Down coordinates
|
|
# pose is a yaw/pitch/roll tuple of angles measured for the DLS
|
|
# ori is the 3D orientation vector of the DLS in body coordinates (typically [0,0,-1])
|
|
def get_orientation(pose, ori):
|
|
"""Generate an orientation vector from yaw/pitch/roll angles in radians."""
|
|
yaw, pitch, roll = pose
|
|
c1 = np.cos(-yaw)
|
|
s1 = np.sin(-yaw)
|
|
c2 = np.cos(-pitch)
|
|
s2 = np.sin(-pitch)
|
|
c3 = np.cos(-roll)
|
|
s3 = np.sin(-roll)
|
|
Ryaw = np.array([[c1, s1, 0], [-s1, c1, 0], [0, 0, 1]])
|
|
Rpitch = np.array([[c2, 0, -s2], [0, 1, 0], [s2, 0, c2]])
|
|
Rroll = np.array([[1, 0, 0], [0, c3, s3], [0, -s3, c3]])
|
|
R = np.dot(Ryaw, np.dot(Rpitch, Rroll))
|
|
n = np.dot(R, ori)
|
|
return n
|
|
|
|
# from the current position (lat,lon,alt) tuple
|
|
# and time (UTC), as well as the sensor orientation (yaw,pitch,roll) tuple
|
|
# compute a sensor sun angle - this is needed as the actual sun irradiance
|
|
# (for clear skies) is related to the measured irradiance by:
|
|
|
|
# I_measured = I_direct * cos (sun_sensor_angle) + I_diffuse
|
|
# For clear sky, I_direct/I_diffuse ~ 6 and we can simplify this to
|
|
# I_measured = I_direct * (cos (sun_sensor_angle) + 1/6)
|
|
|
|
def compute_sun_angle(
|
|
position,
|
|
pose,
|
|
utc_datetime,
|
|
sensor_orientation,
|
|
):
|
|
""" compute the sun angle using pysolar functions"""
|
|
altitude = 0
|
|
azimuth = 0
|
|
import warnings
|
|
with warnings.catch_warnings(): # Ignore pysolar leap seconds offset warning
|
|
warnings.simplefilter("ignore")
|
|
try:
|
|
altitude = pysolar.get_altitude(position[0], position[1], utc_datetime)
|
|
azimuth = pysolar.get_azimuth(position[0], position[1], utc_datetime)
|
|
except AttributeError: # catch 0.6 version of pysolar required for python 2.7 support
|
|
altitude = pysolar.GetAltitude(position[0], position[1], utc_datetime)
|
|
azimuth = 180-pysolar.GetAzimuth(position[0], position[1], utc_datetime)
|
|
sunAltitude = np.radians(np.array(altitude))
|
|
sunAzimuth = np.radians(np.array(azimuth))
|
|
sunAzimuth = sunAzimuth % (2 * np.pi ) #wrap range 0 to 2*pi
|
|
nSun = ned_from_pysolar(sunAzimuth, sunAltitude)
|
|
nSensor = np.array(get_orientation(pose, sensor_orientation))
|
|
angle = np.arccos(np.dot(nSun, nSensor))
|
|
return nSun, nSensor, angle, sunAltitude, sunAzimuth
|