Git Product home page Git Product logo

Comments (5)

rhugonnet avatar rhugonnet commented on August 17, 2024

Thanks for opening this issue @cwywilson. Can you also:

  • Add your full code (import statements) into a minimal reproducible example,
  • xDEM version.

Locally and in all tests (Linux, MacOS, Windows), the following works with xDEM 0.0.16 (current version):

import xdem
vshift = xdem.coreg.VerticalShift()

So it's hard to pinpoint why you would have this issue 🤔

from xdem.

cwywilson avatar cwywilson commented on August 17, 2024

Thanks for helping. I am using xDEM Version: 0.0.16 with VScode (Window)

Here is the code :

import geoutils as gu
import matplotlib.pyplot as plt
import numpy as np
import xdem
from xdem import coreg

dem_2020 = xdem.DEM("D:\BICdata\ArcticDEMclip.tif")
dem_1960 = xdem.DEM("D:\BICdata\BICDEMrwithice.tif").reproject(dem_2020)

outlines_2000 = gu.Vector("D:\CODEM\Shapefile\RGI2000-v7.0-G-04_arctic_canada_south\RGI2000-v7.0-G-04_arctic_canada_south.shp")
inlier_mask = outlines_2000.create_mask(dem_2020)

vshift = xdem.coreg.VerticalShift()
vshift.fit(dem_2020, dem_1960, inlier_mask=inlier_mask)

shifted_dem = vshift.apply(dem_1960)
vshift_median = xdem.coreg.VerticalShift(vshift_func=np.median)


ddem_pre = dem_1960 - dem_2020
ddem_post = shifted_dem - dem2020
plt.figure(figsize=(50, 50))
ddem_pre.show(cmap='coolwarm_r', vmin=-100, vmax=100, cb_title="Elevation change (m)")
ddem_post.show(cmap='coolwarm_r', vmin=-100, vmax=100, cb_title="Elevation change (m)")

Thanks for helps indeed

from xdem.

rhugonnet avatar rhugonnet commented on August 17, 2024

Here's the info to install/update your package: https://xdem.readthedocs.io/en/stable/how_to_install.html#installing-with-mamba-recommended. We recommend using mamba. You can force a package version by doing:
pip install xdem==0.0.16 or mamba install xdem==0.0.16.

from xdem.

cwywilson avatar cwywilson commented on August 17, 2024

Hi, Thanks for helping. End up, I re-installed the entire system to get 0.0.16 . Now, everything works well. Thanks for making xDEM

from xdem.

rhugonnet avatar rhugonnet commented on August 17, 2024

Perfect! Note that there is a bug with coregistration pipelines in 0.0.16: #447. In the meantime, you can use coregistration steps one by one, without using a pipeline. We'll try to fix those soon.

from xdem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.