Class MSGnavigation
- java.lang.Object
-
- ucar.unidata.geoloc.ProjectionImpl
-
- ucar.unidata.geoloc.projection.sat.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 Summary
Fields Modifier and Type Field Description static 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.static String
SCALE_X
static String
SCALE_Y
-
Fields inherited from class ucar.unidata.geoloc.ProjectionImpl
atts, defaultMapArea, defaultUnits, EARTH_RADIUS, INDEX_LAT, INDEX_LON, INDEX_X, INDEX_Y, isLatLon, name, PI, PI_OVER_2, PI_OVER_4, TOLERANCE
-
-
Constructor Summary
Constructors Constructor Description MSGnavigation()
MSGnavigation(double lat0, double lon0, double major_axis, double minor_axis, double sat_height, double scale_x, double scale_y)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProjectionImpl
constructCopy()
copy constructor - avoid clone !!boolean
crossSeam(ProjectionPoint pt1, ProjectionPoint pt2)
Does the line between these two points cross the projection "seam".boolean
equals(Object o)
Returns true if this represents the same Projection as proj.double
getLon0()
int
hashCode()
ProjectionPoint
latLonToProj(LatLonPoint latlon, ProjectionPointImpl destPoint)
Convert a LatLonPoint to projection coordinatesProjectionRect
latLonToProjBB(LatLonRect rect)
Create a ProjectionRect from the given LatLonRect.String
paramsToString()
Get a string representation of the projection parametersLatLonPoint
projToLatLon(ProjectionPoint ppt, LatLonPointImpl destPoint)
Convert projection coordinates to a LatLonPoint Note: a new object is not created on each call for the return value.String
toString()
Get a String representation of this projection.-
Methods inherited from class ucar.unidata.geoloc.ProjectionImpl
addParameter, addParameter, addParameter, findProjectionParameter, getClassName, getDefaultMapArea, getDefaultMapAreaLL, getDefaultUnits, getHeader, getName, getProjectionParameters, getProjectionTypeLabel, isLatLon, latLonToProj, latLonToProj, latLonToProj, latLonToProj, latLonToProj, latLonToProj, latLonToProj, latLonToProj, latLonToProj, projToLatLon, projToLatLon, projToLatLon, projToLatLon, projToLatLon, projToLatLonBB, projToLatLonBBold, setDefaultMapArea, setName
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ucar.unidata.geoloc.Projection
latLonToProj, projToLatLon
-
-
-
-
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
-
SCALE_X
public static final String SCALE_X
- See Also:
- Constant Field Values
-
SCALE_Y
public static final String SCALE_Y
- 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 pointlon0
- in degrees; geosynch satelite is over this pointmajor_axis
- in metersminor_axis
- in meterssat_height
- in metersscale_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 classProjectionImpl
- 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)
-
constructCopy
public ProjectionImpl constructCopy()
Description copied from class:ProjectionImpl
copy constructor - avoid clone !!- Specified by:
constructCopy
in classProjectionImpl
- Returns:
- a copy of this Projection. TODO return Projection in ver6
-
paramsToString
public String paramsToString()
Description copied from class:ProjectionImpl
Get a string representation of the projection parameters- Specified by:
paramsToString
in interfaceProjection
- Specified by:
paramsToString
in classProjectionImpl
- Returns:
- string representation of the projection parameters
-
latLonToProj
public ProjectionPoint latLonToProj(LatLonPoint latlon, ProjectionPointImpl destPoint)
Description copied from class:ProjectionImpl
Convert a LatLonPoint to projection coordinates- Specified by:
latLonToProj
in interfaceProjection
- Specified by:
latLonToProj
in classProjectionImpl
- Parameters:
latlon
- convert from these lat, lon coordinatesdestPoint
- the object to write to- Returns:
- the given destPoint
-
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 interfaceProjection
- Specified by:
projToLatLon
in classProjectionImpl
- Parameters:
ppt
- convert from these projection coordinatesdestPoint
- 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 interfaceProjection
- Specified by:
crossSeam
in classProjectionImpl
- Parameters:
pt1
- the line goes between these two pointspt2
- 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 interfaceProjection
- Specified by:
equals
in classProjectionImpl
- Parameters:
o
- projection in question- Returns:
- true if this represents the same Projection as proj.
-
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 interfaceProjection
- Overrides:
latLonToProjBB
in classProjectionImpl
- Parameters:
rect
- the LatLonRect- Returns:
- ProjectionRect, or null if no part of the LatLonRect intersects the projection plane
-
getLon0
public double getLon0()
-
-