-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from ninahakansson/fix_ci_and_authors
Fix github tests
- Loading branch information
Showing
39 changed files
with
184 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<!-- Describe what your PR does, and why --> | ||
|
||
- [ ] Closes #xxxx <!-- remove if there is no corresponding issue, which should only be the case for minor changes --> | ||
- [ ] Closes #xxxx <!-- remove if there is no corresponding issue | ||
- [ ] Tests added <!-- for all bug fixes or enhancements --> | ||
- [ ] Tests passed: Passes ``pytest level1c4pps`` <!-- for all non-documentation changes) --> | ||
- [ ] Passes ``flake8`` <!-- remove if you did not edit any Python files --> | ||
- [ ] Fully documented <!-- remove if this change should not be visible to users, e.g., if it is an internal clean-up, or if this is part of a larger project that will be documented later --> | ||
- [ ] Add your name to `AUTHORS.md` if not there already |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
build | ||
dist | ||
*py~ | ||
*pyc | ||
*~ | ||
*.egg* | ||
*.egg* | ||
*#* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Project Contributors | ||
|
||
- [Nina Håkansson] (https://github.com/ninahakansson) | ||
- [Bengt Rydberg] (BengtRydberg)](https://github.com/BengtRydberg) | ||
- [Sara Hörnquist] (shornqui)](https://github.com/shornqui) | ||
- [Inderpreet Kaur] (https://github.com/ikaur17) | ||
- [Salomon Eliasson] (https://github.com/salomoneliassonSMHI) | ||
- [Erik Johansson] (https://github.com/smhi-erik) | ||
- [Stephan Finkensieper] (https://github.com/sfinkens) | ||
- [Adam Dybbroe (adybbroe)] (https://github.com/adybbroe) | ||
- [Martin Raspaud (mraspaud)] (https://github.com/mraspaud) | ||
- [Panu Lahtinen (pnuu)] (https://github.com/pnuu) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,6 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. | ||
# Author(s): | ||
|
||
# Martin Raspaud <[email protected]> | ||
# Nina Hakansson <[email protected]> | ||
# Adam.Dybbroe <[email protected]> | ||
|
||
"""Script to convert AVHRR level-1 to PPS level-1c format using Pytroll/Satpy.""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,6 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. | ||
# Author(s): | ||
|
||
# Martin Raspaud <[email protected]> | ||
# Nina Hakansson <[email protected]> | ||
# Adam.Dybbroe <[email protected]> | ||
|
||
|
||
"""Script to make EUMETSAT GAC level1c in PPS-format with pytroll.""" | ||
|
||
|
@@ -58,7 +52,7 @@ | |
required=False, default=99999, | ||
help="Orbit number (default is 99999).") | ||
options = parser.parse_args() | ||
process_one_file(options.file, options.out_dir, start_line=options.start_line, | ||
process_one_file(options.file, options.out_dir, start_line=options.start_line, | ||
end_line=options.end_line, engine=options.nc_engine, | ||
remove_broken=not options.no_remove_bad, | ||
orbit_n=options.orbit_number) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,6 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. | ||
# Author(s): | ||
|
||
# Martin Raspaud <[email protected]> | ||
# Nina Hakansson <[email protected]> | ||
# Adam.Dybbroe <[email protected]> | ||
|
||
|
||
"""Script to make seviri level1c in PPS-format with pytroll.""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,6 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. | ||
# Author(s): | ||
|
||
# Martin Raspaud <[email protected]> | ||
# Nina Hakansson <[email protected]> | ||
# Adam.Dybbroe <[email protected]> | ||
|
||
"""Script to convert MERSI-2 level-1 to PPS level-1c format using Pytroll/Satpy.""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,6 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. | ||
# Author(s): | ||
|
||
# Martin Raspaud <[email protected]> | ||
# Nina Hakansson <[email protected]> | ||
# Adam.Dybbroe <[email protected]> | ||
|
||
"""Script to convert METIMAGE level-1 to PPS level-1c format using Pytroll/Satpy.""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,6 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. | ||
# Author(s): | ||
|
||
# Martin Raspaud <[email protected]> | ||
# Nina Hakansson <[email protected]> | ||
# Adam.Dybbroe <[email protected]> | ||
|
||
"""Script to convert MODIS level-1 to PPS level-1c format using Pytroll/Satpy.""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,6 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. | ||
# Author(s): | ||
|
||
# Martin Raspaud <[email protected]> | ||
# Nina Hakansson <[email protected]> | ||
# Adam.Dybbroe <[email protected]> | ||
# Stephan Finkensieper <[email protected]> | ||
|
||
# This program was developed by CMSAF to be used for the processing of | ||
# CLAAS3. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,6 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. | ||
# Author(s): | ||
|
||
# Martin Raspaud <[email protected]> | ||
# Nina Hakansson <[email protected]> | ||
# Adam.Dybbroe <[email protected]> | ||
|
||
"""Script to convert SLSTR level-1 to PPS level-1c format using Pytroll/Satpy.""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,6 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. | ||
# Author(s): | ||
|
||
# Martin Raspaud <[email protected]> | ||
# Nina Hakansson <[email protected]> | ||
# Adam.Dybbroe <[email protected]> | ||
# Salomon.Eliasson <[email protected]> | ||
|
||
"""Script to convert VIIRS level-1 to PPS level-1c format using Pytroll/Satpy.""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,6 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. | ||
# Author(s): | ||
|
||
# Martin Raspaud <[email protected]> | ||
# Nina Hakansson <[email protected]> | ||
# Adam.Dybbroe <[email protected]> | ||
|
||
"""Script to convert VIIRS level-1 to PPS level-1c format using Pytroll/Satpy.""" | ||
|
||
|
@@ -41,7 +36,7 @@ | |
help="Output directory where to store the level1c file") | ||
parser.add_argument('--iband', action='store_true', | ||
help="Iband resolution include I01-I03, M15-M16 and optional M09, M14") | ||
parser.add_argument('--reader', type=str, nargs='?', | ||
parser.add_argument('--reader', type=str, nargs='?', | ||
required=False, default="viirs_sdr", | ||
help="VIIRS reader default: viirs_sdr") | ||
parser.add_argument('-ne', '--nc_engine', type=str, nargs='?', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,6 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. | ||
# Author(s): | ||
|
||
# Adam.Dybbroe <[email protected]> | ||
# Nina Hakansson <[email protected]> | ||
|
||
"""Package Initializer for level1c4pps.""" | ||
from importlib.metadata import version | ||
|
@@ -184,12 +180,12 @@ def convert_angles(scene, delete_azimuth=False): | |
'sunazimuth': np.array([-18000, 18000], dtype='int16'), | ||
'satazimuth': np.array([-18000, 18000], dtype='int16'), | ||
}, | ||
'mersi_file_key': { | ||
'mersi_file_key': { | ||
'sunzenith': 'Geolocation/SolarZenithAngle', | ||
'satzenith': 'Geolocation/SensorZenithAngle', | ||
'azimuthdiff': 'Geolocation/SensorSolarAzimuthDifference', | ||
}, | ||
'standard_name': { | ||
'standard_name': { | ||
'sunzenith': 'solar_zenith_angle', | ||
'satzenith': 'sensor_zenith_angle', # platform in ppsv2018 | ||
'azimuthdiff': 'absolute_angle_of_rotation_from_solar_azimuth_to_platform_azimuth', | ||
|
@@ -211,12 +207,12 @@ def convert_angles(scene, delete_azimuth=False): | |
'standard_name': "longitude", | ||
'units': 'degrees_east', | ||
'valid_range': np.array([-180, 180], dtype='float32')} | ||
} | ||
} | ||
|
||
|
||
def make_azidiff_angle(sata, suna, divisor=360): | ||
"""Calculate azimuth difference angle.""" | ||
daz = abs(sata-suna) | ||
daz = abs(sata - suna) | ||
half_divisor = divisor / 2.0 | ||
daz = daz % divisor | ||
if isinstance(daz, np.ndarray): | ||
|
@@ -368,20 +364,21 @@ def adjust_lons_to_valid_range(scene): | |
# scene['lon'] = centered_modulus(scene['lon']) # makes lon loose attrs satpy 0.24.0 | ||
scene['lon'].values = centered_modulus(scene['lon'].values) | ||
|
||
|
||
def fix_sun_earth_distance_correction_factor(scene, band, start_time): | ||
from pyorbital.astronomy import sun_earth_distance_correction | ||
date_control = np.datetime64("2019-01-01T00:00:00") | ||
sun_earth_distance_20190409 = sun_earth_distance_correction(date_control) | ||
sun_earth_distance = sun_earth_distance_correction(start_time) | ||
if (np.abs(sun_earth_distance_20190409 - 0.9833280675966011) < 0.00001 and | ||
np.abs(sun_earth_distance - scene[band].attrs['sun_earth_distance_correction_factor']) < 0.00001): | ||
np.abs(sun_earth_distance - scene[band].attrs['sun_earth_distance_correction_factor']) < 0.00001): | ||
logger.info("The sun earth distance correction attribute contain the sun earth distance, not the square.") | ||
logger.info("Updating and adding sun earth distance correction attributes.") | ||
current_factor = scene[band].attrs['sun_earth_distance_correction_factor'] | ||
scene[band].attrs['satpy_sun_earth_distance_correction_factor'] = current_factor | ||
scene[band].attrs['satpy_sun_earth_distance_correction_factor'] = current_factor | ||
scene[band].attrs['pps_sun_earth_distance_correction_factor'] = sun_earth_distance * sun_earth_distance | ||
scene[band].attrs['sun_earth_distance'] = sun_earth_distance | ||
scene[band].attrs['sun_earth_distance_correction_factor'] = sun_earth_distance * sun_earth_distance | ||
scene[band].attrs['sun_earth_distance_correction_factor'] = sun_earth_distance * sun_earth_distance | ||
|
||
|
||
def set_header_and_band_attrs_defaults(scene, BANDNAMES, PPS_TAGNAMES, REFL_BANDS, irch, orbit_n=0): | ||
|
@@ -413,7 +410,7 @@ def set_header_and_band_attrs_defaults(scene, BANDNAMES, PPS_TAGNAMES, REFL_BAND | |
sensor_name = (fix_too_great_attributes(sensor_name)).upper() | ||
scene.attrs['sensor'] = sensor_name.upper() | ||
scene.attrs['instrument'] = sensor_name.upper() | ||
nowutc = datetime.utcnow() | ||
nowutc = datetime.now(timezone.utc) | ||
scene.attrs['orbit_number'] = int(orbit_n) | ||
scene.attrs['date_created'] = nowutc.strftime("%Y-%m-%dT%H:%M:%SZ") | ||
scene.attrs['version_level1c4pps_satpy'] = satpy.__version__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,6 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. | ||
# Author(s): | ||
|
||
# Martin Raspaud <[email protected]> | ||
# Nina Hakansson <[email protected]> | ||
# Adam.Dybbroe <[email protected]> | ||
|
||
"""Functions to convert AVHRR AAPP or EPS l1b data to a NWCSAF/PPS level-1c formatet netCDF/CF file.""" | ||
|
||
|
@@ -50,9 +45,9 @@ | |
|
||
REFL_BANDS = ['1', '2', '3a'] | ||
|
||
PPS_TAGNAMES = {'1': 'ch_r06', | ||
'2': 'ch_r09', | ||
'3a': 'ch_r16', | ||
PPS_TAGNAMES = {'1': 'ch_r06', | ||
'2': 'ch_r09', | ||
'3a': 'ch_r16', | ||
'3b': 'ch_tb37', | ||
'4': 'ch_tb11', | ||
'5': 'ch_tb12'} | ||
|
@@ -133,5 +128,5 @@ def process_one_scene(scene_files, out_path, engine='h5netcdf', orbit_n=0): | |
encoding=get_encoding_avhrr(scn_)) | ||
print("Saved file {:s} after {:3.1f} seconds".format( | ||
os.path.basename(filename), | ||
time.time()-tic)) | ||
time.time() - tic)) | ||
return filename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,6 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. | ||
# Author(s): | ||
|
||
# Martin Raspaud <[email protected]> | ||
# Nina Hakansson <[email protected]> | ||
# Adam.Dybbroe <[email protected]> | ||
|
||
"""Utilities to convert AVHRR GAC formattet data to PPS level-1c format.""" | ||
|
||
|
@@ -249,5 +244,5 @@ def process_one_file(eumgacfdr_file, out_path='.', reader_kwargs=None, | |
|
||
logger.info("Saved file {:s} after {:3.1f} seconds".format( | ||
os.path.basename(filename), | ||
time.time()-tic)) | ||
time.time() - tic)) | ||
return filename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,6 @@ | |
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. | ||
# Author(s): | ||
|
||
# Martin Raspaud <[email protected]> | ||
# Nina Hakansson <[email protected]> | ||
# Adam.Dybbroe <[email protected]> | ||
|
||
"""Utilities to convert AVHRR GAC formattet data to PPS level-1c format.""" | ||
|
||
|
@@ -39,11 +34,9 @@ | |
get_header_attrs, convert_angles) | ||
import logging | ||
|
||
from packaging.version import Version | ||
logger = logging.getLogger('gac2pps') | ||
|
||
|
||
|
||
BANDNAMES = ['1', '2', '3', '3a', '3b', '4', '5'] | ||
|
||
REFL_BANDS = ['1', '2', '3a'] | ||
|
@@ -171,5 +164,5 @@ def process_one_file(gac_file, out_path='.', reader_kwargs=None, engine='h5netcd | |
|
||
print("Saved file {:s} after {:3.1f} seconds".format( | ||
os.path.basename(filename), | ||
time.time()-tic)) | ||
time.time() - tic)) | ||
return filename |
Oops, something went wrong.