isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
ResampSlc.h
1 // -*- C++ -*-
2 // -*- coding: utf-8 -*-
3 //
4 // Author: Joshua Cohen, Bryan Riel
5 // Copyright 2017-2018
6 //
7 
8 #ifndef ISCE_IMAGE_RESAMPSLC_H
9 #define ISCE_IMAGE_RESAMPSLC_H
10 #pragma once
11 
12 #include "forward.h"
13 
14 #include <cstdint>
15 #include <cstdio>
16 #include <complex>
17 #include <valarray>
18 
19 // isce3::core
20 #include <isce3/core/Interpolator.h>
21 #include <isce3/core/Poly2d.h>
22 
23 // isce3::io
24 #include <isce3/io/forward.h>
25 
26 // isce3::product
27 #include <isce3/product/Product.h>
28 #include <isce3/product/RadarGridParameters.h>
29 
30 // Definition
32 
33  // Public data members
34  public:
36 
37  // Meta-methods
38  public:
40  inline ResampSlc(const isce3::product::Product & product,
41  char frequency = 'A');
42 
44  inline ResampSlc(const isce3::product::Product & product,
45  const isce3::product::Product & refProduct,
46  char frequency = 'A');
47 
49  inline ResampSlc(const isce3::product::Swath & swath);
50 
52  inline ResampSlc(const isce3::product::Swath & swath,
53  const isce3::product::Swath & refSwath);
54 
56  inline ResampSlc(const isce3::product::RadarGridParameters & rdr_grid,
58  double wvl);
59 
61  inline ResampSlc(const isce3::product::RadarGridParameters & rdr_grid,
62  const isce3::product::RadarGridParameters & ref_rdr_grid,
63  const isce3::core::LUT2d<double> & doppler,
64  double wvl, double ref_wvl);
65 
67  inline ResampSlc(const isce3::core::LUT2d<double> & doppler,
68  double startingRange, double rangePixelSpacing,
69  double sensingStart, double prf, double wvl);
70 
72  inline ResampSlc(const isce3::core::LUT2d<double> & doppler,
73  double startingRange, double rangePixelSpacing,
74  double sensingStart, double prf, double wvl,
75  double refStartingRange, double refRangePixelSpacing,
76  double refWvl);
77 
79  inline ~ResampSlc() {};
80 
82  inline double startingRange() const { return _startingRange; }
83  inline double rangePixelSpacing() const { return _rangePixelSpacing; }
84  inline double sensingStart() const { return _sensingStart; }
85  inline double prf() const { return _prf; }
86  inline double wavelength() const { return _wavelength; }
87  inline double refStartingRange() const { return _refStartingRange; }
88  inline double refRangePixelSpacing() const { return _refRangePixelSpacing; }
89  inline double refWavelength() const { return _refWavelength; }
90 
91  // Poly2d and LUT getters
92  inline isce3::core::Poly2d rgCarrier() const;
93  inline isce3::core::Poly2d azCarrier() const;
94 
95  // Poly2d and LUT setters
96  inline void rgCarrier(const isce3::core::Poly2d &);
97  inline void azCarrier(const isce3::core::Poly2d &);
98 
100  inline const isce3::core::LUT2d<double> & doppler() const;
101 
104 
106  inline void doppler(const isce3::core::LUT2d<double> &);
107 
108  // Set reference product for flattening
109  inline void referenceProduct(const isce3::product::Product & product,
110  char frequency = 'A');
111 
112  // Get/set number of lines per processing tile
113  inline size_t linesPerTile() const;
114  inline void linesPerTile(size_t);
115 
117  inline bool haveRefData() const { return _haveRefData; }
118 
119  // Convenience functions
120  inline void declare(int, int, int, int) const;
121 
122  // Generic resamp entry point from externally created rasters
123  void resamp(isce3::io::Raster & inputSlc, isce3::io::Raster & outputSlc,
124  isce3::io::Raster & rgOffsetRaster, isce3::io::Raster & azOffsetRaster,
125  int inputBand=1, bool flatten=false, bool isComplex=true, int rowBuffer=40,
126  int chipSize=isce3::core::SINC_ONE);
127 
128  // Generic resamp entry point: use filenames to create rasters
129  void resamp(const std::string & inputFilename, const std::string & outputFilename,
130  const std::string & rgOffsetFilename, const std::string & azOffsetFilename,
131  int inputBand=1, bool flatten=false, bool isComplex=true, int rowBuffer=40,
132  int chipSize=isce3::core::SINC_ONE);
133 
134  // Data members
135  protected:
136  // Number of lines per tile
137  size_t _linesPerTile = 1000;
138  // Band number
139  int _inputBand;
140  // Filename of the input product
141  std::string _filename;
142  // Flag indicating if we have a reference data (for flattening)
143  bool _haveRefData;
144  // Interpolator pointer
146 
147  // Polynomials and LUTs
148  isce3::core::Poly2d _rgCarrier; // range carrier polynomial
149  isce3::core::Poly2d _azCarrier; // azimuth carrier polynomial
150  isce3::core::LUT2d<double> _dopplerLUT;
151 
152  // Variables ingested from a Swath
153  double _startingRange;
154  double _rangePixelSpacing;
155  double _sensingStart;
156  double _prf;
157  double _wavelength;
158  double _refStartingRange;
159  double _refRangePixelSpacing;
160  double _refWavelength;
161 
162  // Protected functions
163  protected:
164 
165  // Tile initialization for input offsets
166  void _initializeOffsetTiles(Tile_t &, isce3::io::Raster &, isce3::io::Raster &,
169 
170  // Tile initialization for input SLC data
171  void _initializeTile(Tile_t &, isce3::io::Raster &,
173  int, int, int);
174 
175  // Tile transformation
176  void _transformTile(Tile_t & tile,
177  isce3::io::Raster & outputSlc,
178  const isce3::image::Tile<float> & rgOffTile,
179  const isce3::image::Tile<float> & azOffTile,
180  int inLength, bool flatten,
181  int chipSize);
182 
183  // Convenience functions
184  inline int _computeNumberOfTiles(int, int);
185 
186  // Initialize interpolator pointer
187  void _prepareInterpMethods(isce3::core::dataInterpMethod, int);
188 
189  // Set radar parameters from an isce3::product::Swath
190  inline void _setDataFromSwath(const isce3::product::Swath & swath);
191 
192  // Set reference radar parameters from an isce3::product::Swath (for flattening)
193  inline void _setRefDataFromSwath(const isce3::product::Swath & swath);
194 };
195 
196 // Get inline implementations for ResampSlc
197 #define ISCE_IMAGE_RESAMPSLC_ICC
198 #include "ResampSlc.icc"
199 #undef ISCE_IMAGE_RESAMPSLC_ICC
200 
201 #endif
202 
203 // end of file
Data structure for representing 1D polynomials.
Definition: Poly2d.h:25
Definition: Swath.h:25
dataInterpMethod
Enumeration type to indicate interpolation method.
Definition: Constants.h:23
double startingRange() const
Get parameters related to radar grids.
Definition: ResampSlc.h:82
const isce3::core::LUT2d< double > & doppler() const
Get read-only reference to Doppler LUT2d.
Definition: ResampSlc.icc:144
bool haveRefData() const
Get flag for reference data.
Definition: ResampSlc.h:117
Definition: RadarGridParameters.h:15
~ResampSlc()
Destructor.
Definition: ResampSlc.h:79
void _setDataFromSwath(const isce3::product::Swath &swath)
Definition: ResampSlc.icc:97
void _setRefDataFromSwath(const isce3::product::Swath &swath)
Definition: ResampSlc.icc:109
Definition: Product.h:29
Definition: forward.h:7
Definition: ResampSlc.h:31
ResampSlc(const isce3::product::Product &product, char frequency= 'A')
Constructor from an isce3::product::Product (no flattening)
Definition: ResampSlc.icc:13
Data structure meant to handle Raster I/O operations.
Definition: Raster.h:34
Definition of parent Interpolator.
Definition: forward.h:33

Generated for ISCE3.0 by doxygen 1.8.5.