|
Last change
on this file was 13646, checked in by Mathieu Morlighem, 13 years ago |
|
CHG: cosmetics, removed multiple blank lines
|
|
File size:
1.1 KB
|
| Rev | Line | |
|---|
| [7308] | 1 | function expll2xy(filename,sgn,central_meridian,standard_parallel)
|
|---|
| 2 | %EXPLL2XY: switch exp argus file from lat,long to x,y
|
|---|
| 3 | % Usage:
|
|---|
| [8367] | 4 | % expll2xy(filename,sgn,central_meridian,standard_parallel)
|
|---|
| [7308] | 5 | % - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
|
|---|
| 6 | % -1 : south latitude (default is mer=0 lat=71)
|
|---|
| 7 |
|
|---|
| 8 | %Get central_meridian and standard_parallel depending on hemisphere
|
|---|
| 9 | if nargin==4,
|
|---|
| 10 | delta = central_meridian;
|
|---|
| 11 | slat = standard_parallel;
|
|---|
| 12 | elseif nargin==2
|
|---|
| 13 | if sgn == 1,
|
|---|
| 14 | delta = 45; slat = 70;
|
|---|
| 15 | disp('Info: creating coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
|
|---|
| 16 | elseif sgn==-1,
|
|---|
| 17 | delta = 0; slat = 71;
|
|---|
| 18 | disp('Info: creating coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
|
|---|
| 19 | else
|
|---|
| 20 | error('Sign should be either +1 or -1');
|
|---|
| 21 | end
|
|---|
| 22 | else
|
|---|
| 23 | help expll2xy
|
|---|
| 24 | error('bad usage');
|
|---|
| 25 | end
|
|---|
| 26 |
|
|---|
| 27 | %read filename:
|
|---|
| [12570] | 28 | domain=expread(filename);
|
|---|
| [7308] | 29 |
|
|---|
| 30 | %change to x,y:
|
|---|
| 31 | for i=1:length(domain),
|
|---|
| 32 | [domain(i).x domain(i).y]= ll2xy(domain(i).y,domain(i).x,sgn,delta,slat);
|
|---|
| 33 | end
|
|---|
| 34 |
|
|---|
| 35 | %write back to filename:
|
|---|
| 36 | expwrite(domain,filename);
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.