asfopensarlab / opensarlab-notebooks Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
@Alex-Lewandowski
Hi,
When I run this step for InSAR analysis, I got this error. Previously I did not get any error like this, but suddenly now I am facing this issue. Please help me how to solve this problem.
Thank you for your time.
I was working through the Hazards/SARChangeDetectionMethods_From_Prepared_Data_Stack.ipynb notebook, which is based on data from the Exercise4A-SARChangeDetectionMethods.ipynb notebook.
At step 4. Create a Pandas Time Index and Display the VRT Band Dates, I encountered the following while running cell 14:
Create an index of timedelta64 data with Pandas:
tindex = pd.DatetimeIndex(dates)
tindex = pd.DatetimeIndex(dates)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
~/.local/envs/rtc_analysis/lib/python3.9/site-packages/pandas/core/arrays/datetimes.py in objects_to_datetime64ns(data, dayfirst, yearfirst, utc, errors, require_iso8601, allow_object)
2084 try:
-> 2085 values, tz_parsed = conversion.datetime_to_datetime64(data)
2086 # If tzaware, these values represent unix timestamps, so we
pandas/_libs/tslibs/conversion.pyx in pandas._libs.tslibs.conversion.datetime_to_datetime64()
TypeError: Unrecognized value type: <class 'str'>
During handling of the above exception, another exception occurred:
ParserError Traceback (most recent call last)
<ipython-input-14-3b54fb0f6ce4> in <module>
----> 1 tindex = pd.DatetimeIndex(dates)
~/.local/envs/rtc_analysis/lib/python3.9/site-packages/pandas/core/indexes/datetimes.py in __new__(cls, data, freq, tz, normalize, closed, ambiguous, dayfirst, yearfirst, dtype, copy, name)
305 name = maybe_extract_name(name, data, cls)
306
--> 307 dtarr = DatetimeArray._from_sequence_not_strict(
308 data,
309 dtype=dtype,
~/.local/envs/rtc_analysis/lib/python3.9/site-packages/pandas/core/arrays/datetimes.py in _from_sequence_not_strict(cls, data, dtype, copy, tz, freq, dayfirst, yearfirst, ambiguous)
324 freq, freq_infer = dtl.maybe_infer_freq(freq)
325
--> 326 subarr, tz, inferred_freq = sequence_to_dt64ns(
327 data,
328 dtype=dtype,
~/.local/envs/rtc_analysis/lib/python3.9/site-packages/pandas/core/arrays/datetimes.py in sequence_to_dt64ns(data, dtype, copy, tz, dayfirst, yearfirst, ambiguous)
1971 # data comes back here as either i8 to denote UTC timestamps
1972 # or M8[ns] to denote wall times
-> 1973 data, inferred_tz = objects_to_datetime64ns(
1974 data, dayfirst=dayfirst, yearfirst=yearfirst
1975 )
~/.local/envs/rtc_analysis/lib/python3.9/site-packages/pandas/core/arrays/datetimes.py in objects_to_datetime64ns(data, dayfirst, yearfirst, utc, errors, require_iso8601, allow_object)
2088 return values.view("i8"), tz_parsed
2089 except (ValueError, TypeError):
-> 2090 raise e
2091
2092 if tz_parsed is not None:
~/.local/envs/rtc_analysis/lib/python3.9/site-packages/pandas/core/arrays/datetimes.py in objects_to_datetime64ns(data, dayfirst, yearfirst, utc, errors, require_iso8601, allow_object)
2073
2074 try:
-> 2075 result, tz_parsed = tslib.array_to_datetime(
2076 data,
2077 errors=errors,
pandas/_libs/tslib.pyx in pandas._libs.tslib.array_to_datetime()
pandas/_libs/tslib.pyx in pandas._libs.tslib.array_to_datetime()
pandas/_libs/tslib.pyx in pandas._libs.tslib.array_to_datetime_object()
pandas/_libs/tslib.pyx in pandas._libs.tslib.array_to_datetime_object()
pandas/_libs/tslibs/parsing.pyx in pandas._libs.tslibs.parsing.parse_datetime_string()
~/.local/envs/rtc_analysis/lib/python3.9/site-packages/dateutil/parser/_parser.py in parse(timestr, parserinfo, **kwargs)
1372 return parser(parserinfo).parse(timestr, **kwargs)
1373 else:
-> 1374 return DEFAULTPARSER.parse(timestr, **kwargs)
1375
1376
~/.local/envs/rtc_analysis/lib/python3.9/site-packages/dateutil/parser/_parser.py in parse(self, timestr, default, ignoretz, tzinfos, **kwargs)
647
648 if res is None:
--> 649 raise ParserError("Unknown string format: %s", timestr)
650
651 if len(res) == 0:
ParserError: Unknown string format: _2018010
Hi @Alex-Lewandowski
When I am trying to run this cell in Jupyter Notebook, I get this error. Previously, I did not receive such a error during the InASR time series processing time, but suddenly I got this error. Please look into it and thank you for your time and consideration.
In Alaska Vertex, I have this project. But it is not showing in Jupyter Notebook.
Hello,
I ran the Lab2-SurfaceWaterExtentMapping.ipynb with the 'do_PP = True' (cell 38) to enable the Fuzzy logic post-processing. However, there was an error message in cell 39 saying that 'ValueError: output array is read-only. The log messages are below here. Did I do something that I am not supposed to do?
Thank you.
ValueError Traceback (most recent call last)
Cell In [40], line 109
107 ## HAND upper and lower fuzzy threshold calculation
108 maskedarray = np.ma.masked_where(maskimage==0, hand_interp)
--> 109 ma2 = np.ma.masked_where(maskedarray > np.percentile(maskedarray, 90), maskedarray)
110 hand_lowerlimit = np.ma.median(np.ma.masked_invalid(ma2))
111 hand_upperlimit = hand_lowerlimit + (np.ma.std(np.ma.masked_invalid(ma2)) + 3.5)*np.ma.std(np.ma.masked_invalid(ma2))
File <array_function internals>:180, in percentile(*args, **kwargs)
File ~/.local/envs/hydrosar/lib/python3.9/site-packages/numpy/lib/function_base.py:4166, in percentile(a, q, axis, out, overwrite_input, method, keepdims, interpolation)
4164 if not _quantile_is_valid(q):
4165 raise ValueError("Percentiles must be in the range [0, 100]")
-> 4166 return _quantile_unchecked(
4167 a, q, axis, out, overwrite_input, method, keepdims)
File ~/.local/envs/hydrosar/lib/python3.9/site-packages/numpy/lib/function_base.py:4424, in _quantile_unchecked(a, q, axis, out, overwrite_input, method, keepdims)
4416 def _quantile_unchecked(a,
4417 q,
4418 axis=None,
(...)
4421 method="linear",
4422 keepdims=False):
4423 """Assumes that q is in [0, 1], and is an ndarray"""
-> 4424 r, k = _ureduce(a,
4425 func=_quantile_ureduce_func,
4426 q=q,
4427 axis=axis,
4428 out=out,
4429 overwrite_input=overwrite_input,
4430 method=method)
4431 if keepdims:
4432 return r.reshape(q.shape + k)
File ~/.local/envs/hydrosar/lib/python3.9/site-packages/numpy/lib/function_base.py:3725, in _ureduce(a, func, **kwargs)
3722 else:
3723 keepdim = (1,) * a.ndim
-> 3725 r = func(a, **kwargs)
3726 return r, keepdim
File ~/.local/envs/hydrosar/lib/python3.9/site-packages/numpy/lib/function_base.py:4593, in _quantile_ureduce_func(a, q, axis, out, overwrite_input, method)
4591 else:
4592 arr = a.copy()
-> 4593 result = _quantile(arr,
4594 quantiles=q,
4595 axis=axis,
4596 method=method,
4597 out=out)
4598 return result
File ~/.local/envs/hydrosar/lib/python3.9/site-packages/numpy/lib/function_base.py:4710, in _quantile(arr, quantiles, axis, method, out)
4708 result_shape = virtual_indexes.shape + (1,) * (arr.ndim - 1)
4709 gamma = gamma.reshape(result_shape)
-> 4710 result = _lerp(previous,
4711 next,
4712 gamma,
4713 out=out)
4714 if np.any(slices_having_nans):
4715 if result.ndim == 0 and out is None:
4716 # can't write to a scalar
File ~/.local/envs/hydrosar/lib/python3.9/site-packages/numpy/lib/function_base.py:4530, in _lerp(a, b, t, out)
4528 # asanyarray is a stop-gap until gh-13105
4529 lerp_interpolation = asanyarray(add(a, diff_b_a * t, out=out))
-> 4530 subtract(b, diff_b_a * (1 - t), out=lerp_interpolation, where=t >= 0.5)
4531 if lerp_interpolation.ndim == 0 and out is None:
4532 lerp_interpolation = lerp_interpolation[()] # unpack 0d arrays
ValueError: output array is read-only
Hi @Alex-Lewandowski @khogenso @piyushrpt
Can you explain me the new modified part of area of interest section! It is quite difficult to find out the area of interest.
https://groups.google.com/g/mintpy/c/YBm7ZJATA5c
I ran into this issue yesterday using the MintPy_Time_Series_From_Prepared_Data_Stack.ipynb notebook. Updating the import line to read from mintpy.cli import view, tsview, plot_network, plot_transection
seemed to solve most of the issues.
Hi,
Don't know if this is the right place to report this. Most of us end up using jupyter via conda and looks like gdal3 build with conda might not be recognizing netcdf_mem.h correctly. If this is not an issue with custom build GDAL; then this should be reported to conda-forge/gdal-feedstock.
I remember this being addressed by OSGeo/gdal#1328
Here is a test script that shows that GRFN products are interpreted as HDF5:
#This is from https://media.asf.alaska.edu/uploads/InSAR/temporary_security_credentials.py
from json import loads
from requests import get
credential_url = 'https://grfn.asf.alaska.edu/door/credentials'
response = get(credential_url)
response.raise_for_status()
credentials = loads(response.text)['Credentials']
## This is how you use ASF s3 credentials with GDAL
from osgeo import gdal
gdal.SetConfigOption('AWS_REGION', 'us-east-1')
gdal.SetConfigOption('AWS_SECRET_ACCESS_KEY', credentials['SecretAccessKey'])
gdal.SetConfigOption('AWS_ACCESS_KEY_ID', credentials['AccessKeyId'])
gdal.SetConfigOption('AWS_SESSION_TOKEN', credentials['SessionToken'])
results = gdal.Info('/vsis3/grfn-content-prod/S1-GUNW-D-R-160-tops-20190710_20190628-162436-20935N_18926N-PP-6a53-v2_0_2.nc')
print(results)
Piyush
I process and finished InSAR using Mintpy and used the kmz file to view in google earth pro. it is only showing color bar.
but same file when i open using QGIS, i can see it but it freezes the qgis and i also can't use basemap.
Also, Is there way to give the coordinates as polygon vector of my area of interest instead of selecting an area. As it is not satellite image or also we cannot zoom in or zoom out. It is hard to select only the study area. I always end of selecting more area then necessary.
Server: SAR 1 - Test
When this notebook is started, the 'Python 3' env is loaded. It should default to the 'rtc_analysis' conda env.
This repository is currently licensed under the terms and conditions of the
GPL-3.0 license. GPL-3.0 is
copy-left which requires downstream projects to use the same license, prohibits
commercial use, and is not the NASA ESDS Open Source Software Policy.
ASF would like to change this repositories license to a permissive-use BSD-3 license
in order to be compliant with ESDS policy and be less restrictive to downstream projects.
ASF will only re-license notebooks that have approval from 100% of their named contributors.
Contributors will be contacted via email, and responses will be gathered via email responses
or comments on this issue.
Contributor | Affiliation | Date Contacted | Response | Response source |
---|---|---|---|---|
P.S. Agram | Descartes Labs | 2021-04-06 | Approved | comment |
M.S. Baker | UNAVCO | |||
David Bekaert | JPL | 2021-04-06 & 2021-04-21 | Approved | |
Rowan Biessel | ASF | 2021-04-06 | Approved | Mattermost |
A Donnellan | JPL | 2021-04-06 & 2021-04-21 | Approved | |
Heresh Fattahi | JPL | 2021-04-06 & 2021-04-21 | ||
Eric Fielding | JPL | 2021-04-06 | Approved | |
G. Funning | UC Riverside | 2021-04-06 | Approved | |
S Hensley | JPL | 2021-04-06 & 2021-04-21 | ||
MinJeong Jo | NASA | 2021-04-06 & 2021-04-21 | Approved | |
Josef Kellndorfer | Earth Big Data, LLC | 2021-04-06 & 2021-04-21 | Approved | comment |
Joseph Kennedy | ASF | 2021-04-01 | Approved | in-person |
Joshua J C Knicely | UAF | 2021-04-06 | Approved | |
Alex Lewandowski | ASF | 2021-04-01 | Approved | in-person |
Franz Meyer | ASF | 2021-04-06 | Approved | in-person |
Lichao Mou | German Aerospace Center | 2021-04-06 | Approved | |
Jim Nelson | BYU | 2021-04-06 | Approved | |
NISAR Solid Earth Team | n/a | |||
Batuhan Osmanoglu | NASA | 2021-04-06 | Approved | comment |
Paul Rosen | JPL | 2021-04-06 & 2021-04-21 | ||
Zhang Yunjun | Caltech | 2021-04-06 | Approved | |
Xiaoxiang Zhu | German Aerospace Center | 2021-04-06 | Approved |
Any notebooks not fully approved for re-licensing will retain their GPL-3.0 license,
which may necessitate their removal from the asf-jupyter-notebook repository.
Below is a list of notebooks whose contributors have denied relicensing and
will need to either maintain their current license or be removed from the repository.
The strategy moving forward for these notebooks will be determined at a later date, with
input from all relevant contributors.
The latest update of Mintpy requires the imports be modified slightly. I think the code below should work.
from mintpy import plot_coherence_matrix
from mintpy.cli import view, tsview, plot_network, plot_transection
@Alex-Lewandowski @khogenso @piyushrpt Hello, first of all, thank you for the work done. Within the scope of Opensciencelab, I processed my human data with h3py + mintpy notebooks and created displacement maps in the LOS direction. However, using my results from ascending and descending orbits, I want to separate the LOS direction into vertical and horizontal components. Can you help, if there is any solution for this I may have missed it.
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.