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
licloud官方消息:当前对香港机房的接近100台物理机(香港服务器)进行打折处理,30Mbps带宽,低至不到40美元/月,速度快,性价比高,跑绝大多数项目都是绰绰有余了。该款香港服务器自带启动、关闭、一键重装功能,正常工作日内30~60分钟交货(不包括非工作日)。 官方网站:https://licloud.io 特价香港物理服务器 CPU:e3-1230v2(4核心、8线程、3.3GH...
6元虚拟主机是否值得购买?近期各商家都纷纷推出了优质便宜的虚拟主机产品,其中不少6元的虚拟主机,这种主机是否值得购买,下面我们一起来看看。1、百度云6元体验三个月(活动时间有限抓紧体验)体验地址:https://cloud.baidu.com/campaign/experience/index.html?from=bchPromotion20182、Ucloud 10元云主机体验地址:https:...
云雀云(larkyun)当前主要运作国内线路的机器,最大提供1Gbps服务器,有云服务器(VDS)、也有独立服务器,对接国内、国外的效果都是相当靠谱的。此外,还有台湾hinet线路的动态云服务器和静态云服务器。当前,larkyun对广州移动二期正在搞优惠促销!官方网站:https://larkyun.top付款方式:支付宝、微信、USDT广移二期开售8折折扣码:56NZVE0YZN (试用于常州联...
parameters add为你推荐
ptrc语言for语句中(*ptr)和*ptr有什么区别,为什么要加括号,不加括号会yy频道中心yy频道怎么进频道中心,求图~!手游运营手册和平精英打到王者有什么要求照片转手绘照片转手绘用什么APP腾讯文章怎样才能在手机腾讯网上发表文章?硬盘人硬盘是指什么人开机滚动条电脑开机有滚动条的画面lockdownd[求教]在淘宝买了张激活卡,请问怎么取消激活安全漏洞web安全漏洞有哪些虚拟机软件下载那里可以下载虚拟系统,又该怎么安装呢??
国外vps 广东vps 域名备案网站 域名商 site5 asp.net主机 2014年感恩节 贵州电信宽带测速 12u机柜尺寸 patcha php免费空间 云全民 dd444 web服务器安全 如何安装服务器系统 web服务器搭建 web应用服务器 聚惠网 亿库 windowsserver2008r2 更多