8.1.2. defaults¶
-
class
hs_process.defaults[source]¶ Class containing default values and/or settings for various
hs_processtools/functions.Item Summary
Item Documentation
-
crop_defaults¶ Default values for performing spatial cropping on images.
crop_defaultsis referenced by thespatial_mod.crop_single()function to get default values if various user-parameters are not passed or are left toNone. In this way,defaults.crop_defaultscan be modified once by the user to avoid having to pass the same parameter(s) repeatedly if executingspatial_mod.crop_single()many times, such as in a for loop.-
crop_defaults.directory¶ File directory of the input image to be cropped (default:
None).- Type
str
-
crop_defaults.name_short¶ Part of the datacube name that is generally not repeated across many datacubes captured at the same time. In the
name_longexample above,name_short= “plot_101_pika_gige_2”. The part of the filename that isname_shortshould end with a dash (but should not include that dash as it belongs toname_long; default:None).- Type
str
-
crop_defaults.name_long¶ Part of the datacube name that tends to be long and is repeated across many datacubes captured at the same time. This is an artifact of Resonon/Spectronon software, and may be desireable to shorten and/or make more informative. For example, a datacube may have the following name: “plot_101_pika_gige_2-Radiance From Raw Data-Georectify Airborne Datacube-Reflectance from Radiance Data and Measured Reference Spectrum.bip” and another datacube captured in the same campaign may be named: “plot_102_pika_gige_1-Radiance From Raw Data-Georectify Airborne Datacube-Reflectance from Radiance Data and Measured Reference Spectrum.bip”
name_longshould refer to everything after the first dash (including the first dash) up to the file extension (“.bip”):name_long= “-Radiance From Raw Data-Georectify Airborne Datacube-Reflectance from Radiance Data and Measured Reference Spectrum” (default:None).- Type
str
-
crop_defaults.ext¶ File extension to save the cropped image (default: ‘bip’).
- Type
str
-
crop_defaults.pix_e_ul¶ upper left pixel column (easting) to begin cropping (default: 0).
- Type
int
-
crop_defaults.pix_n_ul¶ upper left pixel row (northing) to begin cropping (default: 0).
- Type
int
-
crop_defaults.buf_e_pix¶ The buffer distance in the easting direction (in pixel units) to be applied after calculating the original crop area (default: 0).
- Type
int
-
crop_defaults.buf_n_pix¶ The buffer distance in the northing direction (in pixel units) to be applied after calculating the original crop area (default: 0).
- Type
int
-
crop_defaults.buf_e_m¶ The buffer distance in the easting direction (in map units; e.g., meters) to be applied after calculating the original crop area; the buffer is considered after
crop_X_m/crop_X_pix. A positive value will reduce the size ofcrop_X_m/crop_X_pix, and a negative value will increase it (default:None).- Type
float
-
crop_defaults.buf_n_m¶ The buffer distance in the northing direction (in map units; e.g., meters) to be applied after calculating the original crop area; the buffer is considered after
crop_X_m/crop_X_pix. A positive value will reduce the size ofcrop_X_m/crop_X_pix, and a negative value will increase it (default:None).- Type
float
-
crop_defaults.crop_e_pix¶ number of pixels in each row in the cropped image (default: 90).
- Type
int
-
crop_defaults.crop_n_pix¶ number of pixels in each column in the cropped image (default: 120).
- Type
int
-
crop_defaults.crop_e_m¶ length of each row (easting direction) of the cropped image in map units (e.g., meters; default:
None).- Type
float
-
crop_defaults.crop_n_m¶ length of each column (northing direction) of the cropped image in map units (e.g., meters; default:
None).- Type
float
-
crop_defaults.plot_id_ref¶ the plot ID of the area to be cropped (default:
None).- Type
int
-
-
envi_write¶ Attributes for writing ENVI datacubes to file, following the convention of the Spectral Python envi.save_image() parameter options for writing an ENVI datacube to file.
-
envi_write.dtype¶ The data type with which to store the image. For example, to store the image in 16-bit unsigned integer format, the argument could be any of
numpy.uint16,'u2','uint16', or'H'(default:np.float32).- Type
numpy.dtypeorstr
-
envi_write.force¶ If
hdr_fileor its associated image file exist,force=Truewill overwrite the files; otherwise, an exception will be raised if either file exists (default:False).- Type
bool
-
envi_write.ext¶ The extension to use for saving the image file; if not specified, a default extension is determined based on the
interleave. For example, ifinterleave``='bip', then ``extis set to ‘bip’ as well. Ifextis an empty string, the image file will have the same name as the .hdr, but without the ‘.hdr’ extension (default:None).- Type
str
-
envi_write.interleave¶ The band interleave format to use for writing the file;
interleaveshould be one of ‘bil’, ‘bip’, or ‘bsq’ (default: ‘bip’).- Type
str
-
envi_write.byteorder¶ Specifies the byte order (endian-ness) of the data as written to disk. For little endian, this value should be either 0 or ‘little’. For big endian, it should be either 1 or ‘big’. If not specified, native byte order will be used (default:
None).- Type
intorstr
-
-
spat_crop_cols¶ Default column names for performing batch spatial cropping on images. Useful when batch processing images via batch.spatial_crop().
batch.spatial_crop()takes a parameterfname_sheet, which can be a filename to a spreadsheet or apandas.DataFrame.defaults.spat_crop_colsshould be modified if the column names infname_sheetare different than what is expected (see documentation for batch.spatial_crop() to know the expected column names).-
spat_crop_cols.directory¶ column name for input directory (default: ‘directory’).
- Type
str
-
spat_crop_cols.fname¶ column name for input fname (default: ‘fname’).
- Type
str
-
spat_crop_cols.name_short¶ column name for input image’s
name_short(default: ‘name_short’).- Type
str
-
spat_crop_cols.name_long¶ column name for input image’s
name_long(default: ‘name_long’).- Type
str
-
spat_crop_cols.ext¶ column name for file extension of input image (default: ‘ext’).
- Type
str
-
spat_crop_cols.pix_e_ul¶ column name for
pix_e_ul(default: ‘pix_e_ul’).- Type
str
-
spat_crop_cols.pix_n_ul¶ column name for
pix_n_ul(default: ‘pix_n_ul’).- Type
str
-
spat_crop_cols.alley_size_e_pix¶ column name for
alley_size_e_pix(default: ‘alley_size_e_pix’).- Type
str
-
spat_crop_cols.alley_size_n_pix¶ column name for
alley_size_n_pix(default: ‘alley_size_n_pix’).- Type
str
-
spat_crop_cols.alley_size_e_m¶ column name for
alley_size_e_m(default: ‘alley_size_e_m’).- Type
str
-
spat_crop_cols.alley_size_n_m¶ column name for
alley_size_n_m(default: ‘alley_size_n_m’).- Type
str
-
spat_crop_cols.buf_e_pix¶ column name for
buf_e_pix(default: ‘buf_e_pix’).- Type
str
-
spat_crop_cols.buf_n_pix¶ column name for
buf_n_pix(default: ‘buf_n_pix’).- Type
str
-
spat_crop_cols.buf_e_m¶ column name for
buf_e_m(default: ‘buf_e_m’).- Type
str
-
spat_crop_cols.buf_n_m¶ column name for
buf_n_m(default: ‘buf_n_m’).- Type
str
-
spat_crop_cols.crop_e_pix¶ column name for
crop_e_pix(default: ‘crop_e_pix’).- Type
str
-
spat_crop_cols.crop_n_pix¶ column name for
crop_n_pix(default: ‘crop_n_pix’).- Type
str
-
spat_crop_cols.crop_e_m¶ column name for
crop_e_m(default: ‘crop_e_m’).- Type
str
-
spat_crop_cols.crop_n_m¶ column name for
crop_n_m(default: ‘crop_n_m’).- Type
str
-
spat_crop_cols.plot_id_ref¶ column name for
plot_id(default: ‘crop_n_pix’).- Type
str
-
spat_crop_cols.n_plots_x¶ column name for
n_plots_x(default: ‘n_plots_x’).- Type
str
-
spat_crop_cols.n_plots_y¶ column name for
n_plots_y(default: ‘n_plots_y’).- Type
str
-
spat_crop_cols.n_plots¶ column name for
n_plots(default: ‘n_plots’).- Type
str
-
-