1

I'm using this code: https://github.com/mcidasv/mcidasv/blob/master/ucar/unidata/geoloc/projection/sat/GEOSTransform.java to retrieve longitude and latitude in Earth system from column, line coordinates in Satellite system. This is my code:

public class Main {

private final static double COFF=1856;
private final static double LOFF=1856;
private final static double CFAC = -781648343;
private final static double LFAC = -781648343;

public static void main(String args[]){

    GEOSTransform geo = new GEOSTransform(0, GEOSTransform.GEOS, GEOSTransform.WGS84);

    /*
    double[] lonlat = geo.FGFtoEarth(1, 34, CFAC, COFF, LFAC, LOFF);
    System.out.println("LONLAT "+lonlat[0]+", "+lonlat[1])
    */
    for(int x=1; x<1000;x+=1)
        for(int y=1;y<1000;y+=1){
            double[] lonlat = geo.FGFtoEarth(x, y, CFAC, COFF, LFAC, LOFF);
            System.out.println("LONLAT "+lonlat[0]+", "+lonlat[1]+": xy "+x+", "+y);
        }
    }
}

and I get NaN values from FGFtoEarth. Why? For that method, the doc says "Transform fractional FGF coordinates to (longitude, latitude)." What are fraction FGF coordinates? I think there is something wrong with the passed in coordinates. Note that const members I think are correct, but I'm not sure if CFAC and LFAC are negative like above, or positive. Anyway in both case the result is the same, NaN values.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.