资源描述:
《MODIS Ocean Level 3 Data读取程序》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、一、MODISOceanLevel3BinnedData读取程序IDL语言程序1、从HDF文件中读取SDSFunctionGet_SDS,file_name,SDS_NameIf(N_Elements(file_name)eq0)thenMessage,"Mustspecifyfilename."Id=HDF_SD_Start(file_name,/READ)Index=HDF_SD_NameToIndex(Id,SDS_Name)SDS=HDF_SD_Select(Id,Index)HDF_SD_GetData,SDS,DataHDF_SD
2、_End,IdReturn,DataEnd2、从一个byte中提取1个或多个bit的资料;TheIDLfunction,Bit.pro,extractsbitsfromanarrayofbytevalues.;;i=arrayofbytevalues;j=startingbitposition;k=numberofbitstobeextracted;;KevinTurpie,SAICGSOFunctionBit,i,j,kIf(N_Elements(k)eq0)thenk=1k=Fix(k)If(N_Elements(j)eq0)thenj=
3、1j=Fix(j)Return,IShft(IShft(Long(i),32-j-k+1),-(31-k+1))End3、将二进制资料转换成经纬度坐标;Thiscodeconvertsbinnumberto(lat,lon);ItiswritteninbothCandIDL.;TheIDLroutine,binloc.pro,callsaChandler,binloc.c,whichinturn;callsthebin2llroutinefromashareablelibrary,createdfrombin_csub.c;(original
4、lyfromSeaDAS).Compilationinstructionsinthebinloc.cfile;workforSGI.binloc.proreferencesa.solibraryfilecreatedusingthose;instructions.Theusermustbecarefultocorrectlyspecifythepathand;nameofthislibraryfilefortheirsysteminbinloc.pro.;---------------------------IDLInterface:----
5、---------------------------;--------------------------------------------------------------------------;;BinLoc;;ThisIDLproceduretakesanarrayofL3binnumbers(b)andreturnsthe;correspondinglatitudeandlongitudevalues.;;ARGUMENTS:;b=correspondingarrayofbinnumbers;Lat=lat/longridco
6、ntainingsumofvalues;Lon=lat/longridcontainingnumberofvalues;;KEYWORDS:;NROWS=numberofrowsininputL3bingrid.;defaultis4320forMODIS.forSeaWiFS,setto2160.;;AUTHOR:KevinTurpie,08May2000;SAICGeneralSciencesCorporation;kevin.turpie@gsfc.nasa.gov;;;---------------------------------
7、-----------------------------------------PROBinLoc,b,Lat,Lon,NROWS=nrows;On_Error,2If(N_Elements(nrows)eq0)thennrows=4320Lnb=N_Elements(b)b=Long(b)nbins=nbnl=N_Elements(Lat)If(nleq0)thenbeginLat=FltArr(nb)nl=nbEndIfIf(nlnenb)thenMessage,'BinandLatarraymustbethesamesize.'Lat
8、=Float(Lat)nl=N_Elements(Lon)If(nleq0)thenbeginLon=FltArr(nb)nl=nbEndIfIf(nlnenb)t