Class MSGnavigation

  • All Implemented Interfaces:
    Serializable, Projection

    public class MSGnavigation
    extends ProjectionImpl
    Port Eumetsat MSG_navigation.c to java. from http://www.eumetsat.int/idcplg?IdcService=GET_FILE&dDocName=zip_tools_msg_nav_c&RevisionSelectionMethod=LatestReleased
    Since:
    Jan 9, 2010
    See Also:
    "http://www.eumetsat.int/idcplg?IdcService=GET_FILE&dDocName=PDF_CGMS_03&RevisionSelectionMethod=LatestReleased", "www.itc.nl/library/papers_2005/conf/gieske_pro.pdf", Serialized Form
    • Field Detail

      • HEIGHT_FROM_EARTH_CENTER

        public static final String HEIGHT_FROM_EARTH_CENTER
        ********************************************************************** Introduction: ============= The Program "MSG_navigation.c" is an example code provided to give the users guidance for a possible implementation of the equations given in the LRIT/HRIT Global Specification [1] to navigate MSG (METEOSAT 8 onwards) data, i.e. to link the pixel coordinates column and line to the corresponding geographical coordinates latitude and longitude.

        Users should take note, however, that it does NOT provide software for reading MSG data either in LRIT/HRIT, in native or any other format and that EUMETSAT cannot guarantee the accuracy of this software. The software is for use with MSG data only and will not work in the given implementation for Meteosat first generation data.

        Two functions/subroutines are provided: pixcoord2geocoord: for conversion of column/line into lat./long. geocoord2pixcoord: for conversion of lat./long. into column/line

        The main routine gives an example how to utilize these two functions by reading a value for column and line at the start of the program on the command line and convert these values into the corresponding geographical coordinates and back again. The results are then printed out on the screen.

        To Compile the program use for example:

        COMMAND PROMPT: gcc MSG_navigation.c -o MSG_navigation -lm

        Run the program by typing

        COMMAND PROMPT: ./MSG_navigation

        ----------------------------------------------------------------------

        NOTE: Please be aware, that the program assumes the MSG image is ordered in the operational scanning direction which means from south to north and from east to west. With that the VIS/IR channels contains of 3712 x 3712 pixels, start to count on the most southern line and the most eastern column with pixel number 1,1.

        NOTE on CFAC/LFAC and COFF/LOFF: The parameters CFAC/LFAC and COFF/LOFF are the scaling coefficients provided by the navigation record of the LRIT/HRIT header and used by the scaling function given in Ref [1], page 28.

        COFF/LOFF are the offsets for column and line which are basically 1856 and 1856 for the VIS/IR channels and refer to the middle of the image (centre pixel). The values regarding the High Resolution Visible Channel (HRVis) will be made available in a later issue of this software.

        CFAC/LFAC are responsible for the image "spread" in the NS and EW directions. They are calculated as follows: CFAC = LFAC = 2^16 / delta with delta = 83.84333 micro Radian (size of one VIS/IR MSG pixel)

        CFAC = LFAC = 781648343.404 rad^-1 for VIS/IR

        which should be rounded to the nearest integer as stated in Ref [1].

        CFAC = LFAC = 781648343 rad^-1 for VIS/IR

        the sign of CFAC/LFAC gives the orientation of the image. Negative sign give data scanned from south to north as in the operational scanning. Positive sign vice versa.

        The terms "line" and "row" are used interchangeable.

        PLEASE NOTE that the values of CFAC/LFAC which are given in the Header of the LRIT/HRIT Level 1.5 Data (see [2]) are actually in Degrees and should be converted in Radians for use with these routines (see example and values above).

        The other parameters are given in Ref [1].

        Further information may be found in either Ref [1], Ref [2] or Ref [3] or on the Eumetsat website http://www.eumetsat.int/ .

        REFERENCE: [1] LRIT/HRIT Global Specification (CGMS 03, Issue 2.6, 12.08.1999) for the parameters used in the program. [2] MSG Ground Segment LRIT/HRIT Mission Specific Implementation, EUMETSAT Document, (EUM/MSG/SPE/057, Issue 6, 21. June 2006). [3] MSG Level 1.5 Image Data Format Description (EUM/MSG/ICD/105, Issue v5A, 22. August 2007).

        Please email the User Service (via http://www.eumetsat.int/Home/Basic/Contact_Us/index.htm) if you have any questions regarding this software.

        ================================ From simon.elliott@eumetsat.int As explained in notes 4 and 6 to the GRIB definition (and evidenced by drawing a sketch of the Earth and satellite in the equatorial plane and looking down from above), we have the following from GRIB:

        # The distance from the Earth's centre to the satellite is Nr (in units of Earth equatorial radius and multiplied by 10^6. # The distance from the Earth's centre to the tangent point on the equator is the Earths equatorial radius # The sine of the angle subtended by the Earths centre and the tangent point on the equator as seen from the spacecraft = Re / (( Nr * Re) / 10^6) = 10^6 / Nr # The angle subtended by the Earth equator as seen by the spacecraft is, by symmetry twice the inverse sine above, 2 * arcsine (10^6 / Nr) # As the number of pixels occupied by the Earth's equatorial radius is dx, the number of radians scanned by the spacecraft per pixel, Rx, is simply [2 * arcsine (10^6 / Nr)] / dx

        To calculate CFAC, one needs to know delta, the number radians per pixel which is Rx above.

        So CFAC = 2^16 / delta = 2^16 / Rx = 2^16 / {[2 * arcsine (10^6 / Nr)] / dx }

        **********************************************************************

        See Also:
        Constant Field Values
    • Constructor Detail

      • MSGnavigation

        public MSGnavigation()
      • MSGnavigation

        public MSGnavigation​(double lat0,
                             double lon0,
                             double major_axis,
                             double minor_axis,
                             double sat_height,
                             double scale_x,
                             double scale_y)
        Constructor
        Parameters:
        lat0 - in degrees; geosynch satelite is over this point
        lon0 - in degrees; geosynch satelite is over this point
        major_axis - in meters
        minor_axis - in meters
        sat_height - in meters
        scale_x - convert between aperature size in radians and distance in km (xrad = xkm / scale_x)
        scale_y - scale_factor = (nr - 1) * major_axis, nr = altitude of the camera from the Earths centre, measured in units of the Earth (equatorial) radius
    • Method Detail

      • toString

        public String toString()
        Description copied from class: ProjectionImpl
        Get a String representation of this projection.
        Overrides:
        toString in class ProjectionImpl
        Returns:
        the name of the projection. This is what gets displayed when you add the projection object to a UI widget (e.g. label, combobox)
      • projToLatLon

        public LatLonPoint projToLatLon​(ProjectionPoint ppt,
                                        LatLonPointImpl destPoint)
        Description copied from class: ProjectionImpl
        Convert projection coordinates to a LatLonPoint Note: a new object is not created on each call for the return value.
        Specified by:
        projToLatLon in interface Projection
        Specified by:
        projToLatLon in class ProjectionImpl
        Parameters:
        ppt - convert from these projection coordinates
        destPoint - the object to write to
        Returns:
        LatLonPoint convert to these lat/lon coordinates
      • crossSeam

        public boolean crossSeam​(ProjectionPoint pt1,
                                 ProjectionPoint pt2)
        Description copied from class: ProjectionImpl
        Does the line between these two points cross the projection "seam".
        Specified by:
        crossSeam in interface Projection
        Specified by:
        crossSeam in class ProjectionImpl
        Parameters:
        pt1 - the line goes between these two points
        pt2 - the line goes between these two points
        Returns:
        false if there is no seam
      • equals

        public boolean equals​(Object o)
        Description copied from class: ProjectionImpl
        Returns true if this represents the same Projection as proj.
        Specified by:
        equals in interface Projection
        Specified by:
        equals in class ProjectionImpl
        Parameters:
        o - projection in question
        Returns:
        true if this represents the same Projection as proj.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • latLonToProjBB

        public ProjectionRect latLonToProjBB​(LatLonRect rect)
        Create a ProjectionRect from the given LatLonRect. Handles lat/lon points that do not intersect the projection panel.
        Specified by:
        latLonToProjBB in interface Projection
        Overrides:
        latLonToProjBB in class ProjectionImpl
        Parameters:
        rect - the LatLonRect
        Returns:
        ProjectionRect, or null if no part of the LatLonRect intersects the projection plane
      • getLon0

        public double getLon0()