-
Notifications
You must be signed in to change notification settings - Fork 308
ERS stack processing #736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yjzhenglamarmota
wants to merge
42
commits into
isce-framework:main
Choose a base branch
from
yjzhenglamarmota:ersStack
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
ERS stack processing #736
Changes from 8 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
cffd66d
Bug on alosStack
MYIP003 3fab206
Added gdal2isce_xml when running multilook gdal
bjmarfito ccef89a
bugfix in `cuDenseOffsets.py --full/out-geom` for topsApp product
yunjunz 077615a
adding scripts -preparing ERS for stack processing
yjzhenglamarmota 1be3ad7
Combine prepareERS_ENVstack,py with unpackFrame_ERS_ENV.py in the lat…
yjzhenglamarmota 84b7a4f
Fix bugs
yjzhenglamarmota 9bf4721
Add geolocation constraint option
yjzhenglamarmota 5d62ff7
Update unpackFrame_ERS_ENV.py
yjzhenglamarmota 704085d
Update ODR.py
yjzhenglamarmota 2de84c0
adding scripts -preparing ERS for stack processing
yjzhenglamarmota f226619
Combine prepareERS_ENVstack,py with unpackFrame_ERS_ENV.py in the lat…
yjzhenglamarmota 9bc1ba8
Added "char" type in ALOS_fbd2fbsmodule.c and ALOS_fbs2fbdmodule.c (#…
EJFielding 61f6731
add symlink in dockerfile
vincentschut f92e190
Merge pull request #823 from vincentschut/add-isce-to-isce2-symlink-i…
rtburns-jpl 7bf93ad
prepSlcALOS2: support alosStack convention via --alosStack option
yunjunz 7c0cb3c
alosStack: ignore non-numeric folders in the data/download dir
yunjunz 652c1fb
Merge pull request #687 from MYIP003/patch-1
rtburns-jpl 3012f28
Merge pull request #834 from yunjunz/alos_stack
rtburns-jpl 2402adf
Merge pull request #703 from bjmarfito/patch-1
rtburns-jpl f7291b1
Update fetchOrbit.py for new Copernicus data source (#801)
rtburns-jpl adf8166
docs: always use 4-digit frame number for alos2 (#708)
yunjunz ca7649a
Process Lutan-1 stripmap SLC images using stripmapApp.py (#852)
bjmarfito b231d6e
removing azimuth burst ramps caused by ionosphere in topsStack (#600)
CunrenLiang b011e46
Fix for dloadOrbits.py to reflect new download URL and minor fix in f…
bjmarfito 14bcd5f
Update README.md
bjmarfito 09a3198
fix some incorrect pointer types as required by newer gcc compilers
b39ddca
patch the time.h error for g++14
51b9c6c
Merge pull request #897 from lijun99/modern-c
rtburns-jpl 50bf3f3
Remove extraneous tab chars from topsStack readme
rtburns-jpl 0550490
Merge pull request #886 from bjmarfito/readme_fix
rtburns-jpl fd7a0ab
Bugfix plot ion topsStack (#885)
bjmarfito 0e2124f
Merge pull request #709 from yunjunz/bugfix_pycuampcor
rtburns-jpl 1402e2f
adding scripts -preparing ERS for stack processing
yjzhenglamarmota ff44032
Combine prepareERS_ENVstack,py with unpackFrame_ERS_ENV.py in the lat…
yjzhenglamarmota 6e6372c
Fix bugs
yjzhenglamarmota c50cc11
Add geolocation constraint option
yjzhenglamarmota 44d5428
Update unpackFrame_ERS_ENV.py
yjzhenglamarmota b00074e
Update ODR.py
yjzhenglamarmota 1a3e454
adding scripts -preparing ERS for stack processing
yjzhenglamarmota 1b8eb45
Combine prepareERS_ENVstack,py with unpackFrame_ERS_ENV.py in the lat…
yjzhenglamarmota c31b467
Merge branch 'ersStack' of https://github.com/yjzhenglamarmota/isce2 …
yjzhenglamarmota 0d7c3b7
Removed commented code as suggested by hfattahi.
yjzhenglamarmota File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| #!/usr/bin/env python3 | ||
|
|
||
| import isce | ||
| from isceobj.Sensor import createSensor | ||
| import isceobj | ||
| import shelve | ||
| import argparse | ||
| import glob | ||
| from isceobj.Util import Poly1D | ||
| from isceobj.Planet.AstronomicalHandbook import Const | ||
| import os | ||
| import datetime | ||
| import numpy as np | ||
|
|
||
| def cmdLineParse(): | ||
| ''' | ||
| Command line parser. | ||
| ''' | ||
|
|
||
| parser = argparse.ArgumentParser(description='Unpack ERS(ESA) SLC data and store metadata in pickle file.') | ||
| parser.add_argument('-i','--input', dest='datadir', type=str, | ||
| required=True, help='Input ERS files path') | ||
| parser.add_argument('-b', '--box' ,dest='bbox', type=float, nargs=4, default=None, | ||
| help='Bbox (SNWE in degrees)') | ||
| parser.add_argument('-o', '--output', dest='slcdir', type=str, | ||
| required=True, help='Output SLC directory') | ||
| parser.add_argument('--orbitdir', dest='orbitdir', type=str, required=True, help='Orbit directory') | ||
| parser.add_argument('--orbittype',dest='orbittype', type = str, default='ODR', help='ODR, PDS, PDS') | ||
| return parser.parse_args() | ||
|
|
||
| def get_Date(file): | ||
| yyyymmdd=file[14:22] | ||
| return yyyymmdd | ||
|
|
||
| def write_xml(shelveFile, slcFile): | ||
| with shelve.open(shelveFile,flag='r') as db: | ||
| frame = db['frame'] | ||
|
|
||
| length = frame.numberOfLines | ||
| width = frame.numberOfSamples | ||
| print (width,length) | ||
|
|
||
| slc = isceobj.createSlcImage() | ||
| slc.setWidth(width) | ||
| slc.setLength(length) | ||
| slc.filename = slcFile | ||
| slc.setAccessMode('write') | ||
| slc.renderHdr() | ||
| slc.renderVRT() | ||
|
|
||
| def unpack(fname, slcname, orbitdir, orbittype): | ||
| ''' | ||
| Unpack .E* file to binary SLC file. | ||
| ''' | ||
|
|
||
| obj = createSensor('ERS_ENviSAT_SLC') | ||
| obj._imageFileName = fname | ||
| obj._orbitDir = orbitdir | ||
| obj._orbitType = orbittype | ||
| #obj.instrumentDir = '/Users/agram/orbit/INS_DIR' | ||
| obj.output = os.path.join(slcname,os.path.basename(slcname)+'.slc') | ||
| obj.extractImage() | ||
| obj.frame.getImage().renderHdr() | ||
| obj.extractDoppler() | ||
|
|
||
| # #### computation of "poly" adapted from line 339 - line 353 of Components/isceobj/Sensor/ERS_EnviSAT_SLC.py ### | ||
| ####### removed this section and added obj.extractDoppler() above instead. Doesn't seem to change anything in the processing. The latter is required for cropFrame. | ||
| # coeffs = obj.dopplerRangeTime | ||
| # dr = obj.frame.getInstrument().getRangePixelSize() | ||
| # rref = 0.5 * Const.c * obj.rangeRefTime | ||
| # r0 = obj.frame.getStartingRange() | ||
| # norm = 0.5 * Const.c / dr | ||
|
|
||
| # dcoeffs = [] | ||
| # for ind, val in enumerate(coeffs): | ||
| # dcoeffs.append( val / (norm**ind)) | ||
|
|
||
| # poly = Poly1D.Poly1D() | ||
| # poly.initPoly(order=len(coeffs)-1) | ||
| # poly.setMean( (rref - r0)/dr - 1.0) | ||
| # poly.setCoeffs(dcoeffs) | ||
|
||
|
|
||
|
|
||
| pickName = os.path.join(slcname, 'data') | ||
| with shelve.open(pickName) as db: | ||
| db['frame'] = obj.frame | ||
| # db['doppler'] = poly | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| ''' | ||
| Main driver. | ||
| ''' | ||
|
|
||
| inps = cmdLineParse() | ||
| if inps.slcdir.endswith('/'): | ||
| inps.slcdir = inps.slcdir[:-1] | ||
| if not os.path.isdir(inps.slcdir): | ||
| os.mkdir(inps.slcdir) | ||
| for fname in glob.glob(os.path.join(inps.datadir, '*.E*')): | ||
| date = get_Date(os.path.basename(fname)) | ||
| slcname = os.path.abspath(os.path.join(inps.slcdir, date)) | ||
| os.makedirs(slcname, exist_ok=True) | ||
|
|
||
| print(fname) | ||
| unpack(fname, slcname, inps.orbitdir, inps.orbittype) | ||
|
|
||
| slcFile = os.path.abspath(os.path.join(slcname, date+'.slc')) | ||
|
|
||
| shelveFile = os.path.join(slcname, 'data') | ||
| write_xml(shelveFile,slcFile) | ||
|
|
||
| if inps.bbox is not None: | ||
| slccropname = os.path.abspath(os.path.join(inps.slcdir+'_crop',date)) | ||
| os.makedirs(slccropname, exist_ok=True) | ||
| cmd = 'cropFrame.py -i {} -o {} -b {}'.format(slcname, slccropname, ' '.join([str(x) for x in inps.bbox])) | ||
| print(cmd) | ||
| os.system(cmd) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the commented code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.