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

2024 KP improvements #27

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DEM/cop_dem.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@
# print (' wget command: ',command)
ret=os.system(command)
if ret == 0:
print ('retrieved ',rsc)
print (' retrieved ',rsc)
if not os.path.exists(dem):
address='http://pangea.stanford.edu/sesfs/copernicus/'+dem
command = 'wget -qN '+address
# print (' wget command: ',command)
ret=os.system(command)
if ret == 0:
print ('retrieved ',dem)
print (' retrieved ',dem)
22 changes: 12 additions & 10 deletions DEM/createDEMcop.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
for j in range(long,long+x):
#print ('tile: ',i,j)
command = '$PROC_HOME/DEM/cop_dem.py '+str(i)+' '+str(j)
print (command)
print ('\n '+command)
ret=os.system(command)

# scan the rsc files for width, xstep parameters
Expand Down Expand Up @@ -98,7 +98,7 @@
heightstr=strings[1].split()
xwidth.append(widthstr[1])
xstep.append(xstepstr[1])
print(demfile,widthstr)
print(' '+demfile,widthstr)
widthmin=min(widthmin,int(widthstr[1]))
xstepmax=max(xstepmax,float(xstepstr[1]))
widthmax=max(widthmax,int(widthstr[1]))
Expand All @@ -110,15 +110,15 @@
frsc.write(ystepstr[1]+'\n')

else:
print ('not found',rsclist[k],'filling with zeros, likely ocean!')
print (' not found',rsclist[k],'filling with zeros, likely ocean!')
frsc.write('no_file\n')
frsc.write('0\n')
frsc.write('0\n')
frsc.write('0\n')
frsc.write('0\n')
ret=os.system('touch '+rsclist[k])
else:
print('not found',rsclist[k],'filling with zeros, likely ocean!')
print(' not found',rsclist[k],'filling with zeros, likely ocean!')
frsc.write('no_file\n')
frsc.write('0\n')
frsc.write('0\n')
Expand All @@ -140,7 +140,8 @@
os.system('rm updem.rsc')

command = '$PROC_HOME/DEM/mosaicDEM demrscparams '+str(x)+' '+str(y)
print (command)
print('\n Mosaicing DEM tiles')
print(' '+command)
ret=os.system(command)
# and we need an rsc file to go with this
fd=open('updem.rsc','w')
Expand Down Expand Up @@ -170,21 +171,22 @@
left=str(lonmin)
right=str(lonmax)
command = '$PROC_HOME/DEM/createspecialdem updem updem.rsc '+outdemfile+' '+outdemrscfile+' '+top+' '+bot+' '+left+' '+right+' '+upsamplex+' '+upsampley

print (command)
print('\n Upsampling DEM')
print(' '+command)
ret = os.system(command)

# convert geoid-based dem to ellipsoid
command='mv '+outdemfile+' '+outdemfile+'.geoid'
print (command)
#print (command)
ret=os.system(command)
command='mv '+outdemrscfile+' '+outdemrscfile+'.geoid'
print (command)
#print (command)
ret=os.system(command)


command='$PROC_HOME/DEM/geoid2008_ellipsoid_interpolate '+outdemfile+'.geoid '+outdemrscfile+'.geoid '+outdemfile+' '+outdemrscfile+' $PROC_HOME/DEM/egm2008_geoid_grid'
print (command)
print('\n Referncing to ellipsoid')
print(' '+command)
ret=os.system(command)

# clean up
Expand Down
Binary file added DEM/createspecialdem
Binary file not shown.
Binary file added DEM/geoid2008_ellipsoid_interpolate
Binary file not shown.
Binary file added DEM/mosaicDEM
Binary file not shown.
20 changes: 0 additions & 20 deletions EOFrequests/getEOF.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import datetime
from datetime import date

#print len(sys.argv)

ASF=1 # switch to retrieve from ESA or ASF
ESA=1-ASF
Expand All @@ -29,31 +28,18 @@
year=int(acquireddate/10000)
month=int((acquireddate-year*10000)/100)
day=acquireddate-year*10000-month*100
#print ('YYYY MM DD ',year, month, day)
acq=datetime.date(year,month,day)
#print "acq= ",acq
#print "acq.toordinal= ",acq.toordinal()
orbitstartdate=date.fromordinal(acq.toordinal()-1)
#print ("orbitstartdate= ",orbitstartdate)
orbitstr=str(orbitstartdate)
#print ('orbitstr ',orbitstr.replace('-',''))

# retrieve orbit file from archive
if ESA==1:
command="wget -q https://qc.sentinel1.eo.esa.int/aux_poeorb/?\&validity_start="+str(orbitstartdate)+"\&sentinel1__mission="+mission+" -O - | grep "+mission+"_OPER"
print (command)
proc = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
(fullquery, err) = proc.communicate()
#print (fullquery)
#print ('fullquery ',str(fullquery))
#fullquery=str(fullquery)
#print (type(fullquery))
#print (fullquery.find("href="))
#print (fullquery.find("EOF\""))
orbitfilelink=fullquery[fullquery.find("href=")+6:fullquery.find("EOF\"")+3]
orbitfile=fullquery[fullquery.find(mission):fullquery.find("EOF")+3]
#print ('orbitfilelink ',orbitfilelink)
#print ('orbitfile ',orbitfile)
command = "wget -qN "+orbitfilelink
print (command)
ret = os.system(command)
Expand All @@ -63,20 +49,14 @@
fcred=open('.credentials','r')
username=fcred.readline().rstrip()
password=fcred.readline().rstrip()
#print (username)
#print (password)
fcred.close()
string="_V"+orbitstr.replace('-','')
command="wget -q https://s1qc.asf.alaska.edu/aux_poeorb -O - | grep "+mission+"_OPER | grep "+string
print (command)
proc = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
(fullquery, err) = proc.communicate()
# print (str(fullquery,'UTF-8'))
fullquery=str(fullquery,'UTF-8')
# print (type(fullquery))
orbitfilelink=fullquery[fullquery.find("href=")+6:fullquery.find("EOF\"")+3]
# print (orbitfilelink)
command = "wget -qN https://s1qc.asf.alaska.edu/aux_poeorb/"+orbitfilelink+" --user="+username+" --password="+password
# print (command)
ret = os.system(command)

Binary file added bin/snaphu
Binary file not shown.
25 changes: 25 additions & 0 deletions build_proc
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,28 @@ gfortran -c processsub.f90 backprojectgpusub.f90 bounds.f90 orbitrangetime.f90 l

nvcc -o sentinel_raw_process sentinel_raw_process.o decode_line_memory.o processsub.o backprojectgpusub.o azimuth_compress.o bounds.o orbitrangetime.o latlon.o intp_orbit.o radar_to_xyz.o unitvec.o tcnbasis.o curvature.o cross.o orbithermite.o filelen.o io.o sentineltimingsub.o getburststatevectors.o $PROC_HOME/fft/fftw-3.3.9/.libs/libfftw3f.a -lstdc++ -lgfortran -lgomp
cd ..

cd kp_scripts
cd int
gfortran -o int_simmask int_simmask.f90
gfortran -o refpointsfromsim refpointsfromsim.f90
echo 'built int_simmask & refpointsfromsim in kp_scripts/int'
cd ..

cd ps
gfortran -o cosine_sim_mask cosine_sim_mask.f90 -fopenmp -lrt -lpthread $PROC_HOME/fft/fftw-3.3.9/.libs/libfftw3f.a
echo 'built cosine_sim_mask in kp_scripts/ps'
cd ..

cd sbas
gfortran -o sbas_unique sbas_unique.f90 svd.f90 -fopenmp -lrt -lpthread
echo 'built sbas_unique in kp_scripts/sbas'
cd ..

cd util
gfortran -o coverage_mask coverage_mask.f90
gfortran -o cull_geolist_fromsim cull_geolist_fromsim.f90 -fopenmp -lrt -lpthread
gfortran -o determine_valid determine_valid.f90 -fopenmp -lrt -lpthread
gfortran -o regressheight regressheight.f90 lsq.o
echo 'built coverage_mask, cull_geolist_fromsim, determine_valid, & regressheight in kp_scripts/util'
cd ..
Binary file added gpu_arch
Binary file not shown.
Binary file added int/crossmul
Binary file not shown.
Binary file added int/filelen.o
Binary file not shown.
Binary file added int/findrefpoints
Binary file not shown.
Binary file added int/makecc
Binary file not shown.
Binary file added int/refpointsfromsim
Binary file not shown.
Loading
Loading