Skip to content

Commit

Permalink
diversity: replaced oppressive language with neutral definitions of t…
Browse files Browse the repository at this point in the history
…he images that comprise an interferogram through the entire repository
  • Loading branch information
parosen committed Jul 2, 2020
1 parent edea69d commit e03042f
Show file tree
Hide file tree
Showing 435 changed files with 6,254 additions and 6,074 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ git reset --hard origin/master

```
git checkout master
(potentially update your local master against upstream, as described above)
(potentially update your local reference against upstream, as described above)
git checkout -b my_new_feature_branch
# do work. For example:
Expand Down
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ for example:
>>> f = open("PICKLE/formslc")
>>> import pickle
>>> a = pickle.load(f)
>>> o = f.getMasterOrbit()
>>> o = f.getReferenceOrbit()
>>> t, x, p, off = o._unpackOrbit()
>>> print(t)
>>> print(x)
Expand Down Expand Up @@ -529,7 +529,7 @@ The basic (ALOS) input file looks like this (indentation is optional):
<stripmapApp>
<component name="stripmapApp">
<property name="sensor name">ALOS</property>
<component name="Master">
<component name="Reference">
<property name="IMAGEFILE">
/a/b/c/20070215/IMG-HH-ALPSRP056480670-H1.0__A
</property>
Expand All @@ -538,7 +538,7 @@ The basic (ALOS) input file looks like this (indentation is optional):
</property>
<property name="OUTPUT">20070215</property>
</component>
<component name="Slave">
<component name="Secondary">
<property name="IMAGEFILE">
/a/b/c/20061231/IMG-HH-ALPSRP049770670-H1.0__A
</property>
Expand All @@ -564,7 +564,7 @@ properties and other components that are configurable. The property tags
give the values of a single variable in the ISCE code. One of the properties
defined in stripmapApp.py is the "sensor name" property. In the above example
it is given the value ALOS. In order to run stripmapApp.py two images need to
be specified. These are defined as components named 'Master' and 'Slave'.
be specified. These are defined as components named 'Reference' and 'Secondary'.
These components have properties named 'IMAGEFILE', 'LEADERFILE', and 'OUTPUT'
with the values given in the above example.

Expand All @@ -587,10 +587,10 @@ between three files as follows:
<stripmapApp>
<component name="insar">
<property name="Sensor name">ALOS</property>
<component name="master">
<component name="reference">
<catalog>20070215.xml</catalog>
</component>
<component name="slave">
<component name="secondary">
<catalog>20061231.xml</catalog>
</component>
</component>
Expand All @@ -600,7 +600,7 @@ between three files as follows:
#### 20070215.xml

```xml
<component name="Master">
<component name="Reference">
<property name="IMAGEFILE">
/a/b/c/20070215/IMG-HH-ALPSRP056480670-H1.0__A
</property>
Expand All @@ -614,7 +614,7 @@ between three files as follows:
#### 20061231.xml

```xml
<component name="Slave">
<component name="Secondary">
<property name="IMAGEFILE">
/a/b/c/20061231/IMG-HH-ALPSRP049770670-H1.0__A
</property>
Expand All @@ -636,7 +636,7 @@ The inputs are Sentinel GRD zipfiles
<property name="epsg id">32618</property>
<property name="geocode spacing">100</property>
<property name="geocode interpolation method">bilinear</property>
<component name="master">
<component name="reference">
<property name="safe">$dir$/rtcApp/data/S1A_IW_GRDH_1SDV_20181221T225104_20181221T225129_025130_02C664_B46C.zip</property>
<property name="orbit directory">$dir$/orbits</property>
<property name="output directory">$dir$/rtcApp/output</property>
Expand Down Expand Up @@ -679,7 +679,7 @@ This line creates an instance of the class Insar (that is given the family name
Other applications could be created that could make several different instances
of the Insar. Each instance would have the family name "insar" and would be
given a unique instance name. This is possible for every component. In the
above example xml files instances name "Master" and "Slave" of a family named
above example xml files instances name "Reference" and "Secondary" of a family named
"alos" are created.

### Component Configuration Files: Locations, Names, Priorities
Expand Down Expand Up @@ -710,23 +710,23 @@ the filename can be anything you choose. Configuration parameters can also be
entered directly on the command line as in the following example:

```bash
> stripmapApp.py insar.master.output=master_c.raw
> stripmapApp.py insar.reference.output=reference_c.raw
```

This example indicates that the variable named 'output' of the Component
named 'master' belonging to the Component (or Application) named 'insar'
will be given the name "master\_c.raw".
named 'reference' belonging to the Component (or Application) named 'insar'
will be given the name "reference\_c.raw".

The priority sequence on the command line goes from lowest priority on the left
to highest priority on the right. So, if we use the command line,

```bash
> stripmapApp.py myInputFile.xml insar.master.output=master_c.raw
> stripmapApp.py myInputFile.xml insar.reference.output=reference_c.raw
```

where the myInputFile.xml file also gives a value for the insar master output
file as master\_d.raw, then the one defined on the right will win, i.e.,
master\_c.raw.
where the myInputFile.xml file also gives a value for the insar reference output
file as reference\_d.raw, then the one defined on the right will win, i.e.,
reference\_c.raw.

(2) The next priority location is the local directory in which stripmapApp.py is
executed. Any xml file placed in this directory named according to either the
Expand Down Expand Up @@ -799,16 +799,16 @@ will see that the call to \_\_init\_\_ passes 'family=self.class.family' and
'name=name' to the Component constructor (super class of Ampcor). The family
name is given as "nstage" on line 265. The instance name is passed as the
value of the 'name=name' and was passed to it from whatever program created it.
Nstage is created in components/isceobj/StripmapProc/runRefineSlaveTiming.py where
it is given the name 'master_offset1' on line 35. If you are setting a parameter that
Nstage is created in components/isceobj/StripmapProc/runRefineSecondaryTiming.py where
it is given the name 'reference_offset1' on line 35. If you are setting a parameter that
should be the same for all uses of Ampcor, then you can use the
family name 'ampcor' for the name of the xml file as 'ampcor.xml'. It is more
likely that you will want to use the instance name 'master\_offset1.xml'
likely that you will want to use the instance name 'reference\_offset1.xml'
Use the family name 'ampcor' for the component tag 'name'.

Example for SLC matching use of Ampcor:

Filename: master\_offset1.xml:
Filename: reference\_offset1.xml:

```xml
<dummy>
Expand Down
16 changes: 8 additions & 8 deletions applications/ISCE2ROIPAC.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def __init__(self, xmlfile='insarProc.xml'):
def raw_rsc(self, key=None, write=False):
'''Write out the RSC files for Raw data.'''

if key not in ['master', 'slave']:
raise ValueError('Raw Files can only be written for master or slave.')
if key not in ['reference', 'secondary']:
raise ValueError('Raw Files can only be written for reference or secondary.')


rsc = OrderedDict()
Expand Down Expand Up @@ -137,8 +137,8 @@ def slc_rsc(self, key=None, raw=None, write=False):
Create rsc files for all the interferograms generated by ISCE.
'''

if key not in ['master', 'slave']:
raise ValueError('SLC files can only be written for master or slave.')
if key not in ['reference', 'secondary']:
raise ValueError('SLC files can only be written for reference or secondary.')

if raw is None:
rsc = self.raw_rsc(key=key, write=False)
Expand Down Expand Up @@ -221,8 +221,8 @@ def slc_rsc(self, key=None, raw=None, write=False):
'''Run the test on input xml file.'''

converter = insarProcXML()
master_raw_rsc = converter.raw_rsc(key='master', write=True)
slave_raw_rsc = converter.raw_rsc(key='slave', write=True)
reference_raw_rsc = converter.raw_rsc(key='reference', write=True)
secondary_raw_rsc = converter.raw_rsc(key='secondary', write=True)

master_slc_rsc = converter.slc_rsc(raw=master_raw_rsc, key='master', write=True)
slave_slc_rsc = converter.slc_rsc(raw=slave_raw_rsc, key='slave', write=True)
reference_slc_rsc = converter.slc_rsc(raw=reference_raw_rsc, key='reference', write=True)
secondary_slc_rsc = converter.slc_rsc(raw=secondary_raw_rsc, key='secondary', write=True)
62 changes: 31 additions & 31 deletions applications/PrepareStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def computeLookAngle(self):
self.slook = np.sqrt(1-self.clook**2)
# print('Estimated Look Angle: %3.2f degrees'%(np.arccos(self.clook)*180.0/np.pi))

def getBaseline(self, slave):
def getBaseline(self, secondary):
'''Compute baseline between current object and another orbit object.'''

ind = np.int(self.nvec/2)
Expand All @@ -93,17 +93,17 @@ def getBaseline(self, slave):
vvec = np.cross(crp, rvec)
mvel = np.linalg.norm(mvel)

ind = np.int(slave.nvec/2) #First guess
spos = np.array(slave.pos[ind])
svel = np.array(slave.vel[ind])
ind = np.int(secondary.nvec/2) #First guess
spos = np.array(secondary.pos[ind])
svel = np.array(secondary.vel[ind])
svel = np.linalg.norm(svel)

dx = spos - mpos;
z_offset = slave.prf*np.dot(dx, vvec)/mvel
z_offset = secondary.prf*np.dot(dx, vvec)/mvel

ind = np.int(ind - z_offset) #Refined estimate
spos = slave.pos[ind]
svel = slave.vel[ind]
spos = secondary.pos[ind]
svel = secondary.vel[ind]
svel = np.linalg.norm(svel)

dx = spos-mpos
Expand Down Expand Up @@ -169,16 +169,16 @@ def __call__(self, parser, args, values, option_string=None):
Days = np.zeros(nSar)

#######Setting the first scene as temporary reference.
master = Orbits[0]
reference = Orbits[0]


Dopplers[0] = master.fd
Days[0] = master.dt.toordinal()
Dopplers[0] = reference.fd
Days[0] = reference.dt.toordinal()
for k in xrange(1,nSar):
slave = Orbits[k]
Bperp[k] = master.getBaseline(slave)
Dopplers[k] = slave.fd
Days[k] = slave.dt.toordinal()
secondary = Orbits[k]
Bperp[k] = reference.getBaseline(secondary)
Dopplers[k] = secondary.fd
Days[k] = secondary.dt.toordinal()


print("************************************")
Expand All @@ -193,7 +193,7 @@ def __call__(self, parser, args, values, option_string=None):

geomRho = (1-np.clip(np.abs(Bperp[:,None]-Bperp[None,:])/inps.Bcrit, 0., 1.))
tempRho = np.exp(-1.0*np.abs(Days[:,None]-Days[None,:])/inps.Tau)
dopRho = (np.abs(Dopplers[:,None] - Dopplers[None,:])/ master.prf) < inps.dop
dopRho = (np.abs(Dopplers[:,None] - Dopplers[None,:])/ reference.prf) < inps.dop

Rho = geomRho * tempRho * dopRho
for kk in xrange(nSar):
Expand All @@ -205,17 +205,17 @@ def __call__(self, parser, args, values, option_string=None):

####Currently sorting on average coherence.

masterChoice = np.argsort(avgRho)
masterOrbit = Orbits[masterChoice[0]]
masterBperp = Bperp[masterChoice[0]]
referenceChoice = np.argsort(avgRho)
referenceOrbit = Orbits[referenceChoice[0]]
referenceBperp = Bperp[referenceChoice[0]]


print('*************************************')
print('Ranking for Master Scene Selection: ')
print('Ranking for Reference Scene Selection: ')
print('**************************************')
print('Rank Index Date nViable Avg. Coh.' )
for kk in xrange(nSar):
ind = masterChoice[kk]
ind = referenceChoice[kk]
print('{0:>3} {1:>3} {2:>10} {3:>4} {4:>2.3f}'.format(kk+1, ind+1, Orbits[ind].dt.strftime('%Y-%m-%d'), numViable[ind], avgRho[ind]))

print('***************************************')
Expand All @@ -234,31 +234,31 @@ def __call__(self, parser, args, values, option_string=None):

[ii,jj] = np.where(Rho > inps.cThresh)

print('Master Slave Bperp Deltat')
print('Reference Secondary Bperp Deltat')
for mind, sind in itertools.izip(ii,jj):
master = Orbits[mind]
slave = Orbits[sind]
if master.dt > slave.dt:
print('{0:>10} {1:>10} {2:>4.2f} {3:>4.2f}'.format(master.dt.strftime('%Y-%m-%d'), slave.dt.strftime('%Y-%m-%d'), Bperp[mind]-Bperp[sind], Days[mind] - Days[sind]))
xmlname = '%s/insar_%s_%s.xml'%(inps.dirname, master.dt.strftime('%Y%m%d'), slave.dt.strftime('%Y%m%d'))
reference = Orbits[mind]
secondary = Orbits[sind]
if reference.dt > secondary.dt:
print('{0:>10} {1:>10} {2:>4.2f} {3:>4.2f}'.format(reference.dt.strftime('%Y-%m-%d'), secondary.dt.strftime('%Y-%m-%d'), Bperp[mind]-Bperp[sind], Days[mind] - Days[sind]))
xmlname = '%s/insar_%s_%s.xml'%(inps.dirname, reference.dt.strftime('%Y%m%d'), secondary.dt.strftime('%Y%m%d'))

# sarxml.sartoinsarXML(master.filename, slave.filename, base=inps.base, out=xmlname)
# sarxml.sartoinsarXML(reference.filename, secondary.filename, base=inps.base, out=xmlname)


print('***************************************')

#######Currently picks master peg point.
#######Currently picks reference peg point.
print('***************************************')
commonPeg = masterOrbit.peg
commonPeg = referenceOrbit.peg
print('Common peg point: ')
print(commonPeg)
print('Bperp Range: [%f , %f] '%(Bperp.min()-masterBperp, Bperp.max()-masterBperp))
print('Bperp Range: [%f , %f] '%(Bperp.min()-referenceBperp, Bperp.max()-referenceBperp))

######Choose median doppler
commonDop = np.median(Dopplers)
maxDop = np.max(Dopplers)
minDop = np.min(Dopplers)
varDop = np.max(np.abs(Dopplers-commonDop))/masterOrbit.prf
varDop = np.max(np.abs(Dopplers-commonDop))/referenceOrbit.prf

print('Common Doppler: ', commonDop)
print('Doppler Range: [%f, %f]'%(minDop, maxDop))
Expand Down
Loading

0 comments on commit e03042f

Please sign in to comment.