Skip to content
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

Geogrid update for post-processing correction #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

leiyangleon
Copy link
Collaborator

update Geogrid to support parsing the S1 SAFE zip file and getting the radar image and orbit metadata without the need to run ISCE thru the topo step

…e radar image and orbit metadata without the need to run ISCE thru the topo step
info.orbit = getMergedOrbit(frames)

return info

def loadParsedata(indir,buffer=0):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def loadParsedata(indir,buffer=0):
def loadParsedata(indir, orbit_dir, aux_dir, buffer=0):

Comment on lines +169 to +170
rdr.orbitDir='/Users/yanglei/orbit/S1A/precise'
rdr.auxDir='/Users/yanglei/orbit/S1A/aux'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rdr.orbitDir='/Users/yanglei/orbit/S1A/precise'
rdr.auxDir='/Users/yanglei/orbit/S1A/aux'
rdr.orbitDir=orbit_dir
rdr.auxDir='aux_dir

These are hard-coded to your system, so they'll need to be input parameters.

Comment on lines +436 to +437
metadata_m = loadParsedata(inps.indir_m,inps.buffer)
metadata_s = loadParsedata(inps.indir_s,inps.buffer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
metadata_m = loadParsedata(inps.indir_m,inps.buffer)
metadata_s = loadParsedata(inps.indir_s,inps.buffer)
metadata_m = loadParsedata(inps.indir_m, inps.orbit_dir, inputs.aux_dir, inps.buffer)
metadata_s = loadParsedata(inps.indir_s, inps.orbit_dir, inputs.aux_dir, inps.buffer)

Comment on lines +72 to +73
parser.add_argument('-p', '--parse', dest='parse', action='store_true',
default=False, help='Parse the SAFE zip file to get radar image and orbit metadata; no need to run ISCE')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
parser.add_argument('-p', '--parse', dest='parse', action='store_true',
default=False, help='Parse the SAFE zip file to get radar image and orbit metadata; no need to run ISCE')
parser.add_argument('-p', '--parse', dest='parse', action='store_true',
default=False, help='Parse the SAFE zip file to get radar image and orbit metadata; no need to run ISCE')
parser.add_argument('--orbit-dir', hep='Directory of Sentinel-1 orbit files')
parser.add_argument('--aux-dir', hep='Directory of Sentinel-1 aux files')

jhkennedy added a commit to ASFHyP3/hyp3-autorift that referenced this pull request May 26, 2023
rdr.orbitDir='/Users/yanglei/orbit/S1A/precise'
rdr.auxDir='/Users/yanglei/orbit/S1A/aux'
rdr.swathNumber=swath
rdr.polarization='hh'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also hard-coded and should be parsed from the SLC name. Can use a function like:

from typing import Tuple
from pathlib import Path


def get_polarizations(s1_safe: str) -> Tuple[str]:
    mapping = {
        'SH': ('hh',),
        'SV': ('vv',),
        'DH': ('hh', 'hv'),
        'DV': ('vv', 'vh'),
    }
    key = Path(s1_safe).name[14:16]
    return mapping[key]

and selected like:

Suggested change
rdr.polarization='hh'
rdr.polarization=get_polarizations(indir)[0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants