Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix geos proj parameters for Insat 3d satellites #2969

Merged
merged 4 commits into from
Nov 13, 2024

Conversation

mraspaud
Copy link
Member

@mraspaud mraspaud commented Nov 6, 2024

This PR fixes the lfac parameter for the area computation of the Insat 3d satellites.

  • Tests added

@mraspaud
Copy link
Member Author

mraspaud commented Nov 6, 2024

Here come some comparison imagery for Insat 3DR (data from 1st of march 2024, 6:45 utc)
Main:
MIR3DR_main

This PR:
MIR3DR

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.10%. Comparing base (9d6a879) to head (73fc304).
Report is 37 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2969   +/-   ##
=======================================
  Coverage   96.10%   96.10%           
=======================================
  Files         377      377           
  Lines       55134    55135    +1     
=======================================
+ Hits        52984    52985    +1     
  Misses       2150     2150           
Flag Coverage Δ
behaviourtests 3.94% <0.00%> (-0.01%) ⬇️
unittests 96.19% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mraspaud
Copy link
Member Author

mraspaud commented Nov 6, 2024

The reverse engineering was made possible through a ncml file for the same data:

<?xml version="1.0" encoding="UTF-8"?>
<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2" location="3RIMG_04NOV2024_0715_L1B_STD_4.h5">
  <dimension name="X" length="2805" />
  <dimension name="Y" length="2816" />
  <dimension name="time" length="1" isUnlimited="true" />
  <attribute name="Conventions" value="CF-1.6" />
  <variable name="X" shape="X" type="double">
    <attribute name="long_name" value="x coordinate of projection" />
    <attribute name="standard_name" value="projection_x_coordinate" />
    <attribute name="units" value="Km" />
  </variable>
  <variable name="Y" shape="Y" type="double">
    <attribute name="long_name" value="y coordinate of projection" />
    <attribute name="standard_name" value="projection_y_coordinate" />
    <attribute name="units" value="Km" />
  </variable>
  <variable name="time" shape="time" type="double">
    <attribute name="long_name" value="time" />
    <attribute name="standard_name" value="time" />
    <attribute name="units" value="minutes since 2000-01-01 00:00:00" />
  </variable>
  <variable name="Projection_Info" type="int">
    <attribute name="grid_mapping_name" value="MSGnavigation" />
    <attribute name="longitude_of_projection_origin" type="double" value="74." />
    <attribute name="latitude_of_projection_origin" type="double" value="0." />
    <attribute name="semi_major_axis" type="double" value="6378169." />
    <attribute name="semi_minor_axis" type="double" value="6356583.8" />
    <attribute name="height_from_earth_center" type="double" value="42164000.0018066" />
    <attribute name="scale_x" type="double" value="8928.57142857143" />
    <attribute name="scale_y" type="double" value="8928.57142857143" />
  </variable>
  <variable name="IMG_TIR1" shape="time Y X" type="short">
    <attribute name="long_name" value="Thermal Infrared1 Count" />
    <attribute name="invert" value="true" />
    <attribute name="central_wavelength" type="float" value="10.785" />
    <attribute name="bandwidth" type="float" value="1." />
    <attribute name="wavelength_unit" value="micron" />
    <attribute name="bits_per_pixel" type="int" value="10" />
    <attribute name="resolution" type="float" value="4." />
    <attribute name="resolution_unit" value="km" />
    <attribute name="_FillValue" type="short" value="1023" />
    <attribute name="lab_radiance_scale_factor" type="float" value="0.0017001" />
    <attribute name="lab_radiance_add_offset" type="float" value="-0.0148718" />
    <attribute name="lab_radiance_quad" type="double" value="-4.23297e-07" />
    <attribute name="lab_radiance_scale_factor_gsics" type="float" value="0.0023433" />
    <attribute name="lab_radiance_add_offset_gsics" type="float" value="-0.170225" />
    <attribute name="lab_radiance_quad_gsics" type="double" value="-5.83443e-07" />
    <attribute name="radiance_units" value="mW.cm-2.sr-1.micron-1" />
    <attribute name="grid_mapping" value="Projection_Info" />
    <attribute name="min_range" type="short" value="278" />
    <attribute name="max_range" type="short" value="950" />
  </variable>
  <variable name="IMG_TIR1_TEMP2D" shape="time Y X" type="short">
    <attribute name="grid_mapping" value="Projection_Info" />
    <attribute name="_FillValue" type="short" value="-999" />
    <attribute name="long_name" value="Thermal Infrared1 Brightness Temperature" />
    <attribute name="units" value="K" />
    <attribute name="min_range" type="float" value="179.8595" />
    <attribute name="max_range" type="float" value="318.2038" />
    <attribute name="add_offset" type="float" value="178." />
    <attribute name="scale_factor" type="float" value="0.01" />
  </variable>
  <variable name="IMG_TIR2" shape="time Y X" type="short">
    <attribute name="central_wavelength" type="float" value="11.966" />
    <attribute name="bandwidth" type="float" value="1." />
    <attribute name="wavelength_unit" value="micron" />
    <attribute name="bits_per_pixel" type="int" value="10" />
    <attribute name="resolution" type="float" value="4." />
    <attribute name="resolution_unit" value="km" />
    <attribute name="_FillValue" type="short" value="1023" />
    <attribute name="lab_radiance_scale_factor" type="float" value="0.00154071" />
    <attribute name="lab_radiance_add_offset" type="float" value="-0.012394" />
    <attribute name="lab_radiance_quad" type="double" value="-4.33804e-07" />
    <attribute name="lab_radiance_scale_factor_gsics" type="float" value="0.00227437" />
    <attribute name="lab_radiance_add_offset_gsics" type="float" value="-0.164386" />
    <attribute name="lab_radiance_quad_gsics" type="double" value="-6.40373e-07" />
    <attribute name="radiance_units" value="mW.cm-2.sr-1.micron-1" />
    <attribute name="long_name" value="Thermal Infrared2 Count" />
    <attribute name="invert" value="true" />
    <attribute name="grid_mapping" value="Projection_Info" />
    <attribute name="min_range" type="short" value="320" />
    <attribute name="max_range" type="short" value="950" />
  </variable>
  <variable name="IMG_TIR2_TEMP2D" shape="time Y X" type="short">
    <attribute name="grid_mapping" value="Projection_Info" />
    <attribute name="_FillValue" type="short" value="-999" />
    <attribute name="long_name" value="Thermal Infrared2 Brightness Temperature" />
    <attribute name="units" value="K" />
    <attribute name="min_range" type="float" value="179.9262" />
    <attribute name="max_range" type="float" value="316.9819" />
    <attribute name="add_offset" type="float" value="178." />
    <attribute name="scale_factor" type="float" value="0.01" />
  </variable>
  <variable name="IMG_MIR" shape="time Y X" type="short">
    <attribute name="bits_per_pixel" type="int" value="10" />
    <attribute name="resolution" type="float" value="4." />
    <attribute name="resolution_unit" value="km" />
    <attribute name="_FillValue" type="short" value="1023" />
    <attribute name="lab_radiance_scale_factor" type="float" value="0.000294709" />
    <attribute name="lab_radiance_add_offset" type="float" value="-0.00483359" />
    <attribute name="lab_radiance_quad" type="double" value="-2.00028e-12" />
    <attribute name="lab_radiance_scale_factor_gsics" type="float" value="0.000348625" />
    <attribute name="lab_radiance_add_offset_gsics" type="float" value="-0.0119962" />
    <attribute name="lab_radiance_quad_gsics" type="double" value="-2.36622e-12" />
    <attribute name="radiance_units" value="mW.cm-2.sr-1.micron-1" />
    <attribute name="wavelength_unit" value="micron" />
    <attribute name="central_wavelength" type="float" value="3.907" />
    <attribute name="bandwidth" type="float" value="0.2" />
    <attribute name="long_name" value="Middle Infrared Count" />
    <attribute name="invert" value="true" />
    <attribute name="grid_mapping" value="Projection_Info" />
    <attribute name="min_range" type="short" value="173" />
    <attribute name="max_range" type="short" value="999" />
  </variable>
  <variable name="IMG_MIR_TEMP2D" shape="time Y X" type="short">
    <attribute name="grid_mapping" value="Projection_Info" />
    <attribute name="_FillValue" type="short" value="-999" />
    <attribute name="long_name" value="Middle Infrared Brightness Temperature" />
    <attribute name="units" value="K" />
    <attribute name="min_range" type="float" value="179.693" />
    <attribute name="max_range" type="float" value="339.7875" />
    <attribute name="add_offset" type="float" value="178." />
    <attribute name="scale_factor" type="float" value="0.01" />
  </variable>
  <variable name="TIR2_TIR1_BT_DIFF" shape="time Y X" type="float">
    <attribute name="long_name" value="TIR2 TIR1 BT Difference" />
    <attribute name="grid_mapping" value="Projection_Info" />
    <attribute name="units" value="K" />
    <attribute name="_FillValue" type="float" value="-999." />
    <attribute name="min_range" type="float" value="-35.28999" />
    <attribute name="max_range" type="float" value="21.89999" />
  </variable>
  <variable name="TIR1_MIR_BT_DIFF" shape="time Y X" type="float">
    <attribute name="long_name" value="TIR1 MIR BT Difference" />
    <attribute name="grid_mapping" value="Projection_Info" />
    <attribute name="units" value="K" />
    <attribute name="_FillValue" type="float" value="-999." />
    <attribute name="min_range" type="float" value="-94.35001" />
    <attribute name="max_range" type="float" value="64.78" />
  </variable>
</netcdf>

and the code that generated it:
https://github.com/Unidata/netcdf-java/blob/maint-5.x/cdm/core/src/main/java/ucar/unidata/geoloc/projection/sat/MSGnavigation.java

@coveralls
Copy link

coveralls commented Nov 6, 2024

Pull Request Test Coverage Report for Build 11720603491

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 96.206%

Totals Coverage Status
Change from base Build 11720571998: 0.0%
Covered Lines: 53229
Relevant Lines: 55328

💛 - Coveralls

@mraspaud
Copy link
Member Author

mraspaud commented Nov 7, 2024

Latest version of this PR (with right offset):
MIR3DR

@mraspaud
Copy link
Member Author

mraspaud commented Nov 7, 2024

I also tried using the provided longitude and latitude arrays to estimate the right cfac/lfac or fov, but nothing conclusive comes out of it. We could use that method to compute lfac and cfac, but I can't see any improvement in the resulting navigation when doing that. So until we have some concrete information from eg MOSDAC, I suggest we keep this as it is.

@mraspaud
Copy link
Member Author

I'm merging this for now. We can open another issue or PR when we get more information.

@mraspaud mraspaud merged commit c214917 into pytroll:main Nov 13, 2024
18 checks passed
@mraspaud mraspaud deleted the fix-insat-geoloc branch November 13, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants