jkibele / opticalrs Goto Github PK
View Code? Open in Web Editor NEWPython implementation of remote sensing methods from papers by David R. Lyzenga and others.
Python implementation of remote sensing methods from papers by David R. Lyzenga and others.
There are typos in Lyzenga1978.py code docstrings as "caclulating"
Hi, I successfully installed OpticalRS. But when I try to import, it's showing error ImportError: No module named cross_validation. I think now cross_validation is changed to model_selection. Please fix
I couldn't find Sagawa's python script but the old version did.
Hi! we are using your library to try predicting seagrass. I believe in the requirements.txt this line its wrong:
opticalrs==1.0.0
You list as a dependency, when in fact that is the version of the package itself that is being installed.
Or im wrong? Let me know! Thanks for your public work!
The installation is a little easier now. I should update the website to reflect that.
I was able to get the KNN process to work through DepthEstimator
de = DepthEstimator('Input_Image', 'Depth_raster') depth = de.knn_depth_estimation(k=5)
however, the same process for Lyzenga
lyzdepth = de.lyzenga_depth_estimation()
fails eventually at Lyzenga2006.get_selfscore()
I've tracked it though to:
Lyzenga2006.py line 95: x_train = x_train.compressed().reshape(-1,nbands)
The above code takes my image array (x_train) which is a (x_train.shape==(7004,6199,8)) Woldview 2/3 image, and turns it into a (0,8) array, which then throws the error:
ValueError: Found array with a 0 sample(s) (shape=(0, 2)) while a minimum of 1 is required
when run through this line:
fit = get_fit( ind, x_train, y_train, n_jobs=njobs )
I'm not really sure what shape things should be in to get through this process, can you give me any tips?
There is a similar array shape problem in the Lyzenga Guide for X
full_pred = skolsfit.predict( X[...,best_ind] )
so I was hoping the above process would garner more success.
The installation under Ubuntu 16.04 works except for GDAL missing some headers.
Probably not relevant to this issue, and purely out of personal preference to keep my global python environment fairly contained, I'm running the pip install OpticalRS
step in a virtualenv.
This SO post provides a working solution:
# pip install OpticalRS fails at pip install GDAL
sudo apt-get install libgdal-dev # already part of previous steps
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
pip install GDAL # optional, as already a dependency of OpticalRS
# then resume:
pip install OpticalRS
Since libgdal-dev headers are already part of the installation, I assume setting the two env variables makes GDAL aware of the headers' location.
So the only change is to run
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
before the final pip install OpticalRS
.
When a mask is not used for ArrayUtils there are instances where the input array calling that function is not properly the expected numpy array. The outcome is an ellipsis error due to the difference in indexing between pandas and numpy.
[ ... , bn ]
in Lyzenga method guide you have:
x_train, x_test, y_train, y_test = train_test_split( df[imrds.band_names],df.depth,train_size=20000,random_state=5)
which returns pandas dataframes for x_train, x_test, y_train, y_test
Moving further along these are passed to ArrayUtils.band_df as pandas dataframes.
traindf = ArrayUtils.band_df( x_train )
Even though the function expects:
imarr : np.array or np.ma.MaskedArray
This was probably not noticed because in testing ArrayUtils.band_df a mask was always used, which would have run ArrayUtils.equalize_band_masks which doesn’t have indexing problems and returns:
tuple of N np.ma.MaskedArray
The error you get is:
KeyError: (Ellipsis, 0)
because you cannot subset pandas dataframe with [ ... , ]
my quick-fix was to do
x_train = x_train.as_matrix() x_test = x_test.as_matrix() y_train = y_train.as_matrix() y_test = y_test.as_matrix()
which seems to work, but I don't know if it will cause issues later on.
Hi
New in Python, i have install Anaconda 2.7 64bit.
Open the shell and pip install OpticalRS
(C:\Users\Dimitris\Anaconda2) C:\Users\Dimitris>pip install OpticalRS
Collecting OpticalRS
Using cached OpticalRS-1.0.2.tar.gz
Requirement already satisfied: numpy in c:\users\dimitris\anaconda2\lib\site-packages (from OpticalRS)
Requirement already satisfied: pandas in c:\users\dimitris\anaconda2\lib\site-packages (from OpticalRS)
Requirement already satisfied: statsmodels in c:\users\dimitris\anaconda2\lib\site-packages (from OpticalRS)
Requirement already satisfied: matplotlib in c:\users\dimitris\anaconda2\lib\site-packages (from OpticalRS)
Requirement already satisfied: scikit-image in c:\users\dimitris\anaconda2\lib\site-packages (from OpticalRS)
Requirement already satisfied: scikit-learn in c:\users\dimitris\anaconda2\lib\site-packages (from OpticalRS)
Collecting GDAL (from OpticalRS)
Using cached GDAL-2.2.3.tar.gz
Collecting geopandas (from OpticalRS)
Using cached geopandas-0.3.0-py2.py3-none-any.whl
Collecting rasterstats (from OpticalRS)
Using cached rasterstats-0.12.0-py2.py3-none-any.whl
Requirement already satisfied: scipy in c:\users\dimitris\anaconda2\lib\site-packages (from OpticalRS)
Requirement already satisfied: python-dateutil in c:\users\dimitris\anaconda2\lib\site-packages (from pandas->OpticalRS)
Requirement already satisfied: pytz>=2011k in c:\users\dimitris\anaconda2\lib\site-packages (from pandas->OpticalRS)
Requirement already satisfied: six>=1.10 in c:\users\dimitris\anaconda2\lib\site-packages (from matplotlib->OpticalRS)
Requirement already satisfied: backports.functools_lru_cache in c:\users\dimitris\anaconda2\lib\site-packages (from matplotlib->OpticalRS)
Requirement already satisfied: cycler>=0.10 in c:\users\dimitris\anaconda2\lib\site-packages (from matplotlib->OpticalRS)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in c:\users\dimitris\anaconda2\lib\site-packages (from matplotlib->OpticalRS)
Requirement already satisfied: networkx>=1.8 in c:\users\dimitris\anaconda2\lib\site-packages (from scikit-image->OpticalRS)
Requirement already satisfied: pillow>=2.1.0 in c:\users\dimitris\anaconda2\lib\site-packages (from scikit-image->OpticalRS)
Requirement already satisfied: PyWavelets>=0.4.0 in c:\users\dimitris\anaconda2\lib\site-packages (from scikit-image->OpticalRS)
Collecting descartes (from geopandas->OpticalRS)
Using cached descartes-1.1.0-py2-none-any.whl
Collecting pyproj (from geopandas->OpticalRS)
Using cached pyproj-1.9.5.1.tar.gz
Collecting fiona (from geopandas->OpticalRS)
Using cached Fiona-1.7.11.tar.gz
Collecting shapely (from geopandas->OpticalRS)
Using cached Shapely-1.6.4.post1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "c:\users\dimitris\appdata\local\temp\pip-build-iybsdk\shapely\setup.py", line 80, in
from shapely.buildcfg import geos_version_string, geos_version,
File "shapely_buildcfg.py", line 200, in
lgeos = CDLL("geos_c.dll")
File "C:\Users\Dimitris\Anaconda2\lib\ctypes_init.py", line 366, in init
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
Any idea on what cause this error ?
I have update the "pip install --upgrade setuptools"
D.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.