├── src ├── main │ ├── resources │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── icon.ico │ └── java │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ └── sh │ │ └── surge │ │ └── NOAA_HIRS_Decoder │ │ └── Main.java └── assembly │ └── assembly.xml ├── .idea ├── .gitignore ├── dictionaries │ └── Zbyszek.xml ├── vcs.xml ├── discord.xml ├── modules.xml ├── artifacts │ └── NOAA_HIRS_Decoder.xml ├── misc.xml ├── libraries │ ├── Maven__junit_junit_3_8_1.xml │ ├── Maven__foxtrot_foxtrot_2_0.xml │ ├── Maven__org_ini4j_ini4j_0_5_4.xml │ ├── Maven__xpp3_xpp3_min_1_1_4c.xml │ ├── Maven__org_apache_ant_ant_1_8_2.xml │ ├── Maven__org_apache_poi_poi_4_1_2.xml │ ├── Maven__com_jgoodies_forms_1_2_1.xml │ ├── Maven__com_jgoodies_looks_2_2_2.xml │ ├── Maven__xmlpull_xmlpull_1_1_3_1.xml │ ├── Maven__com_beust_jcommander_1_78.xml │ ├── Maven__javax_enterprise_cdi_api_1_0.xml │ ├── Maven__org_openjfx_javafx_base_14.xml │ ├── Maven__org_openjfx_javafx_fxml_14.xml │ ├── Maven__javax_inject_javax_inject_1.xml │ ├── Maven__com_zaxxer_SparseBitSet_1_2.xml │ ├── Maven__org_openjfx_javafx_base_win_14.xml │ ├── Maven__org_openjfx_javafx_fxml_win_14.xml │ ├── Maven__org_apache_poi_poi_ooxml_4_1_2.xml │ ├── Maven__javax_annotation_jsr250_api_1_0.xml │ ├── Maven__net_sf_launch4j_launch4j_core_3_12.xml │ ├── Maven__org_openjfx_javafx_controls_14.xml │ ├── Maven__org_openjfx_javafx_graphics_14.xml │ ├── Maven__com_github_virtuald_curvesapi_1_06.xml │ ├── Maven__commons_codec_commons_codec_1_13.xml │ ├── Maven__org_apache_xmlbeans_xmlbeans_3_1_0.xml │ ├── Maven__org_openjfx_javafx_controls_win_14.xml │ ├── Maven__org_openjfx_javafx_graphics_win_14.xml │ ├── Maven__org_apache_ant_ant_launcher_1_8_2.xml │ ├── Maven__org_apache_maven_maven_model_3_6_0.xml │ ├── Maven__com_thoughtworks_xstream_xstream_1_4_8.xml │ ├── Maven__com_jgoodies_jgoodies_common_1_7_0.xml │ ├── Maven__commons_logging_commons_logging_1_2.xml │ ├── Maven__org_apache_maven_maven_profile_2_2_1.xml │ ├── Maven__org_apache_maven_maven_project_2_2_1.xml │ ├── Maven__classworlds_classworlds_1_1_alpha_2.xml │ ├── Maven__org_apache_maven_maven_artifact_2_2_1.xml │ ├── Maven__org_apache_maven_maven_settings_2_2_1.xml │ ├── Maven__org_codehaus_plexus_plexus_utils_3_1_0.xml │ ├── Maven__org_apache_commons_commons_math3_3_6_1.xml │ ├── Maven__org_apache_maven_maven_plugin_api_3_6_0.xml │ ├── Maven__org_apache_poi_poi_ooxml_schemas_4_1_2.xml │ ├── Maven__org_apache_commons_commons_compress_1_19.xml │ ├── Maven__commons_beanutils_commons_beanutils_1_7_0.xml │ ├── Maven__org_apache_commons_commons_collections4_4_4.xml │ ├── Maven__org_codehaus_plexus_plexus_classworlds_2_5_2.xml │ ├── Maven__org_apache_maven_maven_plugin_registry_2_2_1.xml │ ├── Maven__org_codehaus_plexus_plexus_interpolation_1_11.xml │ ├── Maven__org_apache_maven_maven_artifact_manager_2_2_1.xml │ ├── Maven__org_apache_maven_maven_plugin_descriptor_2_2_1.xml │ ├── Maven__org_eclipse_sisu_org_eclipse_sisu_inject_0_3_3.xml │ ├── Maven__org_eclipse_sisu_org_eclipse_sisu_plexus_0_3_3.xml │ ├── Maven__org_apache_maven_maven_repository_metadata_2_2_1.xml │ ├── Maven__backport_util_concurrent_backport_util_concurrent_3_1.xml │ ├── Maven__org_apache_maven_wagon_wagon_provider_api_1_0_beta_6.xml │ ├── Maven__org_codehaus_plexus_plexus_component_annotations_1_5_5.xml │ ├── Maven__com_akathist_maven_plugins_launch4j_launch4j_maven_plugin_1_7_25.xml │ └── Maven__org_codehaus_plexus_plexus_container_default_1_0_alpha_9_stable_1.xml ├── compiler.xml └── jarRepositories.xml ├── NOTICE.txt ├── README.md ├── config.ini ├── docs └── index.html ├── pom.xml ├── NOAA_HIRS_Decoder.iml └── LICENSE /src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Main-Class: sh.surge.NOAA_HIRS_Decoder.Main 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp5ews/NOAA_HIRS_Decoder/HEAD/src/main/resources/icon.ico -------------------------------------------------------------------------------- /.idea/dictionaries/Zbyszek.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ffffff 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/discord.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/artifacts/NOAA_HIRS_Decoder.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/NOAA_HIRS_Decoder 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__junit_junit_3_8_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__foxtrot_foxtrot_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_ini4j_ini4j_0_5_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__xpp3_xpp3_min_1_1_4c.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_ant_ant_1_8_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_poi_poi_4_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_jgoodies_forms_1_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_jgoodies_looks_2_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__xmlpull_xmlpull_1_1_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_beust_jcommander_1_78.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_enterprise_cdi_api_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_openjfx_javafx_base_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_openjfx_javafx_fxml_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_inject_javax_inject_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_zaxxer_SparseBitSet_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_openjfx_javafx_base_win_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_openjfx_javafx_fxml_win_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_poi_poi_ooxml_4_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_annotation_jsr250_api_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_sf_launch4j_launch4j_core_3_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_openjfx_javafx_controls_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_openjfx_javafx_graphics_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_virtuald_curvesapi_1_06.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_codec_commons_codec_1_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_xmlbeans_xmlbeans_3_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_openjfx_javafx_controls_win_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_openjfx_javafx_graphics_win_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_ant_ant_launcher_1_8_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_maven_maven_model_3_6_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_thoughtworks_xstream_xstream_1_4_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_jgoodies_jgoodies_common_1_7_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_logging_commons_logging_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_maven_maven_profile_2_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_maven_maven_project_2_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__classworlds_classworlds_1_1_alpha_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_maven_maven_artifact_2_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_maven_maven_settings_2_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_codehaus_plexus_plexus_utils_3_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_math3_3_6_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_maven_maven_plugin_api_3_6_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_poi_poi_ooxml_schemas_4_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_compress_1_19.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_7_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_collections4_4_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | copyright 2020 Zbigniew Sztanga 2 | 3 | This program is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program. If not, see 15 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_codehaus_plexus_plexus_classworlds_2_5_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_maven_maven_plugin_registry_2_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_codehaus_plexus_plexus_interpolation_1_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_maven_maven_artifact_manager_2_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_maven_maven_plugin_descriptor_2_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_eclipse_sisu_org_eclipse_sisu_inject_0_3_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_eclipse_sisu_org_eclipse_sisu_plexus_0_3_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_maven_maven_repository_metadata_2_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__backport_util_concurrent_backport_util_concurrent_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_maven_wagon_wagon_provider_api_1_0_beta_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_codehaus_plexus_plexus_component_annotations_1_5_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_akathist_maven_plugins_launch4j_launch4j_maven_plugin_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_codehaus_plexus_plexus_container_default_1_0_alpha_9_stable_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NOAA_HIRS_Decoder 2 | ### Decoder for decoding HIRS data From NOAA satellites 3 | 4 | ## Website 5 | Check out the project website for a tutorial: https://noaa_hirs_decoder.surge.sh 6 | You can join our discord server: https://discord.gg/Ct2vzGK 7 | 8 | # Features 9 | - Decode HIRS data to pictures 10 | - Histogram equalization 11 | - Multispectral analysis with brightness values 12 | - Composite of all channels 13 | - Option to use a common folder 14 | - Do not skip missing minorframes but black them out in the image 15 | - Save the time of the pass 16 | - Equalize bad/missing pixels with the neighboring ones 17 | - Custom sized composites 18 | - Composite of equalized images 19 | - Open file as an argument for application 20 | - Build RGB images from 3 channels 21 | - Add support for different color palettes 22 | - Get the satellites name 23 | - Cut off bad start and end 24 | 25 | # TODO 26 | - GUI 27 | - ~~Cloud top height approximation~~ Isn't possible because of the degraded performance of HIRS instrument 28 | - Add MetOp's HIRS support and possibly even FY's IRAS 29 | 30 | # Additional info 31 | This program uses and includes following libraries: ini4j, Apache POI, openjfx, launch4j and JCommander. 32 | 33 | -------------------------------------------------------------------------------- /config.ini: -------------------------------------------------------------------------------- 1 | [main] 2 | input:input/ 3 | output:output/[name]/ 4 | save_type:png 5 | save_quality:100 6 | save_compo:yes 7 | compo_path:output/[name]/ 8 | compo_size:5x4 9 | average_pixels:yes 10 | averaging_threshold:30 11 | B/W_range:full 12 | crop:no 13 | crop_threshold:95 14 | silent_mode:no 15 | [xlsx] 16 | save_xlsx:yes 17 | xlsx_path:output/[name]/ 18 | [histogram_equalization] 19 | equalize_histogram:yes 20 | histogram_equalization_path:output/[name]/histogram_equalized/ 21 | save_histogram_compo:yes 22 | histogram_compo_path:output/[name]/histogram_equalized/ 23 | histogram_compo_size:5x4 24 | [msa] 25 | save_msa:yes 26 | msa_path:output/[name]/ 27 | land_channel:20 28 | land_channel_he:yes 29 | land_threshold:46 30 | cloud_channel:8 31 | cloud_channel_he:yes 32 | cloud_threshold:120 33 | water_base_color:0038ff 34 | water_brightening:1 35 | land_base_color:4B6400 36 | land_brightening:1 37 | cloud_base_color:ffffff 38 | cloud_brightening:1 39 | [stat] 40 | save_time:yes 41 | save_name:yes 42 | stat_path:output/[name]/ 43 | time_format:E MMM dd yyyy HH:mm:ss:SSS z 44 | time_language:en-US 45 | [rgb] 46 | save_rgb:yes 47 | rgb_path:output/[name]/ 48 | rgb_red:4 49 | rgb_red_he:yes 50 | rgb_green:4 51 | rgb_green_he:yes 52 | rgb_blue:20 53 | rgb_blue_he:yes -------------------------------------------------------------------------------- /src/assembly/assembly.xml: -------------------------------------------------------------------------------- 1 | 4 | windows 5 | 6 | zip 7 | 8 | false 9 | 10 | 11 | ${project.basedir} 12 | 13 | README* 14 | LICENSE* 15 | NOTICE* 16 | config.ini 17 | 18 | true 19 | 20 | 21 | ${project.build.directory} 22 | / 23 | 24 | *.exe 25 | *-jar-with-dependencies.jar 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | HIRS Decoder 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 23 | 24 | 25 | 26 | 27 | 59 |
60 |
61 |
62 |

THE NOAA HIRS DECODER

63 |

The NOAA HIRS Decoder is a program that produces images from the data sent to earth by the HIRS instrument onboard the NOAA-15, 18, and 19 satellites.
64 | The telemetry data sent from the satellites contain low resolution pictures of the earth's surface and clouds taken in 20 different wavelengths, from visible light to long-wavelength infrared.

65 |

The NOAA HIRS Decoder requires Java to be installed. Windows, macOS, Linux, and Solaris are 100% supported.

66 |

This program was developed by Zbigniew Sztanga in his free time.

67 |
68 |
69 |
70 | 71 | 72 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | sh.surge.NOAA_HIRS_Decoder 8 | NOAA_HIRS_Decoder 9 | 1.0.2 10 | jar 11 | 12 | 13 | 14 | 15 | org.apache.poi 16 | poi 17 | 4.1.2 18 | 19 | 20 | 21 | org.apache.poi 22 | poi-ooxml 23 | 4.1.2 24 | 25 | 26 | 27 | org.apache.poi 28 | poi-ooxml-schemas 29 | 4.1.2 30 | 31 | 32 | 33 | org.ini4j 34 | ini4j 35 | 0.5.4 36 | 37 | 38 | 39 | com.akathist.maven.plugins.launch4j 40 | launch4j-maven-plugin 41 | 1.7.25 42 | 43 | 44 | org.openjfx 45 | javafx-controls 46 | 14 47 | 48 | 49 | org.openjfx 50 | javafx-base 51 | 14 52 | 53 | 54 | org.openjfx 55 | javafx-fxml 56 | 14 57 | 58 | 59 | org.openjfx 60 | javafx-graphics 61 | 14 62 | 63 | 64 | 65 | com.beust 66 | jcommander 67 | 1.78 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | src/main/resources 78 | 79 | 80 | src/main/java/sh/surge/NOAA_HIRS_Decoder/GUI 81 | 82 | **/*.fxml 83 | 84 | 85 | 86 | 87 | 88 | org.apache.maven.plugins 89 | maven-enforcer-plugin 90 | 1.4.1 91 | 92 | 93 | enforce-maven 94 | 95 | enforce 96 | 97 | 98 | 99 | 100 | 3.2.5 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | maven-clean-plugin 109 | 3.1.0 110 | 111 | 112 | auto-clean 113 | initialize 114 | 115 | clean 116 | 117 | 118 | 119 | 120 | 121 | 122 | org.apache.maven.plugins 123 | maven-compiler-plugin 124 | 3.8.1 125 | 126 | 1.8 127 | 1.8 128 | UTF-8 129 | 130 | 131 | 132 | org.apache.maven.plugins 133 | maven-assembly-plugin 134 | 3.3.0 135 | 136 | 137 | assembly 138 | package 139 | 140 | single 141 | 142 | 143 | 144 | 145 | sh.surge.NOAA_HIRS_Decoder.Main 146 | 147 | 148 | 149 | jar-with-dependencies 150 | 151 | 152 | 153 | 154 | assembly1 155 | install 156 | 157 | single 158 | 159 | 160 | 161 | 162 | sh.surge.NOAA_HIRS_Decoder.Main 163 | 164 | 165 | 166 | src/assembly/assembly.xml 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | com.akathist.maven.plugins.launch4j 176 | launch4j-maven-plugin 177 | 1.7.25 178 | 179 | 180 | l4j-clui 181 | package 182 | 183 | launch4j 184 | 185 | 186 | console 187 | target/NOAA_HIRS_Decoder.exe 188 | target/NOAA_HIRS_Decoder-${project.version}-jar-with-dependencies.jar 189 | src/main/resources/icon.ico 190 | NOAA_HIRS_Decoder 191 | . 192 | 193 | sh.surge.NOAA_HIRS_Decoder.Main 194 | false 195 | anything 196 | 197 | 198 | 8.0.0 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | -------------------------------------------------------------------------------- /NOAA_HIRS_Decoder.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /src/main/java/sh/surge/NOAA_HIRS_Decoder/Main.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 Zbigniew Sztanga 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see 16 | */ 17 | 18 | package sh.surge.NOAA_HIRS_Decoder; 19 | 20 | 21 | import com.beust.jcommander.JCommander; 22 | import com.beust.jcommander.Parameter; 23 | import org.apache.poi.ss.usermodel.Cell; 24 | import org.apache.poi.ss.usermodel.Row; 25 | import org.apache.poi.xssf.usermodel.XSSFSheet; 26 | import org.apache.poi.xssf.usermodel.XSSFWorkbook; 27 | import org.ini4j.Wini; 28 | 29 | import javax.imageio.IIOImage; 30 | import javax.imageio.ImageIO; 31 | import javax.imageio.ImageWriteParam; 32 | import javax.imageio.ImageWriter; 33 | import javax.imageio.plugins.jpeg.JPEGImageWriteParam; 34 | import javax.imageio.stream.FileImageOutputStream; 35 | import java.awt.*; 36 | import java.awt.image.BufferedImage; 37 | import java.awt.image.Raster; 38 | import java.awt.image.WritableRaster; 39 | import java.io.*; 40 | import java.text.SimpleDateFormat; 41 | import java.util.*; 42 | import java.util.List; 43 | import java.util.concurrent.TimeUnit; 44 | 45 | 46 | public class Main { 47 | private static final int[] COLUMNS = {17, 18, 23, 24, 27, 28, 31, 32, 35, 36, 39, 40, 43, 44, 55, 56, 59, 60, 63, 64, 67, 68, 71, 72, 75, 76, 79, 80, 83, 84, 85, 86, 89, 90, 93, 94}; 48 | private static final ArrayList frames = new ArrayList<>(); 49 | private static final ArrayList frmCnt = new ArrayList<>(); 50 | private static final ArrayList framePixels = new ArrayList<>(); 51 | private static final ArrayList validDataBit = new ArrayList<>(); 52 | private static final ArrayList starts = new ArrayList<>(); 53 | private static final ArrayList mirrorPos = new ArrayList<>(); 54 | private static final XSSFWorkbook workbook = new XSSFWorkbook(); 55 | private static final ArrayList majorFrmCnt = new ArrayList<>(); 56 | private static final ArrayList missingLinesList = new ArrayList<>(); 57 | //todo check for missing 7 majorframes 58 | //private static final ArrayList timeList = new ArrayList<>(); 59 | private static final ArrayList ids = new ArrayList<>(); 60 | private static String input, saveType; 61 | private static boolean saveCompo, doHis, saveXlsx, saveMsa, saveTime, cloudHe, landHe, outName, compoName, hisName, xlsxName, msaName, timeName, saveHisCombo, hisCompoName, averagePixels; 62 | private static boolean saveRgb, rgbRedHe, rgbBlueHe, rgbGreenHe, rgbName, saveName, fullBW, doCrop; 63 | private static String rgbPath1, rgbPath2; 64 | private static int rgbChR, rgbChG, rgbChB; 65 | private static String compo1, compo2, hisCompo1, hisCompo2; 66 | private static String out1, out2; 67 | private static String hisPath1, hisPath2; 68 | private static String xlsxP1, xlsxP2; 69 | private static String msaPath1, msaPath2; 70 | private static String timePath1, timePath2, timeFormat, timeLanguage; 71 | private static int landChannel, landThreshold, cloudsChannel, cloudThreshold, saveQuality, totalMissingLines; 72 | private static Color waterBase, landBase, cloudBase; 73 | private static float landBri, waterBri, cloudBri; 74 | private static int compoSizeW, compoSizeH, hisCompoSizeW, hisCompoSizeH; 75 | private static int badLineThreshold; 76 | private static int averagingThreshold; 77 | private static int firstGoodLine, croppedImgH; 78 | private static String name; 79 | private static boolean silentMode; 80 | 81 | 82 | @Parameter(names = {"-i", "--input"}, description = "Input File or Directory") 83 | private static String inputParam; 84 | 85 | @Parameter(names = {"-o", "--output"}, description = "Output directory") 86 | private static String outputParam; 87 | 88 | @Parameter(names = {"-c", "--config"}, description = "Configuration file") 89 | private static String configParam; 90 | 91 | @Parameter(names = {"-s", "--save_compo"}, description = "Save composition of all channels", arity = 1) 92 | private static boolean saveCompoParam; 93 | 94 | @Parameter(names = {"-a", "--average_pixels"}, description = "Average neighboring pixels", arity = 1) 95 | private static boolean averagePixelsParam; 96 | 97 | @Parameter(names = {"-e", "--silent_mode"}, description = "Disables console output", arity = 1) 98 | private static boolean silentModeParam; 99 | 100 | @Parameter(names = {"-h", "--help"}, description = "Display this list", help = true) 101 | private boolean help = false; 102 | 103 | public static void main(String[] argv) { 104 | Main main = new Main(); 105 | //JCommander.newBuilder().addObject(main).build().parse(argv); 106 | JCommander jCommander = JCommander.newBuilder().addObject(main).build(); 107 | jCommander.parse(argv); 108 | //System.out.println(outputParam + ", " + inputParam + ", " + configParam + ", " + saveCompoParam + ", " + averagePixelsParam +", " + silentModeParam); 109 | 110 | if (main.help){ 111 | jCommander.usage(); 112 | return; 113 | } 114 | 115 | List stringList = new ArrayList<>(Arrays.asList(argv)); 116 | 117 | if (stringList.contains("-s")||stringList.contains("--save_compo")){ 118 | saveCompo = saveCompoParam; 119 | } 120 | if (stringList.contains("-a")||stringList.contains("--average_pixels")){ 121 | averagePixels = averagePixelsParam; 122 | } 123 | if (stringList.contains("-e")||stringList.contains("--silent_mode")){ 124 | silentMode = silentModeParam; 125 | } 126 | 127 | //System.out.println(Arrays.toString(args)); 128 | try { 129 | try { 130 | if(configParam != null){ 131 | readIni(configParam); 132 | }else{ 133 | readIni("config.ini"); 134 | } 135 | } catch (NullPointerException e) { 136 | System.out.println("Program encountered an exception wile reading the configuration! Aborting in 5s"); 137 | e.printStackTrace(); 138 | try { 139 | TimeUnit.SECONDS.sleep(5); 140 | } catch (InterruptedException interruptedException) { 141 | interruptedException.printStackTrace(); 142 | } 143 | Runtime.getRuntime().exit(1); 144 | } 145 | if (!silentMode) System.out.println("Loading file...."); 146 | File inputFile = null; 147 | 148 | if(inputParam != null){ 149 | if (inputParam.endsWith(".txt")){ 150 | inputFile = new File(inputParam); 151 | }else if (new File(inputParam).isDirectory()){ 152 | inputFile = getLastModified(inputParam, ".txt"); 153 | } 154 | }else { 155 | inputFile = getLastModified(input, ".txt"); 156 | } 157 | 158 | if (inputFile == null) { 159 | if(!silentMode) System.out.println("No input file found. Aborting"); 160 | try { 161 | TimeUnit.SECONDS.sleep(5); 162 | } catch (InterruptedException e) { 163 | e.printStackTrace(); 164 | } 165 | Runtime.getRuntime().exit(1); 166 | } 167 | if (!silentMode) System.out.println("Newest file found: " + inputFile.getName()); 168 | if (!silentMode) System.out.println("OK!" + '\n'); 169 | 170 | if (outputParam != null){ 171 | out1 = outputParam; 172 | if (outputParam.contains("[name]")) { 173 | int name = outputParam.indexOf("[name]"); 174 | out1 = outputParam.substring(0, name); 175 | out2 = outputParam.substring(name + 6); 176 | outName = true; 177 | } 178 | } 179 | 180 | decode(inputFile); 181 | makeImages(); 182 | 183 | } catch (Exception e) { 184 | System.out.println("Program encountered an unhandled Exception:"); 185 | e.printStackTrace(); 186 | try { 187 | TimeUnit.SECONDS.sleep(5); 188 | } catch (InterruptedException interruptedException) { 189 | interruptedException.printStackTrace(); 190 | } 191 | Runtime.getRuntime().exit(1); 192 | } 193 | 194 | } 195 | 196 | private static BufferedImage crop(BufferedImage inImage, boolean first, int CfirstGood, int Cheight) { 197 | int firstGood = 0; 198 | int firstGoodBottom = 0; 199 | int height; 200 | if (first) { 201 | for (int line = 0; line < inImage.getHeight() - 1; line++) { 202 | int goodPxs = 0; 203 | for (int x = 0; x < 56; x++) { 204 | int av = getAverage(x, line, inImage); 205 | if (Math.abs(av - new Color(inImage.getRGB(x, line)).getRed()) < averagingThreshold && av != 0) { 206 | goodPxs++; 207 | } 208 | } 209 | if (goodPxs > 56 * badLineThreshold / 100) { 210 | firstGood = line; 211 | break; 212 | } 213 | } 214 | 215 | for (int line = inImage.getHeight() - 1; line > 0; line--) { 216 | int goodPxs = 0; 217 | for (int x = 0; x < 56; x++) { 218 | int av = getAverage(x, line, inImage); 219 | if (Math.abs(av - new Color(inImage.getRGB(x, line)).getRed()) < averagingThreshold) { 220 | goodPxs++; 221 | } 222 | } 223 | if (goodPxs > 56 * badLineThreshold / 100) { 224 | firstGoodBottom = line; 225 | break; 226 | } 227 | } 228 | height = firstGoodBottom - firstGood; 229 | croppedImgH = height; 230 | firstGoodLine = firstGood; 231 | } else { 232 | height = Cheight; 233 | firstGood = CfirstGood; 234 | } 235 | if (!silentMode) System.out.println(height); 236 | 237 | return inImage.getSubimage(0, firstGood, 56, height); 238 | } 239 | 240 | private static File getLastModified(String path, String extension) { 241 | File directory = new File(path); 242 | File[] files = directory.listFiles(File::isFile); 243 | long lastModifiedTime = Long.MIN_VALUE; 244 | File chosenFile = null; 245 | 246 | if (files != null) { 247 | for (File file : files) { 248 | if (file.lastModified() > lastModifiedTime && file.getName().endsWith(extension)) { 249 | chosenFile = file; 250 | lastModifiedTime = file.lastModified(); 251 | } 252 | } 253 | } 254 | 255 | return chosenFile; 256 | } 257 | 258 | private static BufferedImage equalize(BufferedImage src) { 259 | BufferedImage nImg = new BufferedImage(src.getWidth(), src.getHeight(), 260 | BufferedImage.TYPE_BYTE_GRAY); 261 | WritableRaster wr = src.getRaster(); 262 | WritableRaster er = nImg.getRaster(); 263 | int totpix = wr.getWidth() * wr.getHeight(); 264 | int[] histogram = new int[256]; 265 | 266 | for (int x = 0; x < wr.getWidth(); x++) { 267 | for (int y = 0; y < wr.getHeight(); y++) { 268 | histogram[wr.getSample(x, y, 0)]++; 269 | } 270 | } 271 | 272 | int[] chistogram = new int[256]; 273 | chistogram[0] = histogram[0]; 274 | for (int i = 1; i < 256; i++) { 275 | chistogram[i] = chistogram[i - 1] + histogram[i]; 276 | } 277 | 278 | float[] arr = new float[256]; 279 | for (int i = 0; i < 256; i++) { 280 | arr[i] = (float) ((chistogram[i] * 255.0) / (float) totpix); 281 | } 282 | 283 | for (int x = 0; x < wr.getWidth(); x++) { 284 | for (int y = 0; y < wr.getHeight(); y++) { 285 | int nVal = (int) arr[wr.getSample(x, y, 0)]; 286 | er.setSample(x, y, 0, nVal); 287 | } 288 | } 289 | nImg.setData(er); 290 | return nImg; 291 | } 292 | 293 | private static void saveImg(String path, String type, BufferedImage image) { 294 | File outputfile = new File(path); 295 | if (outputfile.mkdirs() && !silentMode) System.out.println("Directory created!"); 296 | if (saveType.equals("jpg")) { 297 | JPEGImageWriteParam jpegParams = new JPEGImageWriteParam(null); 298 | jpegParams.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); 299 | float quality = saveQuality / 100f; 300 | jpegParams.setCompressionQuality(quality); 301 | final ImageWriter writer = ImageIO.getImageWritersByFormatName("jpg").next(); 302 | try { 303 | writer.setOutput(new FileImageOutputStream(outputfile)); 304 | writer.write(null, new IIOImage(image, null, null), jpegParams); 305 | if (!silentMode) System.out.println("Saved " + path); 306 | } catch (IOException e) { 307 | if (!silentMode) System.out.println("Failed to save!" + path); 308 | } 309 | } else { 310 | try { 311 | ImageIO.write(image, type, outputfile); 312 | if (!silentMode) System.out.println("Saved " + path); 313 | } catch (IOException e) { 314 | if (!silentMode) System.out.println("Failed to save!" + path); 315 | } 316 | } 317 | } 318 | 319 | private static void generateMsa(BufferedImage cloud, BufferedImage land, String msaPath1, String msaPath2, String name, int landThreshold, int cloudThreshold) { 320 | BufferedImage msaImg = new BufferedImage(cloud.getWidth(), cloud.getHeight(), BufferedImage.TYPE_INT_RGB); 321 | for (int line = 0; line < msaImg.getHeight(); line++) { 322 | for (int x = 0; x < 56; x++) { 323 | Raster rasterLand = land.getRaster(); 324 | Raster rasterCloud = cloud.getRaster(); 325 | int[] pixelDataL = {0, 0, 0}; 326 | int[] pixelDataC = {0, 0, 0}; 327 | int[] pixelDataLand = rasterLand.getPixel(x, line, pixelDataL); 328 | int[] pixelDataCloud = rasterCloud.getPixel(x, line, pixelDataC); 329 | //msaImg.setRGB(x,line,new Color(pixelDataLand[0],pixelDataLand[0],pixelDataLand[0]).getRGB()); 330 | 331 | try { 332 | msaImg.setRGB(x, line, new Color((int) ((waterBase.getRed() * pixelDataLand[0] / 255f) * waterBri), (int) ((waterBase.getGreen() * pixelDataLand[0] / 255f) * waterBri), (int) ((waterBase.getBlue() * pixelDataLand[0] / 255f) * waterBri)).getRGB()); 333 | } catch (IllegalArgumentException e) { 334 | msaImg.setRGB(x, line, new Color((int) (waterBase.getRed() * pixelDataLand[0] / 255f), (int) (waterBase.getGreen() * pixelDataLand[0] / 255f), (int) (waterBase.getBlue() * pixelDataLand[0] / 255f)).getRGB()); 335 | } 336 | 337 | //msaImg.setRGB(x, line, new Color(0, 50, 200).getRGB()); 338 | if (pixelDataLand[0] > landThreshold) { 339 | try { 340 | msaImg.setRGB(x, line, new Color((int) ((landBase.getRed() * pixelDataLand[0] / 255f) * landBri), (int) ((landBase.getGreen() * pixelDataLand[0] / 255f) * landBri), (int) ((landBase.getBlue() * pixelDataLand[0] / 255f) * landBri)).getRGB()); 341 | } catch (IllegalArgumentException e) { 342 | msaImg.setRGB(x, line, new Color((int) (landBase.getRed() * pixelDataLand[0] / 255f), (int) (landBase.getGreen() * pixelDataLand[0] / 255f), (int) (landBase.getBlue() * pixelDataLand[0] / 255f)).getRGB()); 343 | } 344 | } 345 | if (pixelDataCloud[0] > cloudThreshold) { 346 | try { 347 | msaImg.setRGB(x, line, new Color((int) ((cloudBase.getRed() * pixelDataLand[0] / 255f) * cloudBri), (int) ((cloudBase.getGreen() * pixelDataLand[0] / 255f) * cloudBri), (int) ((cloudBase.getBlue() * pixelDataLand[0] / 255f) * cloudBri)).getRGB()); 348 | } catch (IllegalArgumentException e) { 349 | msaImg.setRGB(x, line, new Color((int) (cloudBase.getRed() * pixelDataLand[0] / 255f), (int) (cloudBase.getGreen() * pixelDataLand[0] / 255f), (int) (cloudBase.getBlue() * pixelDataLand[0] / 255f)).getRGB()); 350 | 351 | } 352 | } 353 | } 354 | } 355 | 356 | saveImg(msaPath1 + name + msaPath2 + "msa." + saveType, saveType, msaImg); 357 | } 358 | 359 | private static void readIni(String fileName) { 360 | Wini ini = null; 361 | 362 | try { 363 | ini = new Wini(new File(fileName)); 364 | } catch (IOException e) { 365 | if (!silentMode) System.out.println("Configuration file not found! Aborting!"); 366 | try { 367 | TimeUnit.SECONDS.sleep(3); 368 | } catch (InterruptedException ex) { 369 | ex.printStackTrace(); 370 | } 371 | Runtime.getRuntime().exit(0); 372 | } 373 | 374 | 375 | input = ini.get("main", "input"); 376 | input = input.trim(); 377 | if (input.charAt(input.length() - 1) != '/') { 378 | input = input + '/'; 379 | } 380 | 381 | String output = ini.get("main", "output"); 382 | output = output.trim(); 383 | if (output.charAt(output.length() - 1) != '/') { 384 | output = output + '/'; 385 | } 386 | 387 | 388 | String com = ini.get("main", "save_compo"); 389 | saveCompo = com.equals("yes"); 390 | 391 | String compo = ini.get("main", "compo_path"); 392 | compo = compo.trim(); 393 | if (compo.charAt(compo.length() - 1) != '/') { 394 | compo = compo + '/'; 395 | } 396 | 397 | compo1 = compo; 398 | if (compo.contains("[name]")) { 399 | int name = compo.indexOf("[name]"); 400 | compo1 = output.substring(0, name); 401 | compo2 = output.substring(name + 6); 402 | compoName = true; 403 | } 404 | 405 | if (ini.get("main", "B/W_range").equals("full")) fullBW = true; 406 | if (ini.get("main", "crop").equals("yes")) doCrop = true; 407 | 408 | saveType = ini.get("main", "save_type"); 409 | saveQuality = Integer.parseInt(ini.get("main", "save_quality")); 410 | 411 | String sXlsx = ini.get("xlsx", "save_xlsx"); 412 | 413 | if (sXlsx.equals("yes")) saveXlsx = true; 414 | 415 | String xlsxP = ini.get("xlsx", "xlsx_path"); 416 | xlsxP = xlsxP.trim(); 417 | if (xlsxP.charAt(xlsxP.length() - 1) != '/') { 418 | xlsxP = xlsxP + '/'; 419 | } 420 | 421 | xlsxP1 = xlsxP; 422 | if (xlsxP.contains("[name]")) { 423 | int name = xlsxP.indexOf("[name]"); 424 | xlsxP1 = output.substring(0, name); 425 | xlsxP2 = output.substring(name + 6); 426 | xlsxName = true; 427 | } 428 | 429 | String dohis = ini.get("histogram_equalization", "equalize_histogram"); 430 | 431 | if (dohis.equals("yes")) doHis = true; 432 | String hisPath; 433 | 434 | if (doHis) { 435 | hisPath = ini.get("histogram_equalization", "histogram_equalization_path"); 436 | hisPath = hisPath.trim(); 437 | if (hisPath.charAt(hisPath.length() - 1) != '/') { 438 | hisPath = hisPath + '/'; 439 | } 440 | hisPath1 = hisPath; 441 | if (hisPath.contains("[name]")) { 442 | int name = hisPath.indexOf("[name]"); 443 | hisPath1 = hisPath.substring(0, name); 444 | hisPath2 = hisPath.substring(name + 6); 445 | hisName = true; 446 | } 447 | } 448 | 449 | out1 = output; 450 | if (output.contains("[name]")) { 451 | int name = output.indexOf("[name]"); 452 | out1 = output.substring(0, name); 453 | out2 = output.substring(name + 6); 454 | outName = true; 455 | } 456 | 457 | String msa = ini.get("msa", "save_msa"); 458 | 459 | if (msa.equals("yes")) saveMsa = true; 460 | String msaPath = ini.get("msa", "msa_path"); 461 | msaPath = msaPath.trim(); 462 | if (msaPath.charAt(msaPath.length() - 1) != '/') { 463 | msaPath = msaPath + '/'; 464 | } 465 | 466 | msaPath1 = msaPath; 467 | if (msaPath.contains("[name]")) { 468 | int name = msaPath.indexOf("[name]"); 469 | msaPath1 = msaPath.substring(0, name); 470 | msaPath2 = msaPath.substring(name + 6); 471 | msaName = true; 472 | } 473 | 474 | 475 | cloudsChannel = Integer.parseInt(ini.get("msa", "cloud_channel")); 476 | 477 | landChannel = Integer.parseInt(ini.get("msa", "land_channel")); 478 | String clouds = ini.get("msa", "cloud_channel_he"), lands = ini.get("msa", "land_channel_he"); 479 | 480 | if (clouds.equals("yes")) cloudHe = true; 481 | if (lands.equals("yes")) landHe = true; 482 | 483 | cloudThreshold = Integer.parseInt(ini.get("msa", "cloud_threshold")); 484 | 485 | landThreshold = Integer.parseInt(ini.get("msa", "land_threshold")); 486 | 487 | String wColor = ini.get("msa", "water_base_color"); 488 | waterBase = new Color(Integer.parseInt(wColor.substring(0, 2), 16), Integer.parseInt(wColor.substring(2, 4), 16), Integer.parseInt(wColor.substring(4, 6), 16)); 489 | 490 | String lColor = ini.get("msa", "land_base_color"); 491 | landBase = new Color(Integer.parseInt(lColor.substring(0, 2), 16), Integer.parseInt(lColor.substring(2, 4), 16), Integer.parseInt(lColor.substring(4, 6), 16)); 492 | 493 | String cColor = ini.get("msa", "cloud_base_color"); 494 | cloudBase = new Color(Integer.parseInt(cColor.substring(0, 2), 16), Integer.parseInt(cColor.substring(2, 4), 16), Integer.parseInt(cColor.substring(4, 6), 16)); 495 | 496 | landBri = ini.get("msa", "land_brightening", float.class); 497 | waterBri = ini.get("msa", "water_brightening", float.class); 498 | cloudBri = ini.get("msa", "cloud_brightening", float.class); 499 | 500 | String timeS = ini.get("stat", "save_time"); 501 | 502 | if (timeS.equals("yes")) saveTime = true; 503 | 504 | String nameS = ini.get("stat", "save_name"); 505 | 506 | if (nameS.equals("yes")) saveName = true; 507 | String timePath = ini.get("stat", "stat_path"); 508 | 509 | timePath = timePath.trim(); 510 | if (timePath.charAt(timePath.length() - 1) != '/') { 511 | timePath = timePath + '/'; 512 | } 513 | 514 | timePath1 = timePath; 515 | if (timePath.contains("[name]")) { 516 | int name = timePath.indexOf("[name]"); 517 | timePath1 = timePath.substring(0, name); 518 | timePath2 = timePath.substring(name + 6); 519 | timeName = true; 520 | } 521 | timeFormat = ini.get("stat", "time_format"); 522 | timeLanguage = ini.get("stat", "time_language"); 523 | 524 | String composize = ini.get("main", "compo_size"); 525 | String[] composizes = composize.split("x"); 526 | compoSizeW = Integer.parseInt(composizes[0]); 527 | compoSizeH = Integer.parseInt(composizes[1]); 528 | if (compoSizeW * compoSizeH != 20 && !silentMode) 529 | System.out.println("Warning: Invalid composition size! This may result in unexpected program behavior!" + compoSizeW * compoSizeH); 530 | 531 | String savehiscompo = ini.get("histogram_equalization", "save_histogram_compo"); 532 | if (savehiscompo.equals("yes")) saveHisCombo = true; 533 | 534 | String hiscompopath = ini.get("histogram_equalization", "histogram_compo_path"); 535 | hiscompopath = hiscompopath.trim(); 536 | if (hiscompopath.charAt(hiscompopath.length() - 1) != '/') { 537 | hiscompopath = hiscompopath + '/'; 538 | } 539 | hisCompo1 = hiscompopath; 540 | if (hiscompopath.contains("[name]")) { 541 | int name = hiscompopath.indexOf("[name]"); 542 | hisCompo1 = hiscompopath.substring(0, name); 543 | hisCompo2 = hiscompopath.substring(name + 6); 544 | hisCompoName = true; 545 | } 546 | String hiscomposize = ini.get("histogram_equalization", "histogram_compo_size"); 547 | String[] hiscomposizes = hiscomposize.split("x"); 548 | hisCompoSizeW = Integer.parseInt(hiscomposizes[0]); 549 | hisCompoSizeH = Integer.parseInt(hiscomposizes[1]); 550 | if (hisCompoSizeW * hisCompoSizeH != 20 && !silentMode) 551 | System.out.println("Warning: Invalid histogram equalized composition size! This may result in unexpected program behavior!" + hisCompoSizeW * hisCompoSizeH); 552 | 553 | String averagepixels = ini.get("main", "average_pixels"); 554 | if (averagepixels.equals("yes")) averagePixels = true; 555 | 556 | String savergb = ini.get("rgb", "save_rgb"); 557 | saveRgb = savergb.equals("yes"); 558 | 559 | String rgbpath = ini.get("rgb", "rgb_path"); 560 | rgbPath1 = rgbpath; 561 | if (rgbpath.contains("[name]")) { 562 | int name = rgbpath.indexOf("[name]"); 563 | rgbPath1 = rgbpath.substring(0, name); 564 | rgbPath2 = rgbpath.substring(name + 6); 565 | rgbName = true; 566 | } 567 | rgbChR = Integer.parseInt(ini.get("rgb", "rgb_red")); 568 | rgbChG = Integer.parseInt(ini.get("rgb", "rgb_green")); 569 | rgbChB = Integer.parseInt(ini.get("rgb", "rgb_blue")); 570 | rgbRedHe = ini.get("rgb", "rgb_red_he").equals("yes"); 571 | rgbGreenHe = ini.get("rgb", "rgb_green_he").equals("yes"); 572 | rgbBlueHe = ini.get("rgb", "rgb_blue_he").equals("yes"); 573 | 574 | badLineThreshold = Integer.parseInt(ini.get("main", "crop_threshold")); 575 | averagingThreshold = Integer.parseInt(ini.get("main", "averaging_threshold")); 576 | 577 | silentMode = ini.get("main", "silent_mode").equals("yes"); 578 | } 579 | 580 | private static int getNum(int i) { 581 | int num = 0; 582 | switch (i) { 583 | case 0: 584 | num = 1; 585 | break; 586 | case 1: 587 | num = 17; 588 | break; 589 | case 2: 590 | num = 2; 591 | break; 592 | case 3: 593 | num = 3; 594 | break; 595 | case 4: 596 | num = 13; 597 | break; 598 | case 5: 599 | num = 4; 600 | break; 601 | case 6: 602 | num = 18; 603 | break; 604 | case 7: 605 | num = 11; 606 | break; 607 | case 8: 608 | num = 19; 609 | break; 610 | case 9: 611 | num = 7; 612 | break; 613 | case 10: 614 | num = 8; 615 | break; 616 | case 11: 617 | num = 20; 618 | break; 619 | case 12: 620 | num = 10; 621 | break; 622 | case 13: 623 | num = 14; 624 | break; 625 | case 14: 626 | num = 6; 627 | break; 628 | case 15: 629 | num = 5; 630 | break; 631 | case 16: 632 | num = 15; 633 | break; 634 | case 17: 635 | num = 12; 636 | break; 637 | case 18: 638 | num = 16; 639 | break; 640 | case 19: 641 | num = 9; 642 | break; 643 | } 644 | return num; 645 | } 646 | 647 | private static String getWav(int i) { 648 | String wav = ""; 649 | switch (i) { 650 | case 0: 651 | wav = "14.98μm - 14.91μm"; 652 | break; 653 | case 1: 654 | wav = "4.15μm - 4.10μm"; 655 | break; 656 | case 2: 657 | wav = "14.81μm - 14.59μm"; 658 | break; 659 | case 3: 660 | wav = "14.61μm - 14.36μm"; 661 | break; 662 | case 4: 663 | wav = "4.59μm - 4.54μm"; 664 | break; 665 | case 5: 666 | wav = "14.38μm - 14.06μm"; 667 | break; 668 | case 6: 669 | wav = "4.02μm - 3.97μm"; 670 | break; 671 | case 7: 672 | wav = "7.44μm - 7.22μm"; 673 | break; 674 | case 8: 675 | wav = "3.83μm - 3.69μm"; 676 | break; 677 | case 9: 678 | wav = "13.49μm - 13.21μm"; 679 | break; 680 | case 10: 681 | wav = "11.39μm - 10.81μm"; 682 | break; 683 | case 11: 684 | wav = "0.71μm - 0.66μm"; 685 | break; 686 | case 12: 687 | wav = "12.81μm - 12.30μm"; 688 | break; 689 | case 13: 690 | wav = "4.54μm - 4.50μm"; 691 | break; 692 | case 14: 693 | wav = "13.79μm - 13.49μm"; 694 | break; 695 | case 15: 696 | wav = "14.12μm - 13.81μm"; 697 | break; 698 | case 16: 699 | wav = "4.49μm - 4.44μm"; 700 | break; 701 | case 17: 702 | wav = "6.63μm - 6.40μm"; 703 | break; 704 | case 18: 705 | wav = "4.47μm - 4.42μm"; 706 | break; 707 | case 19: 708 | wav = "9.81μm - 9.60μm"; 709 | break; 710 | } 711 | return wav; 712 | } 713 | 714 | private static String getTime(String binary) { 715 | Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone("Etc/GMT+12")); 716 | 717 | int day = Integer.parseInt(binary.substring(0, 9), 2); 718 | long mili = Integer.parseInt(binary.substring(13, 40), 2); 719 | 720 | calendar.set(Calendar.DAY_OF_YEAR, day); 721 | 722 | SimpleDateFormat dateFormat = new SimpleDateFormat(timeFormat, Locale.forLanguageTag(timeLanguage)); 723 | dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); 724 | 725 | int hours = (int) (mili / 3600000) - 24; 726 | calendar.set(Calendar.HOUR, hours); 727 | int minutes = (int) ((mili - (hours + 24) * 3600000) / 60000); 728 | calendar.set(Calendar.MINUTE, minutes); 729 | int seconds = (int) ((mili - minutes * 60000 - (hours + 24) * 3600000) / 1000); 730 | calendar.set(Calendar.SECOND, seconds); 731 | int millis = (int) (mili - seconds * 1000 - minutes * 60000 - (hours + 24) * 3600000); 732 | calendar.set(Calendar.MILLISECOND, millis); 733 | 734 | 735 | return dateFormat.format(calendar.getTime()); 736 | } 737 | 738 | private static int getAverage(int x, int line, BufferedImage image) { 739 | final int[] zero = {0, 0, 0}; 740 | int[] up; 741 | int[] down; 742 | int[] right; 743 | int[] left; 744 | int avVal; 745 | Raster imgRaster = image.getRaster(); 746 | ArrayList pxToAv = new ArrayList<>(); 747 | 748 | if (line > 0) { 749 | up = imgRaster.getPixel(x, line - 1, new int[]{0, 0, 0}); 750 | if (!Arrays.toString(up).equals(Arrays.toString(zero))) { 751 | pxToAv.add(up); 752 | } 753 | } 754 | if (line < image.getHeight() - 1) { 755 | down = imgRaster.getPixel(x, line + 1, new int[]{0, 0, 0}); 756 | 757 | int[] leftr; 758 | int[] rightr; 759 | int[] downr; 760 | ArrayList pxToAvR = new ArrayList<>(); 761 | int avValR = 0; 762 | 763 | if (line + 2 < image.getHeight() - 1) { 764 | downr = imgRaster.getPixel(x, line + 2, new int[]{0, 0, 0}); 765 | 766 | if (!Arrays.toString(downr).equals(Arrays.toString(zero))) { 767 | pxToAvR.add(downr); 768 | } 769 | 770 | } 771 | if (x + 1 < 55) { 772 | rightr = imgRaster.getPixel(x + 1, line + 1, new int[]{0, 0, 0}); 773 | if (!Arrays.toString(rightr).equals(Arrays.toString(zero))) { 774 | pxToAvR.add(rightr); 775 | } 776 | 777 | } 778 | if (x - 1 > 0) { 779 | leftr = imgRaster.getPixel(x - 1, line + 1, new int[]{0, 0, 0}); 780 | if (!Arrays.toString(leftr).equals(Arrays.toString(zero))) { 781 | pxToAvR.add(leftr); 782 | } 783 | 784 | } 785 | int sum = 0; 786 | for (int[] in : pxToAvR) { 787 | sum += in[0]; 788 | } 789 | 790 | if (pxToAvR.size() > 0) avValR = sum / pxToAvR.size(); 791 | 792 | if (!Arrays.toString(down).equals(Arrays.toString(zero)) && Math.abs(imgRaster.getPixel(x, line + 1, new int[]{0, 0, 0})[0] - avValR) < 30) { 793 | pxToAv.add(down); 794 | } 795 | 796 | } 797 | if (x > 0) { 798 | left = imgRaster.getPixel(x - 1, line, new int[]{0, 0, 0}); 799 | if (!Arrays.toString(left).equals(Arrays.toString(zero))) { 800 | pxToAv.add(left); 801 | } 802 | } 803 | if (x < 55) { 804 | right = imgRaster.getPixel(x + 1, line, new int[]{0, 0, 0}); 805 | 806 | int[] upr; 807 | int[] rightr; 808 | int[] downr; 809 | ArrayList pxToAvR = new ArrayList<>(); 810 | int avValR = 0; 811 | 812 | if (line - 1 > 0) { 813 | upr = imgRaster.getPixel(x + 1, line - 1, new int[]{0, 0, 0}); 814 | if (!Arrays.toString(upr).equals(Arrays.toString(zero))) { 815 | pxToAvR.add(upr); 816 | } 817 | } 818 | if (line + 1 < image.getHeight() - 1) { 819 | downr = imgRaster.getPixel(x + 1, line + 1, new int[]{0, 0, 0}); 820 | 821 | if (!Arrays.toString(downr).equals(Arrays.toString(zero))) { 822 | pxToAvR.add(downr); 823 | } 824 | 825 | } 826 | if (x + 2 < 55) { 827 | rightr = imgRaster.getPixel(x + 2, line, new int[]{0, 0, 0}); 828 | if (!Arrays.toString(rightr).equals(Arrays.toString(zero))) { 829 | pxToAvR.add(rightr); 830 | } 831 | 832 | } 833 | int sum = 0; 834 | for (int[] in : pxToAvR) { 835 | sum += in[0]; 836 | } 837 | 838 | if (pxToAvR.size() > 0) avValR = sum / pxToAvR.size(); 839 | 840 | 841 | if (!Arrays.toString(right).equals(Arrays.toString(zero)) && Math.abs(imgRaster.getPixel(x + 1, line, new int[]{0, 0, 0})[0] - avValR) < 30) { 842 | pxToAv.add(right); 843 | } 844 | 845 | } 846 | int sum = 0; 847 | for (int[] in : pxToAv) { 848 | sum += in[0]; 849 | } 850 | 851 | if (pxToAv.size() > 1) { 852 | avVal = sum / pxToAv.size(); 853 | } else avVal = imgRaster.getPixel(x, line, new int[]{0, 0, 0})[0]; 854 | 855 | return avVal; 856 | } 857 | 858 | private static String getSpacecraftName() { 859 | String name = ""; 860 | ArrayList idCount = new ArrayList<>(); 861 | ArrayList idNames = new ArrayList<>(); 862 | for (int id : ids) { 863 | if (idCount.size() > 0) { 864 | boolean ins = false; 865 | for (int idc = 0; idc < idCount.size(); idc++) { 866 | if (id == idNames.get(idc)) { 867 | idCount.set(idc, idCount.get(idc) + 1); 868 | ins = true; 869 | } 870 | } 871 | if (!ins) { 872 | idNames.add(id); 873 | idCount.add(1); 874 | } 875 | } else { 876 | idNames.add(id); 877 | idCount.add(1); 878 | } 879 | } 880 | 881 | int LARGEST = 0; 882 | int lastBiggest = 0; 883 | for (int i = 0; i < idCount.size(); i++) { 884 | if (idCount.get(i) > lastBiggest) { 885 | LARGEST = i; 886 | lastBiggest = idCount.get(i); 887 | } 888 | } 889 | int ID = idNames.get(LARGEST); 890 | 891 | switch (ID) { 892 | case 15: 893 | name = "NOAA 19"; 894 | break; 895 | case 13: 896 | name = "NOAA 18"; 897 | break; 898 | case 8: 899 | name = "NOAA 15"; 900 | break; 901 | } 902 | 903 | return name; 904 | } 905 | 906 | public static void decode(File inputFile) throws IOException { 907 | if (!silentMode) System.out.println("Converting data...."); 908 | name = inputFile.getName().substring(0, inputFile.getName().length() - 4); 909 | 910 | XSSFSheet sheet = workbook.createSheet("Data"); 911 | int rownum = 0; 912 | 913 | Scanner sc = new Scanner(inputFile); 914 | FileInputStream fis = new FileInputStream(inputFile); 915 | byte[] byteArray = new byte[(int) inputFile.length()]; 916 | fis.read(byteArray); 917 | String datacnt = new String(byteArray); 918 | String[] stringArray = datacnt.split("\n"); 919 | int numOfLines = stringArray.length; 920 | int j = 0; 921 | 922 | while (sc.hasNextLine()) { 923 | ArrayList line = new ArrayList<>(Arrays.asList(sc.nextLine().split(" "))); 924 | Row row = sheet.createRow(rownum++); 925 | for (int i = 0; i < line.size(); i++) { 926 | Cell cell = row.createCell(i); 927 | cell.setCellValue(line.get(i)); 928 | } 929 | int prc = 100 * j / numOfLines + 1; 930 | if (!silentMode) System.out.print('\r'); 931 | if (!silentMode) System.out.print(generateFancyProgressBar(prc)); 932 | j++; 933 | } 934 | if (!silentMode) System.out.print('\n'); 935 | 936 | 937 | ArrayList hexFrames = new ArrayList<>(); 938 | 939 | if (!silentMode) System.out.println("OK!" + '\n'); 940 | 941 | if (!silentMode) System.out.println("Reading data...."); 942 | // For each Row. 943 | int rowNum = 0; 944 | File tmp = new File("Time.tmp"); 945 | PrintWriter out = new PrintWriter(tmp); 946 | if (saveTime) { 947 | File timefile; 948 | if (timeName) { 949 | timefile = new File(timePath1 + name + timePath2); 950 | } else { 951 | timefile = new File(timePath1); 952 | } 953 | if (timefile.mkdirs() && !silentMode) System.out.println("Directory created!"); 954 | if (timeName) { 955 | timefile = new File(timePath1 + name + timePath2 + "stat.txt"); 956 | } else { 957 | timefile = new File(timePath1 + "stat.txt"); 958 | } 959 | out = new PrintWriter(timefile); 960 | } 961 | 962 | int cnt = 0; 963 | for (Row row : sheet) { 964 | Cell cell = row.getCell(5); 965 | char fb = '0'; 966 | 967 | try { 968 | switch (cell.getCellType()) { 969 | case NUMERIC: 970 | fb = Integer.toBinaryString(Integer.parseInt("" + (int) cell.getNumericCellValue(), 16)).charAt(Integer.toBinaryString(Integer.parseInt("" + (int) cell.getNumericCellValue(), 16)).length() - 1); 971 | break; 972 | case STRING: 973 | fb = Integer.toBinaryString(Integer.parseInt(cell.getStringCellValue(), 16)).charAt(Integer.toBinaryString(Integer.parseInt(cell.getStringCellValue(), 16)).length() - 1); 974 | break; 975 | } 976 | }catch (NullPointerException e){ 977 | fb = '0'; 978 | } 979 | 980 | cell = row.getCell(6); 981 | 982 | String value; 983 | 984 | switch (cell.getCellType()) { 985 | case NUMERIC: 986 | value = Integer.toBinaryString(Integer.parseInt("" + (int) cell.getNumericCellValue(), 16)); 987 | 988 | StringBuilder addBuilder = new StringBuilder(); 989 | for (int o = 0; o < 8 - value.length(); o++) { 990 | addBuilder.append("0"); 991 | } 992 | String add = addBuilder.toString(); 993 | value = add + value; 994 | value = fb + value; 995 | frmCnt.add(Integer.parseInt(value, 2)); 996 | break; 997 | case STRING: 998 | value = Integer.toBinaryString(Integer.parseInt(cell.getStringCellValue(), 16)); 999 | add = ""; 1000 | StringBuilder addBuilder1 = new StringBuilder(add); 1001 | for (int o = 0; o < 8 - value.length(); o++) { 1002 | addBuilder1.append("0"); 1003 | } 1004 | add = addBuilder1.toString(); 1005 | value = add + value; 1006 | value = fb + value; 1007 | frmCnt.add(Integer.parseInt(value, 2)); 1008 | break; 1009 | } 1010 | //System.out.println(frmCnt.get(frmCnt.size()-1)); 1011 | 1012 | 1013 | cell = row.getCell(17); 1014 | 1015 | switch (cell.getCellType()) { 1016 | case NUMERIC: 1017 | mirrorPos.add(Integer.parseInt("" + (int) cell.getNumericCellValue(), 16)); 1018 | break; 1019 | case STRING: 1020 | mirrorPos.add(Integer.parseInt(cell.getStringCellValue(), 16)); 1021 | break; 1022 | } 1023 | 1024 | cell = row.getCell(4); 1025 | String binMFC = ""; 1026 | 1027 | switch (cell.getCellType()) { 1028 | case NUMERIC: 1029 | binMFC = Integer.toBinaryString(Integer.parseInt(String.valueOf((int) cell.getNumericCellValue()), 16)); 1030 | break; 1031 | case STRING: 1032 | binMFC = Integer.toBinaryString(Integer.parseInt(cell.getStringCellValue(), 16)); 1033 | break; 1034 | } 1035 | 1036 | 1037 | StringBuilder zer = new StringBuilder(); 1038 | 1039 | for (int o = 0; o < 8 - binMFC.length(); o++) { 1040 | zer.append("0"); 1041 | } 1042 | binMFC = zer.toString() + binMFC; 1043 | 1044 | cell = row.getCell(3); 1045 | String nam = ""; 1046 | 1047 | switch (cell.getCellType()) { 1048 | case NUMERIC: 1049 | nam = Integer.toBinaryString(Integer.parseInt(String.valueOf((int) cell.getNumericCellValue()), 16)); 1050 | break; 1051 | case STRING: 1052 | nam = Integer.toBinaryString(Integer.parseInt(cell.getStringCellValue(), 16)); 1053 | break; 1054 | } 1055 | 1056 | 1057 | StringBuilder namb = new StringBuilder(); 1058 | 1059 | for (int o = 0; o < 8 - nam.length(); o++) { 1060 | namb.append("0"); 1061 | } 1062 | nam = namb.toString() + nam; 1063 | 1064 | nam = nam.substring(4); 1065 | int id = Integer.parseInt(nam, 2); 1066 | ids.add(id); 1067 | 1068 | majorFrmCnt.add(Integer.parseInt(binMFC.substring(3, 6), 2)); 1069 | 1070 | if (frmCnt.get(frmCnt.size() - 1) == 0) { 1071 | StringBuilder stringBuilder = new StringBuilder(); 1072 | for (int i = 9; i < 14; i++) { 1073 | cell = row.getCell(i); 1074 | 1075 | switch (cell.getCellType()) { 1076 | case NUMERIC: 1077 | String str = Integer.toBinaryString(Integer.parseInt(String.valueOf((int) cell.getNumericCellValue()), 16)); 1078 | StringBuilder add = new StringBuilder(); 1079 | for (int o = 0; o < 8 - str.length(); o++) { 1080 | add.append("0"); 1081 | } 1082 | str = add.toString() + str; 1083 | stringBuilder.append(str); 1084 | break; 1085 | case STRING: 1086 | String str1 = Integer.toBinaryString(Integer.parseInt(cell.getStringCellValue(), 16)); 1087 | StringBuilder add1 = new StringBuilder(); 1088 | for (int o = 0; o < 8 - str1.length(); o++) { 1089 | add1.append("0"); 1090 | } 1091 | str1 = add1.toString() + str1; 1092 | stringBuilder.append(str1); 1093 | break; 1094 | } 1095 | } 1096 | String[] time = {String.valueOf(rowNum), stringBuilder.toString()}; 1097 | //timeList.add(time); 1098 | out.println(getTime(time[1])); 1099 | } 1100 | 1101 | for (int column : COLUMNS) { 1102 | cell = row.getCell(column); 1103 | 1104 | if (cell == null) { 1105 | hexFrames.add("00"); 1106 | } else { 1107 | switch (cell.getCellType()) { 1108 | case NUMERIC: 1109 | hexFrames.add(String.valueOf((int) cell.getNumericCellValue())); 1110 | break; 1111 | case STRING: 1112 | hexFrames.add(cell.getStringCellValue()); 1113 | break; 1114 | } 1115 | } 1116 | } 1117 | StringBuilder frame = new StringBuilder(); 1118 | for (String hexFrame : hexFrames) { 1119 | int val = Integer.parseInt(hexFrame, 16); 1120 | String bin = Integer.toBinaryString(val); 1121 | StringBuilder add = new StringBuilder(); 1122 | 1123 | for (int o = 0; o < 8 - bin.length(); o++) { 1124 | add.append("0"); 1125 | } 1126 | bin = add.toString() + bin; 1127 | 1128 | frame.append(bin); 1129 | } 1130 | frames.add(frame.toString()); 1131 | hexFrames.clear(); 1132 | if (!silentMode) System.out.print('\r'); 1133 | if (!silentMode) System.out.print(generateFancyProgressBar(100 * cnt / numOfLines + 1)); 1134 | 1135 | rowNum++; 1136 | cnt++; 1137 | } 1138 | if (!silentMode) System.out.print('\n'); 1139 | 1140 | String spacecraftName = getSpacecraftName(); 1141 | if (!silentMode) System.out.println(spacecraftName); 1142 | if (saveName) out.println('\n' + spacecraftName); 1143 | 1144 | out.close(); 1145 | if (tmp.delete()) { 1146 | if (!silentMode) System.out.println("Tmp files deleted!"); 1147 | } 1148 | if (!silentMode) System.out.println("OK, found " + frmCnt.size() + " lines." + '\n'); 1149 | 1150 | if (!silentMode) System.out.println("Checking for missing data...."); 1151 | for (int i = 0; i < frmCnt.size(); i++) { 1152 | if (frmCnt.get(i) == 0 || frmCnt.get(i) == 64 || frmCnt.get(i) == 128 || frmCnt.get(i) == 192 || frmCnt.get(i) == 256) { 1153 | if (frmCnt.get(i) % 64 == mirrorPos.get(i)) { 1154 | starts.add(i); 1155 | } 1156 | } 1157 | } 1158 | 1159 | for (String frame : frames) { 1160 | framePixels.add(frame.substring(26, 286)); 1161 | validDataBit.add(frame.charAt(286)); 1162 | } 1163 | 1164 | for (int i = 1; i < starts.size(); i++) { 1165 | int missingLines = 0; 1166 | if (frmCnt.get(starts.get(i)) - 64 != frmCnt.get(starts.get(i - 1)) && frmCnt.get(starts.get(i)) != 0) { 1167 | if (!silentMode) 1168 | System.out.println("Found missing data at: " + i + " (" + frmCnt.get(starts.get(i - 1)) + "; " + frmCnt.get(starts.get(i)) + "; " + majorFrmCnt.get(starts.get(i - 1)) + "; " + majorFrmCnt.get(starts.get(i)) + ")"); 1169 | if (majorFrmCnt.get(starts.get(i - 1)).equals(majorFrmCnt.get(starts.get(i)))) { 1170 | missingLines = (frmCnt.get(starts.get(i)) - frmCnt.get(starts.get(i - 1))) / 64 - 1; 1171 | } else if (starts.get(i - 1) < frmCnt.get(starts.get(i))) { 1172 | missingLines = (320 - starts.get(i - 1)) / 64 + starts.get(i) / 64 - 1; 1173 | } 1174 | } 1175 | int[] data = {i, missingLines}; 1176 | missingLinesList.add(data); 1177 | totalMissingLines += missingLines; 1178 | 1179 | } 1180 | if (!silentMode) System.out.println(); 1181 | 1182 | } 1183 | 1184 | public static void makeImages() { 1185 | BufferedImage compoImg = new BufferedImage(56 * compoSizeW, (starts.size() + totalMissingLines) * compoSizeH, BufferedImage.TYPE_INT_RGB); 1186 | BufferedImage hisCompoImg = new BufferedImage(56 * hisCompoSizeW, (starts.size() + totalMissingLines) * hisCompoSizeH, BufferedImage.TYPE_INT_RGB); 1187 | 1188 | Graphics g = compoImg.getGraphics(); 1189 | Graphics gh = hisCompoImg.getGraphics(); 1190 | 1191 | BufferedImage cloud = new BufferedImage(56, starts.size() + totalMissingLines, BufferedImage.TYPE_INT_RGB); 1192 | BufferedImage land = new BufferedImage(56, starts.size() + totalMissingLines, BufferedImage.TYPE_INT_RGB); 1193 | BufferedImage rgbImage = new BufferedImage(56, starts.size() + totalMissingLines, BufferedImage.TYPE_INT_RGB); 1194 | 1195 | for (int i = 0; i < 20; i++) { 1196 | BufferedImage image = new BufferedImage(56, starts.size() + totalMissingLines, BufferedImage.TYPE_INT_RGB); 1197 | 1198 | rgbImage.getData().createCompatibleWritableRaster(); 1199 | int skipped = 0; 1200 | 1201 | for (int line = 0; line < starts.size(); line++) { 1202 | 1203 | for (int[] data : missingLinesList) { 1204 | if (data[0] == line) { 1205 | for (int w = 0; w < data[1]; w++) { 1206 | skipped++; 1207 | } 1208 | } 1209 | } 1210 | 1211 | for (int o = 0; o < 56; o++) { 1212 | Color color; 1213 | int x; 1214 | try { 1215 | x = mirrorPos.get(starts.get(line) + o - 1); 1216 | 1217 | if (x < 56 && validDataBit.get(starts.get(line) + o - 1) == '1') { 1218 | 1219 | boolean negative = false; 1220 | if (framePixels.get(starts.get(line) + o).charAt(13 * i) == '0') negative = true; 1221 | int val = Integer.parseInt(framePixels.get(starts.get(line) + o).substring(13 * i + 1, 13 * i + 13), 2); 1222 | int col; 1223 | if (fullBW) { 1224 | if (negative) { 1225 | val = 4095 - val; 1226 | } else { 1227 | val += 4095; 1228 | } 1229 | 1230 | col = (255 * val) / 8190; 1231 | } else { 1232 | col = (255 * val) / 4095; 1233 | } 1234 | 1235 | 1236 | color = new Color(col, col, col); 1237 | 1238 | //if (negative){ 1239 | // color = new Color(col, 0, 0); 1240 | //} 1241 | 1242 | image.setRGB(x, line + skipped, color.getRGB()); 1243 | 1244 | } 1245 | } catch (IndexOutOfBoundsException ignored) { 1246 | 1247 | } 1248 | } 1249 | 1250 | } 1251 | 1252 | if (doCrop) { 1253 | if (i == 0) { 1254 | image = crop(image, true, 0, 0); 1255 | compoImg = new BufferedImage(56 * compoSizeW, image.getHeight() * compoSizeH, BufferedImage.TYPE_INT_RGB); 1256 | hisCompoImg = new BufferedImage(56 * hisCompoSizeW, image.getHeight() * hisCompoSizeH, BufferedImage.TYPE_INT_RGB); 1257 | 1258 | g = compoImg.getGraphics(); 1259 | gh = hisCompoImg.getGraphics(); 1260 | cloud = new BufferedImage(56, starts.size() + totalMissingLines, BufferedImage.TYPE_INT_RGB); 1261 | land = new BufferedImage(56, image.getHeight(), BufferedImage.TYPE_INT_RGB); 1262 | rgbImage = new BufferedImage(56, image.getHeight(), BufferedImage.TYPE_INT_RGB); 1263 | } else { 1264 | image = crop(image, false, firstGoodLine, croppedImgH); 1265 | 1266 | } 1267 | } 1268 | 1269 | 1270 | if (averagePixels) { 1271 | BufferedImage avrImg = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_BGR); 1272 | Raster imgRaster = image.getRaster(); 1273 | int[] pat = {0, 0, 0}; 1274 | 1275 | for (int i1 = 0; i1 < avrImg.getWidth() * avrImg.getHeight(); i1++) { 1276 | int px = i1 % 56; 1277 | int line = (i1 - px) / 56; 1278 | int av = getAverage(px, line, image); 1279 | 1280 | if (Math.abs(imgRaster.getPixel(px, line, pat)[0] - av) > averagingThreshold) { 1281 | image.setRGB(px, line, new Color(av, av, av).getRGB()); 1282 | } 1283 | } 1284 | } 1285 | 1286 | int num = getNum(i); 1287 | String wav = getWav(i); 1288 | 1289 | 1290 | if (saveCompo) { 1291 | int x = (num - 1) % compoSizeW; 1292 | int line = (num - 1 - x) / compoSizeW; 1293 | g.drawImage(image, x * 56, line * image.getHeight(), null); 1294 | } 1295 | 1296 | if (saveHisCombo) { 1297 | int x = (num - 1) % hisCompoSizeW; 1298 | int line = (num - 1 - x) / hisCompoSizeW; 1299 | gh.drawImage(equalize(image), x * 56, line * image.getHeight(), null); 1300 | } 1301 | 1302 | if (outName) { 1303 | saveImg(out1 + name + out2 + "Channel " + (num) + " (" + wav + ")" + "." + saveType, saveType, image); 1304 | } else { 1305 | saveImg(out1 + "Channel " + (num) + " (" + wav + ")" + "." + saveType, saveType, image); 1306 | } 1307 | 1308 | 1309 | if (doHis) { 1310 | if (hisName) { 1311 | saveImg(hisPath1 + name + hisPath2 + "Channel " + (num) + " (" + wav + ")" + "." + saveType, saveType, equalize(image)); 1312 | } else { 1313 | saveImg(hisPath1 + "Channel " + (num) + " (" + wav + ")" + "." + saveType, saveType, equalize(image)); 1314 | } 1315 | } 1316 | 1317 | if (saveMsa) { 1318 | if (num == cloudsChannel) { 1319 | if (!cloudHe) cloud = image; 1320 | if (cloudHe) cloud = equalize(image); 1321 | } 1322 | if (num == landChannel) { 1323 | if (!landHe) land = image; 1324 | if (landHe) land = equalize(image); 1325 | } 1326 | } 1327 | 1328 | if (saveRgb) { 1329 | for (int i1 = 0; i1 < image.getWidth() * image.getHeight(); i1++) { 1330 | int x = i1 % 56; 1331 | int line = (i1 - x) / 56; 1332 | if (getNum(i) == rgbChR) { 1333 | /* 1334 | Raster inRast; 1335 | if (rgbRedHe){ 1336 | inRast = equalize(image).getData(); 1337 | }else { 1338 | inRast = image.getData(); 1339 | } 1340 | int[] val = rast.getPixel(x, line, new int[] {0,0,0}); 1341 | val[0] = inRast.getPixel(x,line, new int[]{0,0,0})[0]; 1342 | rgbImage.setRGB(x, line, new Color(val[0], val[1], val[2]).getRGB()); 1343 | 1344 | */ 1345 | 1346 | Color exCol = new Color(rgbImage.getRGB(x, line)); 1347 | rgbImage.setRGB(x, line, new Color(new Color(image.getRGB(x, line)).getRed(), exCol.getGreen(), exCol.getBlue()).getRGB()); 1348 | if (rgbRedHe) 1349 | rgbImage.setRGB(x, line, new Color(new Color(equalize(image).getRGB(x, line)).getRed(), exCol.getGreen(), exCol.getBlue()).getRGB()); 1350 | } 1351 | if (getNum(i) == rgbChG) { 1352 | /* 1353 | Raster inRast; 1354 | if (rgbGreenHe){ 1355 | inRast = equalize(image).getData(); 1356 | }else { 1357 | inRast = image.getData(); 1358 | } 1359 | int[] val = rast.getPixel(x, line, new int[] {0,0,0}); 1360 | val[1] = inRast.getPixel(x,line, new int[]{0,0,0})[0]; 1361 | rgbImage.setRGB(x, line, new Color(val[0], val[1], val[2]).getRGB()); 1362 | 1363 | */ 1364 | Color exCol = new Color(rgbImage.getRGB(x, line)); 1365 | rgbImage.setRGB(x, line, new Color(exCol.getRed(), new Color(image.getRGB(x, line)).getGreen(), exCol.getBlue()).getRGB()); 1366 | if (rgbGreenHe) 1367 | rgbImage.setRGB(x, line, new Color(exCol.getRed(), new Color(equalize(image).getRGB(x, line)).getGreen(), exCol.getBlue()).getRGB()); 1368 | } 1369 | if (getNum(i) == rgbChB) { 1370 | /* 1371 | Raster inRast; 1372 | if (rgbBlueHe){ 1373 | inRast = equalize(image).getData(); 1374 | }else { 1375 | inRast = image.getData(); 1376 | } 1377 | int[] val = rast.getPixel(x, line, new int[] {0,0,0}); 1378 | val[2] = inRast.getPixel(x,line, new int[]{0,0,0})[0]; 1379 | rgbImage.setRGB(x, line, new Color(val[0], val[1], val[2]).getRGB()); 1380 | 1381 | */ 1382 | Color exCol = new Color(rgbImage.getRGB(x, line)); 1383 | rgbImage.setRGB(x, line, new Color(exCol.getRed(), exCol.getGreen(), new Color(image.getRGB(x, line)).getBlue()).getRGB()); 1384 | if (rgbBlueHe) 1385 | rgbImage.setRGB(x, line, new Color(exCol.getRed(), exCol.getGreen(), new Color(equalize(image).getRGB(x, line)).getBlue()).getRGB()); 1386 | } 1387 | } 1388 | } 1389 | 1390 | } 1391 | 1392 | if (saveRgb) { 1393 | if (rgbName) { 1394 | saveImg(rgbPath1 + name + rgbPath2 + "Rgb." + saveType, saveType, rgbImage); 1395 | } else { 1396 | saveImg(rgbPath1 + "Rgb." + saveType, saveType, rgbImage); 1397 | } 1398 | } 1399 | 1400 | if (saveMsa) { 1401 | if (msaName) { 1402 | generateMsa(cloud, land, msaPath1, msaPath2, name, landThreshold, cloudThreshold); 1403 | } else { 1404 | generateMsa(cloud, land, msaPath1, "", "", landThreshold, cloudThreshold); 1405 | } 1406 | } 1407 | 1408 | if (saveCompo) { 1409 | if (compoName) { 1410 | saveImg(compo1 + name + compo2 + "Compo." + saveType, saveType, compoImg); 1411 | } else { 1412 | saveImg(compo1 + "Compo." + saveType, saveType, compoImg); 1413 | } 1414 | } 1415 | if (saveHisCombo) { 1416 | if (hisCompoName) { 1417 | saveImg(hisCompo1 + name + hisCompo2 + "HE_Compo." + saveType, saveType, hisCompoImg); 1418 | } else { 1419 | saveImg(hisCompo1 + "HE_Compo." + saveType, saveType, hisCompoImg); 1420 | } 1421 | } 1422 | 1423 | try { 1424 | if (saveXlsx) { 1425 | File file; 1426 | if (xlsxName) { 1427 | file = new File(xlsxP1 + name + xlsxP2); 1428 | } else { 1429 | file = new File(xlsxP1); 1430 | } 1431 | if (file.mkdirs() && !silentMode) System.out.println("Directory created!"); 1432 | 1433 | if (xlsxName) { 1434 | file = new File(xlsxP1 + name + xlsxP2 + name + ".xlsx"); 1435 | } else { 1436 | file = new File(xlsxP1 + name + ".xlsx"); 1437 | } 1438 | FileOutputStream outs = new FileOutputStream(file); 1439 | workbook.write(outs); 1440 | outs.close(); 1441 | } 1442 | 1443 | } catch (Exception e) { 1444 | e.printStackTrace(); 1445 | } 1446 | } 1447 | 1448 | private static String generateFancyProgressBar(int percent) { 1449 | int part = percent / 5; 1450 | StringBuilder buff = new StringBuilder(); 1451 | buff.append("["); 1452 | 1453 | for (int i = 0; i < part && part < 11; i++) { 1454 | buff.append('='); 1455 | } 1456 | for (int i = 0; i < 10 - part && part < 11; i++) { 1457 | buff.append(' '); 1458 | } 1459 | if (part > 10) buff.append("=========="); 1460 | buff.append(percent); 1461 | buff.append("%"); 1462 | if (part < 10) buff.append(" "); 1463 | 1464 | for (int i = 10; i < part; i++) { 1465 | buff.append('='); 1466 | } 1467 | for (int i = 0; i < 20 - part && part > 9; i++) { 1468 | buff.append(' '); 1469 | } 1470 | buff.append(']'); 1471 | 1472 | return buff.toString(); 1473 | } 1474 | } 1475 | --------------------------------------------------------------------------------