NEST(NextESASARToolbox)DeveloperTrainingCourse-BuildingtheSourceCode-GeneralDesign-CreatinganOperator-CreatingaReader-CreatingaWriterCONTENTSBuildingtheNESTSourceCodeOPENSOURCETheNESTsoftwareandfullsourcecodeisdistributedfreelyundertheGNUGPLlicense.
–Opensourcemakessoftwareinherentlyindependentofspecificvendors,programmersandsuppliers.
Thesoftwarecanbefreelydistributedandsharedbylargecommunitiesincludingthesourcecodeandtherighttomodifyit.
–Thisensuresthatthereisn'tasingleentityonwhichthefutureofthesoftwaredependsonandallowsforunlimitedimprovementsandtuningofthequalityandfunctionalityofthesoftware.
–BymakingNESTopensource,futureevolutionandgrowthofthetoolboxwillbepossiblebythecommunityofusersanddevelopersthatcontributebacktotheproject.
PREREQUISITES–JavaJDK–http://java.
sun.
com/javase/downloads/–ApacheMaven–http://maven.
apache.
org/–IntegratedDevelopmentEnvironment–IntelliJhttp://www.
jetbrains.
com/idea/–Eclipsehttp://www.
eclipse.
org/–WordpadSETUPENVIRONMENTVARIABLES–Addtheenvironmentvariables–IfyouinstalledJava,maventoafolder~/binorc:\bin\thenthepathsshouldlooklikethese–Linux–In~/.
bashrc–exportJAVA_HOME=~/bin/java/jdk1.
6.
0_17–exportMAVEN_HOME=~/bin/maven–exportPATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin–Windows–InControlPanel->System->AdvancedSettings->EnvironmentVariables–NewJAVA_HOMEc:\bin\java\jdk1.
6.
0_17–NewMAVEN_HOMEc:\bin\maven–NewPATH%PATH%;%JAVA_HOME%\bin;%MAVEN_HOME%\binGETTHECODE–Unzipnest-3C-src.
zipfromtheUSBdisk–Ordownloadandunzipsourcefromastablereleasefromthewebsitehttp://earth.
esa.
int/nest–OrcheckoutthelatestnightlydevelopmentbuildfromtheCVSrepository–cvs-d:pserver:anonymous@www.
array.
ca:2401/reposconestSETUPBUILDENVIRONMENT–ApacheMavenisabuildmanagerthatletsyoucreateandautomatethebuildenvironmentfromaProjectObjectModel(POM)–TheNESTpom.
xmllistallmodulesanddependenciestoincludeinthebuild–Dependenciesaredownloadedasneededfromarepository–Mavencommands–mvncompile–mvncompileidea:idea–mvnpackageassembly:assembly–Otherusefulcommands–mvncompileeclipse:eclipse–Mvninstall–mvncleanPRODUCINGARELEASESOFTWARE–mvnpackageassembly:assembly–ThiscreatesafolderNest-3C/targetthatcontainsthesoftwareforeachplatform–CopytheC:\bin\java\jdk1.
6.
0_17\jrefolderintothefolderappropriateforyoursystem.
–E.
g.
copythejreintonest-3C/target/nest-3C-bin-win.
dirNESTGeneralDesignMODULARDEVELOPMENT–APIprovidedwithNESTallowsforeasyextensionbyuserstoadddatareaders/writersofotherformatsandtosupportdataformatsoffuturemissions.
–Plug-inmodulescanbedevelopedseparatelyandsharedbytheusercommunity–ProcessorscanbeeasilyextendedwithoutneedingtoknowaboutthecomplexitiesofthewholesoftwareGENERICPRODUCTMODEL(GPM)TheGPMisacommon,unifieddatamodeldesignedsothatalldatareadersconvertdataintothisdatamodelandallanalysisandprocessingtoolsusethisdatamodelexclusively.
PRODUCTMODEL–TiePointGrid–Sub-sampledrasterdata–Band–Dataatsceneresolution–FlagCoding–Producttypespecific–Landcoveretc.
–Geocoding–Tiepointgeocoding–Mapgeocoding–MetadataElements–Headerdata–DataNode–Rasterdataasint,float,…GRAPHPROCESSINGFRAMEWORK–ProcessingchainsarecreatedasDirectedAcyclicGraphs.
–Thesourcesofthegrapharethedataproductreaders,andthesinkscanbeeitheraproductwriteroranimagedisplayedontheDAT.
–TheGPFusesaPullModel,whereinarequestismadefromthesinkbackwardstothesourcetoprocessthegraph.
Thisrequestcouldbetocreateanewproductfileortoupdateadisplayedimage.
Oncetherequestreachesasource,theimageispulledthroughthenodestothesink.
Eachtimeanimagepassesthroughanoperator,theoperatortransformstheimage,anditispasseddowntothenextnodeuntilitreachesthesink.
THEGRAPHOPERATORinitialize():voiddispose():voidcomputeTile(band:Band,tile:Tile,pm:ProgressMonitor):voidcomputeTileStack(tiles:Map,rect:Rectangle,pm:ProgressMonitor):voidgetSourceTile(node:RasterDataNode,pm:ProgressMonitor):TilegetSourceProducts():Product[]getSourceProduct(name:String):ProductgetTargetProduct():ProductOperatorcreateOperator():OperatorcreateOperator(sources,Map,parameters:Map):OperatorOperatorSpi>getOperatorSpi(name:String):OperatorSpiaddOperatorSpi(spi:OperatorSpi):voidremoveOperatorSpi(spi:OperatorSpi):voidOperatorSpiRegistry0.
.
*initialize():voidcomputeTile(band:Band,tile:Tile,pm:ProgressMonitor):voidMosaicOpMosaicOpSpigetX():intgetY():intgetWidth():intgetHeight():intgetSampleDouble(x:int,y:int):doublesetSampleDouble(x:int,y:int,s:double)Tile>CreatingAnOperatorMAVENGPFARCHETYPE–AMavenArchetypeisatemplatetoolkitforgeneratinganewmodulepackagethatisalreadyintegratedandreadytouse.
–RunmvninstalltoinstallthearchetypesintotheMavenrepository–Usingthecreate_gpf_opscriptamavenarchetypewillcreateanewoperatorcreate_gpf_opnest-op-segmentation–Thenewoperatorwillbeaddedtothepom.
xmlandcontaineverythingneededforanoperatortowork.
–Addittoyourprojectmvncompileidea:idea–Youcanthenbegintomodifyittoyourneeds.
THEGPFOPERATOR–TheOperatorbasicallytakesasourceproductasinputandcreatesanewtargetproductwithininitialize().
–ThealgorithmimplementationforwhatyouroperatordoeswillgoinsidecomputTile()orcomputeTiles().
publicinterfaceOperator{OperatorSpigetSpi();Productinitialize(OperatorContextcontext);voidcomputeTile(TiletargetTile,ProgressMonitorpm);voidcomputeTiles(RectangletargetTileRectangle,ProgressMonitorpm);voiddispose();}INITIALIZE–Getsourcemetadata–Createtargetproduct–Addselectedbands–Updatetargetmetadatapublicvoidinitialize()throwsOperatorException{getSourceMetadata();//createtargetproducttargetProduct=newProduct(sourceProduct.
getName(),sourceProduct.
getProductType(),sourceProduct.
getSceneRasterWidth(),sourceProduct.
getSceneRasterHeight());//AddtargetbandsaddSelectedBands();//copyorcreateproductnodesOperatorUtils.
copyProductNodes(sourceProduct,targetProduct);//updatethemetadatawiththeaffectoftheprocessingupdateTargetProductMetadata();}ABSTRACTEDMETADATA–TheAbstractedMetadataisanextractofinformationandparametersfromtheactualmetadataoftheproduct.
–ThereaderconvertproductspecificmetadataintothiscommonformatforallOperatorstounderstand–TheAbstractedMetadataistheonlymetadatathatanOperatorshouldreadfromandwriteto.
GETSOURCEMETADATA–finalMetadataElementabs=AbstractMetadata.
getAbstractedMetadata(sourceProduct);–rangeSpacing=AbstractMetadata.
getAttributeDouble(abs,AbstractMetadata.
range_spacing);UPDATETARGETMETADATA–finalMetadataElementabsTgt=AbstractMetadata.
getAbstractedMetadata(targetProduct);–AbstractMetadata.
setAttribute(absTgt,AbstractMetadata.
multilook_flag,1);ADDSELECTEDBANDS–BandtargetBand=newBand(targetBandName,sourceBand.
getDataType(),sourceBand.
getRasterWidth(),sourceBand.
getRasterHeight());–ProductUtils.
copyRasterDataNodeProperties(sourceBand,targetBand);–targetProduct.
addBand(targetBand);TILES–ThememorymanagementofNESTallowsverylargedataproducts,thatcannotbeallstoredinavailablememory,tobehandledbytheprocessingtoolsusingatiledapproach.
–Thedatasetisdividedintoworkableareascalledtilesconsistingofasubsetofthedatareadfromdiskinonepiece.
–Dependingonthetool,dataisingestedforatileorasetoftiles,andprocessingisappliedonlytothecurrentsetoftiles.
Thedataisthenwrittentoafileandreleasedfrommemory.
Theprocessisthenrepeatedonanewsetoftileddatafromthelargedataproduct.
–EachOperatorcanhaveComputeTilemethodoraComputeTileStackmethod.
–ThesizeofthetargettilemaybedependentontherequestsofotherOperatorsinthegraph.
–Thesizeofthesourcetilerequestedbyyouroperatorcouldbeanysize(memorypermitting)COMPUTETILE–Gettingthesourcedata–Applyyouralgorithm–SavingthetargetdatapublicvoidcomputeTile(BandtargetBand,TiletargetTile,ProgressMonitorpm)throwsOperatorException{finalRectangletargetTileRectangle=targetTile.
getRectangle();finalBandsrcBand=targetBandToSourceBandMap.
get(targetBand);finalTilesourceRaster=getSourceTile(srcBand,targetTileRectangle,pm);finalintx0=targetTileRectangle.
x;finalinty0=targetTileRectangle.
y;finalintw=targetTileRectangle.
width;finalinth=targetTileRectangle.
height;for(inty=y0;yaddanActiontocreateamenuitemintheDAT.
StatetheclassoftheActiontobecalledandthetexttoshowinthemenuitem.
SegmentationOporg.
esa.
nest.
dat.
SegmentationOpActionSimpleSegmentationThiswillbeshowninthetooltipsartoolsSegmentationOp–IfyoucreatedyourOperatorwiththeGPFArchetype,thisshouldallbedoneforyoualready.
ACTIONS–TheActionclassdefineswhatwillhappenwhenthemenuitemisclicked.
–Inmostcases,itshouldcalltheSingleTargetProductDialogtoruntheOperator–TheActionclassshouldextendAbstractVisatActionandoverridethehandlerforactionPerformedpublicclassSRGROpActionextendsAbstractVisatAction{privateDefaultSingleTargetProductDialogdialog;@OverridepublicvoidactionPerformed(CommandEventevent){if(dialog==null){dialog=newDefaultSingleTargetProductDialog("SRGR",getAppContext(),"SlantRangetoGroundRange",getHelpId());dialog.
setTargetProductNameSuffix("_GR");}dialog.
show();}PUBLISHINGANOPERATOR–OperatorimplementationsarepublishedviatheJavaserviceproviderinterface(SPI).
AJARpublishesitsoperatorsintheresourcefileMETA-INF/services/org.
esa.
beam.
framework.
gpf.
OperatorSpi.
–InthisfileaddyouroperatorSPIeg:org.
esa.
nest.
gpf.
MultilookOp$SpiInyourOperatorpackageaddaclasstoextendtheOperatorSpiinterface.
Thisclassmayalsoserveasafactoryfornewoperatorinstances.
publicstaticclassSpiextendsOperatorSpi{publicSpi(){super(MultilookOp.
class);}}–IfyoucreatedyourOperatorwiththeGPFArchetype,thisshouldallbedoneforyoualready.
CreatingAReaderREADERS–ReadersallowyoutointerpretafileformatandabstractthedataintotheGenericProductModel–Readershavetwomainclasses–ReaderPluginClass–ReaderImplementationClassREADERPLUGIN–publicinterfaceProductReaderPlugInextendsProductIOPlugIn{/***Getsthequalificationoftheproductreadertodecodeagiveninputobject.
**@paraminputtheinputobject*@returnthedecodequalification*/DecodeQualificationgetDecodeQualification(Objectinput);/***Returnsanarraycontainingtheclassesthatrepresentvalidinputtypesforthisreader.
**IntancesoftheclassesreturnedinthisarrayarevalidobjectsforthesetInputmethodofthe*ProductReaderinterface(themethodwillnotthrowanInvalidArgumentExceptioninthis*case).
**@returnanarraycontainingvalidinputtypes,nevernull*/Class[]getInputTypes();/***Createsaninstanceoftheactualproductreaderclass.
Thismethodshouldneverreturnnull.
**@returnanewreaderinstance,nevernull*/ProductReadercreateReaderInstance();}READER–TheReaderextendsAbstractProductReader–ProductreadProductNodesImpl()–CreateanewProductobject–voidreadBandRasterDataImpl(intsourceOffsetX,intsourceOffsetY,intsourceWidth,intsourceHeight,intsourceStepX,intsourceStepY,BanddestBand,intdestOffsetX,intdestOffsetY,intdestWidth,intdestHeight,ProductDatadestBuffer,ProgressMonitorpm)–FillthedestinationbufferwithbanddatafortherequestedrectangularareaADDABSTRACTEDMETADATA–ForNESTtousethemetadatainagenericway,itmustbeintheAbstractedMetadatasothateachOperatorhasoneinterfacetogetatthedata.
–finalMetadataElementabsRoot=AbstractMetadata.
addAbstractedMetadataHeader(root);–AbstractMetadata.
setAttribute(absRoot,AbstractMetadata.
PRODUCT,prodName);–AbstractMetadata.
setAttribute(absRoot,AbstractMetadata.
range_spacing,mapProjRec.
getAttributeDouble("Nominalinter-pixeldistanceinoutputscene"));PUBLISHINGYOURREADER–ReaderimplementationsarepublishedviatheJavaserviceproviderinterface(SPI).
–AJARpublishesitsreadersintheresourcefileMETA-INF/services/org.
esa.
beam.
framework.
dataio.
ProductReaderPlugIn.
–InthisfileaddyourreaderSPIeg:org.
esa.
nest.
dataio.
radarsat2.
Radarsat2ProductReaderPlugInADDINGAMENUITEM–Inthemodules.
xmlfilefoundintheresourcesfolderofthepackage,addanActiontocreateamenuitemintheDAT.
StatetheclassoftheActiontobecalledandthetexttoshowinthemenuitem.
importRadarsat2Productorg.
esa.
beam.
visat.
actions.
ProductImportActionRadarsat2ImportaRadarsat2dataproductorproductsubset.
ImportaRadarsat2dataproductorproductsubset.
icons/Import24.
gifimportRadarsatProductimportRadarsat2ProductCreatingAWriterWRITERS–WritersallowyoutowritetheProductdatatosomeotherfileformat–Writershavetwomainclasses–WriterPluginClass–WriterImplementationClassWRITERPLUGIN–publicinterfaceProductWriterPlugInextendsProductIOPlugIn{/***Returnsanarraycontainingtheclassesthatrepresentvalidoutputtypesforthiswriter.
**InstancesoftheclassesreturnedinthisarrayarevalidobjectsforthesetOutputmethodofthe*ProductWriterinterface(themethodwillnotthrowanInvalidArgumentExceptioninthis*case).
**@returnanarraycontainingvalidoutputtypes,nevernull**@seeProductWriter#writeProductNodes*/Class[]getOutputTypes();/***Createsaninstanceoftheactualproductwriterclass.
Thismethodshouldneverreturnnull.
**@returnanewwriterinstance,nevernull*/ProductWritercreateWriterInstance();}WRITER–TheWriterextendsAbstractProductWriter–ProductwriteProductNodesImpl()–Writethefileheader–voidwriteBandRasterData(BandsourceBand,intsourceOffsetX,intsourceOffsetY,intsourceWidth,intsourceHeight,ProductDatasourceBuffer,ProgressMonitorpm)–Writerasterdatafromthegivenin-memorysourcebufferintothefilesbandrepresentationusingthegivensourcebandandregionPUBLISINGYOURWRITER–WriterimplementationsarepublishedviatheJavaserviceproviderinterface(SPI).
–AJARpublishesitswritersintheresourcefileMETA-INF/services/org.
esa.
beam.
framework.
dataio.
ProductWriterPlugIn.
–InthisfileaddyourwriterSPIeg:org.
esa.
beam.
dataio.
geotiff.
GeoTiffProductWriterPlugInADDINGAMENUITEM–Inthemodules.
xmlfilefoundintheresourcesfolderofthepackage,addanActiontocreateamenuitemintheDAT.
StatetheclassoftheActiontobecalledandthetexttoshowinthemenuitem.
exportGeoTIFFProductorg.
esa.
beam.
dataio.
geotiff.
GeoTiffExportActionGeoTIFFtrueOExportGeoTIFFProduct.
.
.
ExportaGeoTIFFdataproductorsubset.
ExportaGeoTIFFdataproductorproductsubset.
exportGeoTIFFProductUsingIntegratedDevelopmentEnvironments(IDE)OPENPROJECT–IDEA–mvnidea:idea–OpenNest-3C/nest.
ipr–RightclickonanyprojectandselectmodulesettingsandProject–IfthereisnoJDKspecified,pressNewandbrowsefor–C:\bin\java\jdk1.
6.
0_17–Eclipse–mvneclipse:eclipse–clickonMainMenu/File/Import–SelectGeneral/ExistingProjectintoWorkspace–Browseforsourcefolder–OpenWindow/Preferences.
.
.
,thenselectJava/BuildPath/ClasspathVariables–SelectNew.
.
.
andaddvariableM2_REPO–SelectFolder.
.
.
andchoosethelocationofyourMavenlocalrepository,e.
g.
~/.
m2/repositoryorc:\users\username\.
m2\repositorySETUPRUNPARAMETERSAddrun-timeparametersforIDEAandEclipse–AddanewJavaApplicationRunConfiguration–Name:DAT–Mainclass:com.
bc.
ceres.
launcher.
Launcher–VMparameters:-Xmx1024M-Dceres.
context=nest–Programparameters:none–Workingdirectory:$MY_PROJECTS/nest/beam–Useclasspathofmodulenest-bootstrap–Eclipse:clickonuserentry,addprojectandselectnest-bootstrap–Eclipse:addexternaljars,browsefornest-3C\target\nest-3C-bin-dir\libandselectalljarfilesThankYou
官方网站:点击访问亚州云活动官网活动方案:地区:美国CERA(联通)CPU:1核(可加)内存:1G(可加)硬盘:40G系统盘+20G数据盘架构:KVM流量:无限制带宽:100Mbps(可加)IPv4:1个价格:¥128/年(年付为4折)购买:直达订购链接测试IP:45.145.7.3Tips:不满意三天无理由退回充值账户!地区:枣庄电信高防防御:100GCPU:8核(可加)内存:4G(可加)硬盘:...
[六一云迎国庆]转盘活动实物礼品美国G口/香港CTG/美国T级超防云/物理机/CDN大促销六一云 成立于2018年,归属于西安六一网络科技有限公司,是一家国内正规持有IDC ISP CDN IRCS电信经营许可证书的老牌商家。大陆持证公司受大陆各部门监管不好用支持退款退现,再也不怕被割韭菜了!主要业务有:国内高防云,美国高防云,美国cera大带宽,香港CTG,香港沙田CN2,海外站群服务,物理机,...
博鳌云是一家以海外互联网基础业务为主的高新技术企业,运营全球高品质数据中心业务。自2008年开始为用户提供服务,距今11年,在国人商家中来说非常老牌。致力于为中国用户提供域名注册(国外接口)、免费虚拟主机、香港虚拟主机、VPS云主机和香港、台湾、马来西亚等地服务器租用服务,各类网络应用解決方案等领域的专业网络数据服务。商家支持支付宝、微信、银行转账等付款方式。目前香港有一款特价独立服务器正在促销,...
parameters add为你推荐
推广方法最有效的推广方法是什么?网络明星网络明星是什么,出现这一现象的原因是什么赵雨润情人节“我们约会吧”电影DVD_我们约会吧高清DVD下载_qvod快播??支付宝查询余额怎样查支付宝余额怎么样免费装扮qq空间要怎么免费装扮QQ空间!怎么样免费装扮qq空间如何免费装扮qq空间1433端口如何打开1433端口照片转手绘怎么把图片P成手绘iphone越狱后怎么恢复苹果手机越狱之后能恢复原来吗?xp系统停止服务XP系统停止服务后怎么办?
vps服务器 域名备案信息查询 新通用顶级域名 cpanel主机 typecho 512m内存 股票老左 免费全能主机 t云 怎么建立邮箱 lick 华为云建站 网页加速 国外网页代理 免费网络空间 稳定空间 黑科云 七十九刀 上海联通 湖南铁通 更多