Skip to content

Commit

Permalink
Updated to ensure that when functions are using rios that define rsgi…
Browse files Browse the repository at this point in the history
…slib image creation options are still used.
  • Loading branch information
petebunting committed Jul 2, 2024
1 parent de05bd3 commit 23b306e
Show file tree
Hide file tree
Showing 18 changed files with 160 additions and 21 deletions.
3 changes: 3 additions & 0 deletions python/rsgislib/changedetect/pxloutlierchng.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ def _applyPyOB(info, inputs, outputs, otherargs):

aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down
6 changes: 6 additions & 0 deletions python/rsgislib/classification/classcatboost.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ def _applyCatBClassifier(info, inputs, outputs, otherargs):

aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -534,6 +537,9 @@ def _applyCatBClassifier(info, inputs, outputs, otherargs):

aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down
3 changes: 3 additions & 0 deletions python/rsgislib/classification/classkeraspxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ def _applyKerasPxlClassifier(info, inputs, outputs, otherargs):

aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down
6 changes: 6 additions & 0 deletions python/rsgislib/classification/classlightgbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,9 @@ def _applyLGBMClassifier(info, inputs, outputs, otherargs):

aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -2622,6 +2625,9 @@ def _applyLGMClassifier(info, inputs, outputs, otherargs):

aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down
3 changes: 3 additions & 0 deletions python/rsgislib/classification/classsklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ class ids should be consecutive and the out_ids

aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down
6 changes: 6 additions & 0 deletions python/rsgislib/classification/classxgboost.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,9 @@ def _apply_xgb_classifier(info, inputs, outputs, otherargs):

aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -2050,6 +2053,9 @@ def _applyXGBMClassifier(info, inputs, outputs, otherargs):

aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down
6 changes: 6 additions & 0 deletions python/rsgislib/classification/clustersklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ def img_pixel_sample_cluster(
otherargs.no_data_val = no_data_val
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -227,6 +230,9 @@ def img_pixel_tiled_cluster(
otherargs.clusterer = clusterer
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down
30 changes: 30 additions & 0 deletions python/rsgislib/imagecalc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,9 @@ def rescale_img_pxl_vals(
otherargs.numpyDT = numpyDT
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -1131,6 +1134,9 @@ def calc_imgs_pxl_mode(
otherargs.numpyDT = numpyDT
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -1200,6 +1206,9 @@ def calc_imgs_pxl_percentiles(
otherargs.percentiles = percentiles
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -1327,6 +1336,9 @@ def _calcBasicStats(info, inputs, outputs, otherargs):
aControls.referenceImage = in_ref_img
aControls.footprint = applier.BOUNDS_FROM_REFERENCE
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -1421,6 +1433,9 @@ def recode_int_raster(
otherargs.recode_dict = recode_dict
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = False
aControls.calcStats = False
Expand Down Expand Up @@ -1561,6 +1576,9 @@ def _retrieve_idx_info(info, inputs, outputs, otherargs):
otherargs.h_box = y_res / 2
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = False
aControls.calcStats = False
Expand Down Expand Up @@ -1910,6 +1928,9 @@ def count_imgs_int_val_occur(
otherargs.bin_vals = bin_vals
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -2732,6 +2753,9 @@ def normalise_img_pxl_vals_py(
otherargs.out_max = out_max
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -2848,6 +2872,9 @@ def calc_band_range_thres_msk(
otherargs.combine_mthd = combine_mthd
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = False
aControls.calcStats = False
Expand Down Expand Up @@ -2935,6 +2962,9 @@ def calc_img_band_pxl_percentiles(
otherargs.percentiles = percentiles
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down
24 changes: 24 additions & 0 deletions python/rsgislib/imagecalc/specunmixing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ def spec_unmix_spts_ucls(
otherargs.weight = weight
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -433,6 +436,9 @@ def spec_unmix_spts_nnls(
otherargs.weight = weight
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -538,6 +544,9 @@ def spec_unmix_spts_fcls(
otherargs.gain = gain
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -652,6 +661,9 @@ def spec_unmix_pymcr_nnls(
otherargs.weight = weight
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -763,6 +775,9 @@ def spec_unmix_pymcr_fcls(
otherargs.gain = gain
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -844,6 +859,9 @@ def rescale_unmixing_results(input_img, output_img, gdalformat="KEA", calc_stats
otherargs = applier.OtherInputs()
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -904,6 +922,9 @@ def predict_refl_linear_unmixing(
otherargs.endmembers_arr = endmembers_info[2]
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down Expand Up @@ -990,6 +1011,9 @@ def calc_unmixing_rmse_residual_err(
otherargs.endmembers_arr = endmembers_info[2]
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down
1 change: 1 addition & 0 deletions python/rsgislib/imagecalibration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ def createEstimateSREFSurface(inputTOAImg, imgBands, bandRescale, winSize, outIm
otherargs.numpyDT = numpy.float32
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(gdalformat)
aControls.drivername = 'KEA'
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down
3 changes: 3 additions & 0 deletions python/rsgislib/imagecalibration/sensorlvl2data.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,9 @@ def parse_landsat_c2_qa_pixel_img(
otherargs.qa_lut = qa_lut
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False
Expand Down
5 changes: 5 additions & 0 deletions python/rsgislib/imagecalibration/solarangles.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ def calc_solar_azimuth_zenith(inputImg, inImgDateTime, outputImg, gdalformat):
otherargs.dateTime = inImgDateTime
aControls = applier.ApplierControls()
aControls.progress = progress_bar
aControls.creationoptions = rsgislib.imageutils.get_rios_img_creation_opts(
gdalformat
)
aControls.drivername = gdalformat
aControls.omitPyramids = True
aControls.calcStats = False

wgs84latlonProj = osr.SpatialReference()
wgs84latlonProj.ImportFromEPSG(4326)
Expand Down
Loading

0 comments on commit 23b306e

Please sign in to comment.