NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
If you were required to adjust the subscripts for getting the starting line and element (dir[5] and dir[6] in your original code, but you changed to dir[6] and dir[7]), then I would suggest that you would have to change the subscript values in the "setRes()" call as well. These indicies are elements of the AREA File "directory block" (described here: <http://www.ssec.wisc.edu/mcidas/doc/prog_man/2006/formats-1.html#13797> The original code may have been based on an AREA file that was created without the initial "word" (position within the dataset) and hence, all of the index values would be off by 1... Hope that helps. tom 2011/3/25 Luis Martín Pomares <luis.martin@xxxxxxxxxxx>: > Dear all, > > I am trying to georeference GOES AREA files using visad. I am doing this in > MATLAB. However, I obtain strange value. I want to give the latitude and > longitude and obtain a row and column value to access the matrix of > radiances from [1,1]. > > In the example of visad it says I have to do the following: > > af = new AreaFile("/home/user/mcidas/data/AREA0001"); > dir=af.getDir(); > nav=af.getNav(); > GVARnav ng = new GVARnav(nav); // XXXXnav is the specific implementation > ng.setImageStart(dir[5], dir[6]); > ng.setRes(dir[11], dir[12]); > ng.setStart(1,1); > > However w5 is a date, so I change the w5 by w6 and w7: > > W6 > image line coordinate of area line 0, element 0 > W7 > image element coordinate of area line 0, > element 0 > > I have tried to see the correspondence the point that I get for the sub > satellite but it is not ok. What I am doing is this: > > clc;clear all;close all; > import edu.wisc.ssec.mcidas.* > file='D:\Irsolav\GOES\GOES_DATA\goes08.2000.303.144514.BAND_01'; > data=AreaFile(file); > > dir=data.getDir(); > nav=data.getNav(); > > ng=GVARnav(nav); %XXXXnav is the specific implementation > ng.setImageStart(dir(6),dir(7)); > ng.setRes(dir(11), dir(12)); % > ng.setStart(1,1); > ng.setMag(1,1); > %...................... > disp('LINELE'); %subsatellite point for GOES 8 > latlon=[0;-75] > linele_area=ng.toLinEle(latlon) > > disp('LATLON TRANSFORMATION'); > % linele=[1;1] > latlon=ng.toLatLon(linele_area) > %ng.toLatLon(double[][] linele); %public abstract double[][] > toLatLon(double[][] linele) > > disp('IMAGE COORDINATE TRANSFORMATION'); > linele_image=ng.areaCoordToImageCoord(linele_area) > > disp('Transformation from IMAGE coordinates to AREA coordinates'); > linele_area=ng.imageCoordToAreaCoord(linele_image) > > % disp('Transformation from IMAGE coordinates to AREA coordinates - version > 2'); > % linele_area=ng.imageCoordToAreaCoord(linele_image) > > latlon=ng.toLatLon(linele_area) > %By convention, latitudes are positive North (negative South), and > longitudes are positive East (negative West). > > _______________________________________________ > visad mailing list > visad@xxxxxxxxxxxxxxxx > For list information, to unsubscribe, visit: > http://www.unidata.ucar.edu/mailing_lists/ > -- Tom Whittaker University of Wisconsin-Madison Space Science & Engineering Center (SSEC) Cooperative Institute for Meteorological Satellite Studies (CIMSS) 1225 W. Dayton Street Madison, WI 53706 USA ph: +1 608 262 2759
visad
archives: