
    Zf                     r    d dl Z d dlZd dlmZ dZd	dZd	dZd	dZedk(  r eej                  dd        yy)
    N)create_argument_parsera{  example:
  info.py timeseries.h5
  info.py velocity.h5
  info.py ifgramStack.h5

  # Display dataset
  info.py timeseries.py --dset date
  info.py timeseries.py --dset bperp

  # Time / Date Info
  info.py ifgramStack.h5 --date                 #print date1_date2 info for all  interferograms
  info.py timeseries.h5  --num                  #print date list of timeseries with its number
  info.py ifgramStack.h5 --date --show kept     #print date1_date2 info for kept interferograms
  info.py ifgramStack.h5 --date --show dropped  #print date1_date2 info for dropped/excluded interferograms
  info.py LS-PARAMS.h5   --date > date_list.txt #print date list of timeseries and save it to txt file.
  info.py S1_IW12_128_0593_0597_20141213_20180619.h5 --date

  # save date1_date2 info of interferograms to a text file
  info.py ifgramStack.h5 --date --show kept > date12_list.txt

  # Slice / Dataset Info
  info.py timeseries.h5                              --slice
  info.py inputs/ifgramStack.h5                      --slice
  info.py S1_IW12_128_0593_0597_20141213_20180619.h5 --slice
  info.py LS-PARAMS.h5                               --slice
c                    d}t         }t        j                  d      d   }t        |||||       }|j	                  dt
        d       |j	                  dd	d
       |j	                  dt
        d       |j                  dd      }|j	                  ddd	d       |j	                  ddd	d       |j	                  ddd	d       |j	                  dddh ddd        |S )!zCreate command line parser.z4Display Metadata / Structure information of ANY File.)synopsisdescriptionepilog
subparsersfilezFile to check)typehelpz	--compact
store_truez8show compact info by displaying only the top 20 metadata)actionr   z--dsetzShow datasetListzlist date/slice infoz--date	disp_datez#Show date/date12 info of input file)destr   r   z--numdisp_numz"Show date/date12 info with numbersz--slice
disp_slicezShow slice list of the filez--showz--show-ifgramdisp_ifgram>   allkeptdroppedr   z<Show all / kept / dropped interferograms only. Default: all.)r   choicesdefaultr   )EXAMPLE__name__splitr   add_argumentstradd_argument_group)r
   r   r	   nameparserpar_lists         H/home/exouser/operations/rsmas_insar/tools/MintPy/src/mintpy/cli/info.pycreate_parserr%   +   s   EHF>>#r"D#xXfQ[]F S?
LW  Y s@((0FGH(\D  F'
<C  E),|<  >(?":E]  _ M    c                     t               }|j                  |       }t        j                  j	                  |j
                        st        |j
                        d|_        |j                  rd|_        |S )zCommand line parser.)argsi'     )	r%   
parse_argsospathisfiler   FileNotFoundErrormax_meta_numcompact)iargsr"   inpss      r$   cmd_line_parser3   F   sa     _F%(D 77>>$))$		** D||Kr&   c                 6    t        |       }ddlm}  ||       y )Nr   )
print_info)r3   mintpy.infor5   )r1   r2   r5   s      r$   mainr7   Y   s    % D ' tr&   __main__   )N)
r+   sysmintpy.utils.arg_utilsr   r   r%   r3   r7   r   argv r&   r$   <module>r>      sG    
 
 986& z!" r&   