Comments (6)
(I don't mean this is a bug necessarily, it is probably just me not understanding how to open the file correctly, it seems the bug label was added automatically and I can't see how to remove it. Sorry!)
from pyrosar.
Dear @StephanLo,
thanks for reaching out. In principle Tandem-x CoSSC should be supported.
The driver is TDX
. This is a community contribution and I have never tried the driver iteself.
For reading a product you need to provide the top folder of the product instead of the XML file.
Could you try importing this class directly and try to identify the top folder of your product?
from pyroSAR.drivers import TDX
scene = TDX('top product folder')
If this does not work, what is the error message?
from pyrosar.
Dear @johntruckenbrodt
Thanks for your response
It worked thank you! Expect that I think it is maybe TDM instead of TDX, as in documentation
from pyroSAR.drivers import TDM
scene = TDM(Path(data_dir, name).as_posix())
print(scene)
Loads the product properly:
pyroSAR ID object of type TDM
acquisition_mode: SM
cycleNumber: 430
frameNumber: 2673131
lines: 28234
orbit: A
orbitNumber_abs: 71776
orbitNumber_rel: 133
polarizations: ['HH']
product: COSSC
projection: +proj=longlat +datum=WGS84 +no_defs
samples: 17438
sensor: TDM1
spacing: (0.00028334792733302643, 9.10033168464242e-09)
start: 20200524T212643
stop: 20200524T212651
However, I'm still struggling, because identify doesn't seem to work, despite the same parent product directory being supplied.
from pathlib import Path
from pyroSAR import identify
data_dir = Path("E:/stephan/files/Landfill/dem_timeseries/vanZyl_sites")
name = "TDM1_SAR__COS_BIST_SM_S_SRA_20200524T212643_20200524T212651"
identify(Path(data_dir, name).as_posix())
gives error
File [c:\Users\stephan\mambaforge\envs\for_snap\Lib\site-packages\pyroSAR\drivers.py:125](file:///C:/Users/stephan/mambaforge/envs/for_snap/Lib/site-packages/pyroSAR/drivers.py:125), in identify(scene)
[123](file:///c%3A/Users/stephan/mambaforge/envs/for_snap/Lib/site-packages/pyroSAR/drivers.py?line=122) except (RuntimeError, KeyError, AttributeError):
[124](file:///c%3A/Users/stephan/mambaforge/envs/for_snap/Lib/site-packages/pyroSAR/drivers.py?line=123) pass
--> [125](file:///c%3A/Users/stephan/mambaforge/envs/for_snap/Lib/site-packages/pyroSAR/drivers.py?line=124) raise RuntimeError('data format not supported')
RuntimeError: data format not supported
And, it seems the gpt command from pyroSAR.snap.auxil calls the identify function internally, so gpt then fails for the TDM CoSSC data, because identify returns the same 'data not supported' error
my_graph = "[...]/graphs/pyro_tandemx_to_snaphu.xml"
from pyroSAR.snap.auxil import gpt
gpt(my_graph, tmpdir= Path(data_dir, 'tmp'))
Error message:
from pyroSAR.snap.auxil import gpt
----> [158](file:///c%3A/Users/stephan/hokudai/PhD/Landfill/Code/SAR_idea/python/snap/tandem_X.qmd?line=157) gpt(my_graph, tmpdir= Path(data_dir, 'tmp'))
File [c:\Users\stephan\mambaforge\envs\for_snap\Lib\site-packages\pyroSAR\snap\auxil.py:363](file:///C:/Users/stephan/mambaforge/envs/for_snap/Lib/site-packages/pyroSAR/snap/auxil.py:363), in gpt(xmlfile, tmpdir, groups, cleanup, gpt_exceptions, gpt_args, removeS1BorderNoiseMethod)
[361](file:///c%3A/Users/stephan/mambaforge/envs/for_snap/Lib/site-packages/pyroSAR/snap/auxil.py?line=360) else:
[362](file:///c%3A/Users/stephan/mambaforge/envs/for_snap/Lib/site-packages/pyroSAR/snap/auxil.py?line=361) read = workflow['Read']
--> [363](file:///c%3A/Users/stephan/mambaforge/envs/for_snap/Lib/site-packages/pyroSAR/snap/auxil.py?line=362) scene = identify(read.parameters['file'])
[365](file:///c%3A/Users/stephan/mambaforge/envs/for_snap/Lib/site-packages/pyroSAR/snap/auxil.py?line=364) tmpdir_bnr = os.path.join(tmpdir, 'bnr')
[366](file:///c%3A/Users/stephan/mambaforge/envs/for_snap/Lib/site-packages/pyroSAR/snap/auxil.py?line=365) tmpdir_sub = os.path.join(tmpdir, 'sub')
File [c:\Users\stephan\mambaforge\envs\for_snap\Lib\site-packages\pyroSAR\drivers.py:125](file:///C:/Users/stephan/mambaforge/envs/for_snap/Lib/site-packages/pyroSAR/drivers.py:125), in identify(scene)
[123](file:///c%3A/Users/stephan/mambaforge/envs/for_snap/Lib/site-packages/pyroSAR/drivers.py?line=122) except (RuntimeError, KeyError, AttributeError):
[124](file:///c%3A/Users/stephan/mambaforge/envs/for_snap/Lib/site-packages/pyroSAR/drivers.py?line=123) pass
--> [125](file:///c%3A/Users/stephan/mambaforge/envs/for_snap/Lib/site-packages/pyroSAR/drivers.py?line=124) raise RuntimeError('data format not supported')
RuntimeError: data format not supported
Do you have any advice on this?
Thank you for the assistance!
kindly
Stephan
from pyrosar.
Just another comment that I think might be of interest,
I think the problem is maybe specific to the TDM driver for CoSSC data.
Because, identify works for TSX products
Basically, In the CoSSC product folder there are two sub-directories (for each of the two co-registered scenes)
And, if I supply one of the sub-directories to identify, it succeeds, and sees the loaded product as a TSX product.
(the same sub-directory can also be read directly with the TSX driver)
from pathlib import Path
from pyroSAR import identify
data_dir = Path("E:/stephan/files/Landfill/dem_timeseries/vanZyl_sites")
# rio 2020
name = "TDM1_SAR__COS_BIST_SM_S_SRA_20200524T212643_20200524T212651"
# The sub directory for one of the coregistered scenes
sub_name = "TDX1_SAR__SSC_BTX1_SM_S_SRA_20200524T212643_20200524T212651"
scene = identify(Path(data_dir, name, sub_name).as_posix())
print(scene)
Output:
pyroSAR ID object of type TSX
acquisition_mode: SM
cycleNumber: 430
frameNumber: 2673131
lines: 28234
orbit: A
orbitNumber_abs: 71776
orbitNumber_rel: 133
polarizations: ['HH']
product: SSC
projection: +proj=longlat +datum=WGS84 +no_defs
samples: 17438
sensor: TDX1
spacing: (0.00028334792733302643, 9.10033168464242e-09)
start: 20200524T212643
stop: 20200524T212651
from pyrosar.
Dear @StephanLo. I have found the error and will merge the fix in a minute. Thanks again.
from pyrosar.
Thank you very much!
from pyrosar.
Related Issues (20)
- Geocode function stopped working: requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0) HOT 1
- S1 OSV download from CDSE
- Error when running pyroSAR.snap.geocode HOT 1
- Issue with RuntimeError: data format not supported HOT 3
- S1 OSV download from ASF HOT 2
- fix one cause for GammaUnknownError: calloc_2d: memory allocation error for data values HOT 2
- Issue with GeoCode in last version of pyroSAR HOT 4
- Additional workflow on ENVI file output from geocode HOT 2
- Problem with orbit files HOT 5
- [Archive] use geometry instead of bounding box HOT 6
- Support for scenes from CDSE
- Help starting with PyroSAR HOT 12
- 'NoneType' object has no attribute 'text' with removeS1BorderNoiseMethod='pyroSAR' and old S-1 datasets HOT 3
- cann't use snap HOT 15
- Handling of outdated lock files
- [Lock] add log message when trying to acquire lock on already locked file
- Error importing geocode when using pyroSAR 0.26 installed from pip HOT 3
- Gammaparse autoparser adds gamma definitions on each import.
- about ASAR data
- RuntimeError: cannot read version information from. Please restart SNAP. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyrosar.