X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



17511 Rate this article:
No rating

SARscape PS analyzer tool – How to customize the exported ASCII files

The SARscape PS analyzer tool - /SARscape/General Tools/Time Series Analyzer/Vector- has been developed and customized from the ENVI Spectral profile tool so it can display SARscape PS displacements through time, instead of spectral profiles.

The displacement of a given PS is displayed as follows

  • X-axis displays the date of each acquisition: it corresponds to the date of columns D_YYYYMMDD in the Attribute table of the output PS shapefile
  • Y-axis displays the displacement of the given PS at each of those dates, also available in the Attribute table of output PS shapefile

However only the graphic part is currently customized for PS displacement analysis. If a PS profile is exported using the menu Export > ASCII, the output ASCII file looks confusing:

  • The header is not fully correct as Column 1 is described as Wavelength instead of Time
  • The content of column 1 includes time in Julian format which is not easy to read

 

ENVI ASCII Plot File [Thu Aug 29 09:06:24 2019]

Column 1: Wavelength

Column 2: PS#456~~2##255,0,0

  2452573.000000   4.009981

  2452608.000000   4.856348

  2452643.000000   5.166126

 

Here is a simple IDL code showing how to customize the ASCII file afterwards :

----------------------------------------------------------------------------------------

PRO CONVERT_PS_ASCII_FILE

 

; select the ASCII file generated by the PS process

f=dialog_pickfile(TITLE='Select the ASCII File to be converted')

 

; create the structure to read such ASCII file

sTemplate1 = { $

VERSION : 1.0 , $

DATASTART : 3L, $

DELIMITER : 32B, $

MISSINGVALUE : !VALUES.f_NaN, $

COMMENTSYMBOL : '', $

FIELDCOUNT : 2L, $

FIELDTYPES : [5L,5L], $

FIELDNAMES : ['Time','Velocity'], $

FIELDLOCATIONS : [2L ,19L],$

FIELDGROUPS : [0L,1L] $

  }

; read the ASCII file

data = READ_ASCII(f, HEADER= header,TEMPLATE=stemplate1 )

 

; modify the header

header[1]='Column 1: Time D/M/Y'

header[2]=(strsplit(header[2],'~',/EXTRACT))[0] + ' - Displacement'

 

; convert column 1 from Julian date to DD/YY/YYYY format

CALDAT,data.Time,Month, Day, Year

Data=TRANSPOSE([[Day],[Month],[Year],[data.velocity]])

 

; make an archive of the original ASCII file

FILE_COPY,f,f+"_archive"

 

; save the customized ASCII file using its original filename

OPENW,2,f

Printf,2,TRANSPOSE(header)

Printf,2,data,FORMAT=' %2d/%2d/%d  %f'

close,2

 

END

----------------------------------------------------------------------------------------

 

The output ASCII file created with the above code will now show

  • A relevant header regarding the description of each column
  • A date converted to JJ/DD/YYYY in column 1

Note this code is currently only valid for 1 PS plot but can easily be adapted to ASCII files created from multiple PS plots

 

ENVI ASCII Plot File [Thu Aug 29 09:06:24 2019]

Column 1: Time D/M/Y

Column 2: PS#456 - Displacement

 25/10/2002  4.009981

 29/11/2002  4.856348

  3/ 1/2003  5.166126

 

 

 

----------------------------------------------------------------------------------------

Writen by BC on 19/09/19 - reviwed by MM on 09/19/2019

Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »