def getRasterTypesInfo(self): #sys_productname 产品名称 Text True 255 self.sensorName_auxField = arcpy.Field() self.sensorName_auxField.name = 'SensorName' self.sensorName_auxField.aliasName = 'Sensor Name' self.sensorName_auxField.type = 'String' self.sensorName_auxField.length = 50 self.acquisitionDate_auxField = arcpy.Field() self.acquisitionDate_auxField.name = 'AcquisitionDate' self.acquisitionDate_auxField.aliasName = 'Acquisition Date' self.acquisitionDate_auxField.type = 'date' self.quicklookPath_auxField = arcpy.Field() self.quicklookPath_auxField.name = 'QuickLookPath' self.quicklookPath_auxField.aliasName = 'Quick Look Path' self.quicklookPath_auxField.type = 'String' self.quicklookPath_auxField.length = 2048 #self.quicklookFlag_auxField = arcpy.Field() #self.quicklookFlag_auxField.name = 'QuickLookFlag' #self.quicklookFlag_auxField.aliasName = 'Quick Look Flag' #self.quicklookFlag_auxField.type = 'double' #self.quicklookFlag_auxField.precision = 8 #self.quicklook_auxField = arcpy.Field() #self.quicklook_auxField.name = 'QuickLook' #self.quicklook_auxField.aliasName = 'Quick Look' #self.quicklook_auxField.type = 'Blob' return [{ 'rasterTypeName': 'GeoScene-Sentinel1', 'builderName': 'GeoSceneSentinelBuilder', 'description': ("Supports reading of GeoScene Sentinel1 data"), 'enableClipToFootprint': True, 'isRasterProduct': False, 'dataSourceType': (DataSourceType.Folder), # DataSourceType.File | 'dataSourceFilter': 'manifest.safe', 'crawlerName': 'GeoSceneSentinelCrawler', 'fields': [ self.sensorName_auxField, self.acquisitionDate_auxField, self.quicklookPath_auxField ] # , self.quicklookFlag_auxField # ,self.quicklook_auxField }]
def getIdOutField(inFeature, inField): """ Processes the InputField. If field is an OID type, alters the output field type and name """ inField = fields.getFieldByName(inFeature, inField) if inField.type == "OID": newField = arcpy.Field() newField.type = "Integer" newField.name = inField.name + "_ID" newField.precision = inField.precision newField.scale = inField.scale else: newField = inField return (newField)
def getRasterTypesInfo(self): self.acquisitionDate_auxField = arcpy.Field() self.acquisitionDate_auxField.name = 'AcquisitionDate' self.acquisitionDate_auxField.aliasName = 'Acquisition Date' self.acquisitionDate_auxField.type = 'Date' self.acquisitionDate_auxField.length = 50 self.cloudCover_auxField = arcpy.Field() self.cloudCover_auxField.name = 'CloudCover' self.cloudCover_auxField.aliasName = 'Cloud Cover' self.cloudCover_auxField.type = 'Double' self.cloudCover_auxField.precision = 5 self.sunAzimuth_auxField = arcpy.Field() self.sunAzimuth_auxField.name = 'SunAzimuth' self.sunAzimuth_auxField.aliasName = 'Sun Azimuth' self.sunAzimuth_auxField.type = 'Double' self.sunAzimuth_auxField.precision = 5 self.sunElevation_auxField = arcpy.Field() self.sunElevation_auxField.name = 'SunElevation' self.sunElevation_auxField.aliasName = 'Sun Elevation' self.sunElevation_auxField.type = 'Double' self.sunElevation_auxField.precision = 5 self.sensorAzimuth_auxField = arcpy.Field() self.sensorAzimuth_auxField.name = 'SensorAzimuth' self.sensorAzimuth_auxField.aliasName = 'Sensor Azimuth' self.sensorAzimuth_auxField.type = 'Double' self.sensorAzimuth_auxField.precision = 5 self.sensorElevation_auxField = arcpy.Field() self.sensorElevation_auxField.name = 'SensorElevation' self.sensorElevation_auxField.aliasName = 'Sensor Elevation' self.sensorElevation_auxField.type = 'Double' self.sensorElevation_auxField.precision = 5 self.sensorName_auxField = arcpy.Field() self.sensorName_auxField.name = 'SensorName' self.sensorName_auxField.aliasName = 'Sensor Name' self.sensorName_auxField.type = 'String' self.sensorName_auxField.length = 50 return [{ 'rasterTypeName': 'SuperView-1', 'builderName': 'SuperView1Builder', 'description': ("Supports reading of SuperView-1 " "Level 1B/2A product metadata files"), 'supportsOrthorectification': True, 'enableClipToFootprint': True, 'isRasterProduct': True, 'dataSourceType': (DataSourceType.File | DataSourceType.Folder), 'dataSourceFilter': 'SV*.xml;SW*.dim', 'crawlerName': 'SuperView1Crawler', 'supportedUriFilters': [{ 'name': 'LEVEL1B', 'allowedProducts': ['L1B'], 'supportsOrthorectification': True, 'supportedTemplates': ['Panchromatic', 'Pansharpen', 'Multispectral', 'All Bands'] }, { 'name': 'LEVEL2A', 'allowedProducts': ['L2A'], 'supportsOrthorectification': True, 'supportedTemplates': ['Panchromatic', 'Pansharpen', 'Multispectral', 'All Bands'] }, { 'name': 'LEVEL3A', 'allowedProducts': ['L3A'], 'supportsOrthorectification': False, 'supportedTemplates': ['Panchromatic', 'Pansharpen', 'Multispectral', 'All Bands'] }], 'productDefinitionName': 'SuperView1', 'processingTemplates': [{ 'name': 'Multispectral', 'enabled': True, 'outputDatasetTag': 'MS', 'primaryInputDatasetTag': 'MS', 'isProductTemplate': True, 'functionTemplate': 'SV1_stretch_ms.rft.xml' }, { 'name': 'Panchromatic', 'enabled': False, 'outputDatasetTag': 'Pan', 'primaryInputDatasetTag': 'Pan', 'isProductTemplate': True, 'functionTemplate': 'SV1_stretch_pan.rft.xml' }, { 'name': 'Pansharpen', 'enabled': False, 'outputDatasetTag': 'Pansharpened', 'primaryInputDatasetTag': 'MS', 'isProductTemplate': True, 'functionTemplate': 'SV1_stretch_psh.rft.xml' }, { 'name': 'All Bands', 'enabled': False, 'isProductTemplate': False, 'functionTemplate': 'SV1_stretch_allbands.rft.xml' }], 'bandProperties': [{ 'bandName': 'Blue', 'bandIndex': 0, 'wavelengthMin': 450.0, 'wavelengthMax': 520.0, 'datasetTag': 'MS' }, { 'bandName': 'Green', 'bandIndex': 1, 'wavelengthMin': 520.0, 'wavelengthMax': 590.0, 'datasetTag': 'MS' }, { 'bandName': 'Red', 'bandIndex': 2, 'wavelengthMin': 630.0, 'wavelengthMax': 690.0, 'datasetTag': 'MS' }, { 'bandName': 'NearInfrared', 'bandIndex': 3, 'wavelengthMin': 770.0, 'wavelengthMax': 890.0, 'datasetTag': 'MS' }, { 'bandName': 'Panchromatic', 'bandIndex': 0, 'wavelengthMin': 450.0, 'wavelengthMax': 890.0, 'datasetTag': 'Pan' }], 'fields': [ self.acquisitionDate_auxField, self.cloudCover_auxField, self.sunAzimuth_auxField, self.sunElevation_auxField, self.sensorAzimuth_auxField, self.sensorElevation_auxField, self.sensorName_auxField ] }]
#Highlight specific values in a pandas dataframe using the style attribute and apply method.] highVal = lambda data,value:['background-color:red;font-weight:bold' if row==value else '' for row in data] #Usage: styledDF = df.style.apply(highVal,value='VALUE_TO_HIGHLIGHT',subset=['col1','col2','col3']) #Converts and IntervalTree object to a Pandas DataFrame - keeps the data *Assumes no rows in df have same begin and end values it_to_df = lambda it: pd.DataFrame([[*i] for i in sorted(it)],columns=["BEGIN","END","DATA"]) #Converts a DataFrame to an IntervalTree object - df = DataFrame, b = Begin column name, e = end column name, d = data column name df_to_it = lambda df,b,e,d: IntervalTree([Interval(x[b],x[e],x[d]) for i,x in df.iterrows()]) #Create a grouped id column in pandas - ids with go from 0 to N-1 (N = number of items in each group) for each of the groups. df["ID"] = df.groupby("GROUPS").apply(lambda x: list(range(0,len(x)))).explode().values # -> Reviewing this - unexpected results recently. #Create a dictionary of all the fields in an feature class and the associated attributes fs = {f.name:{a:getattr(f,a) for a in dir(arcpy.Field()) if not a.startswith("_")} for f in arcpy.ListFields(fc)} #Example of the out from function above: """ "{'REV':{'aliasName': 'REV', 'baseName': 'REV', 'defaultValue': None, 'domain': '', 'editable': True, 'isNullable': True, 'length': 254, 'name': 'REV', 'precision': 0, 'required': False, 'scale': 0, 'type': 'String'}} """
def getRasterTypesInfo(self): self.acquisitionDate_auxField = arcpy.Field() self.acquisitionDate_auxField.name = 'AcquisitionDate' self.acquisitionDate_auxField.aliasName = 'Acquisition Date' self.acquisitionDate_auxField.type = 'Date' self.acquisitionDate_auxField.length = 50 self.sensorName_auxField = arcpy.Field() self.sensorName_auxField.name = 'SensorName' self.sensorName_auxField.aliasName = 'Sensor Name' self.sensorName_auxField.type = 'String' self.sensorName_auxField.length = 50 self.productName_auxField = arcpy.Field() self.productName_auxField.name = 'ProductName' self.productName_auxField.aliasName = 'Product Name' self.productName_auxField.type = 'String' self.productName_auxField.length = 100 self.cloudCoverage_auxField = arcpy.Field() self.cloudCoverage_auxField.name = 'CloudCoverage' self.cloudCoverage_auxField.aliasName = 'Cloud Coverage' self.cloudCoverage_auxField.type = 'Double' self.cloudCoverage_auxField.precision = 5 self.vegetationPercentage_auxField = arcpy.Field() self.vegetationPercentage_auxField.name = 'VegetationPercentage' self.vegetationPercentage_auxField.aliasName = 'Vegetation Percentage' self.vegetationPercentage_auxField.type = 'Double' self.vegetationPercentage_auxField.precision = 5 rasterTypes = [ { 'rasterTypeName': 'Sentinel-2-L2A-10mTile', 'builderName': 'Sentinel210mTileBuilder', 'dataSourceType': (DataSourceType.File), 'dataSourceFilter': 'metadata.xml', 'description': ("Supports reading of Sentinel-2 Level 2A Tiles with 10m resolution." "Level 2A tile products metadata files"), 'supportsOrthorectification': False, 'enableClipToFootprint': True, 'isRasterProduct': True, # #'crawlerName': 'Sentinel2Tile10mCrawler', 'productDefinitionName': 'Sentinel-2_L2A_Tile', 'supportedUriFilters': [ { 'name': 'Tile', 'allowedProducts': [ 'Sentinel-2_L2A_Tile' ], 'supportsOrthorectification': False, 'supportedTemplates': [ 'Composite10mBands' ] } ], 'processingTemplates': [ { 'name': 'Composite10mBands', 'enabled': True, 'outputDatasetTag': '10m-4Band', 'primaryInputDatasetTag': '10m', 'isProductTemplate': True, 'functionTemplate': Rxm['10m']['rasterFunctionTemplate'] } ], 'bandProperties': [bandProperties[k] for k in bandProperties if k in Rxm['10m']['bandKeys']], 'fields': [self.sensorName_auxField, self.productName_auxField, self.acquisitionDate_auxField, self.cloudCoverage_auxField, self.vegetationPercentage_auxField] }, { 'rasterTypeName': 'Sentinel-2-L2A-20mTile', 'builderName': 'Sentinel220mTileBuilder', 'dataSourceType': (DataSourceType.File), 'dataSourceFilter': 'metadata.xml', 'description': ("Supports reading of Sentinel-2 Level 2A Tiles with 20m resolution." "Level 2A tile products metadata files"), 'supportsOrthorectification': False, 'enableClipToFootprint': True, 'isRasterProduct': True, # #'crawlerName': 'Sentinel2Tile10mCrawler', 'productDefinitionName': 'Sentinel-2_L2A_Tile', 'supportedUriFilters': [ { 'name': 'Tile', 'allowedProducts': [ 'Sentinel-2_L2A_Tile' ], 'supportsOrthorectification': False, 'supportedTemplates': [ 'Composite20mBands' ] } ], 'processingTemplates': [ { 'name': 'Composite20mBands', 'enabled': True, 'outputDatasetTag': '20m-9Band', 'primaryInputDatasetTag': '20m', 'isProductTemplate': True, 'functionTemplate': Rxm['20m']['rasterFunctionTemplate'] } ], 'bandProperties': [bandProperties[k] for k in bandProperties if k in Rxm['20m']['bandKeys']], 'fields': [self.sensorName_auxField, self.productName_auxField, self.acquisitionDate_auxField, self.cloudCoverage_auxField, self.vegetationPercentage_auxField] }, { 'rasterTypeName': 'Sentinel-2-L2A-20mCloudTile', 'builderName': 'Sentinel220mCloudTileBuilder', 'dataSourceType': (DataSourceType.File), 'dataSourceFilter': 'metadata.xml', 'description': ("Supports reading of Sentinel-2 Level 2A Tiles with 20m resolution and cloud mask." "Level 2A tile products metadata files"), 'supportsOrthorectification': False, 'enableClipToFootprint': True, 'isRasterProduct': True, # #'crawlerName': 'Sentinel2Tile10mCrawler', 'productDefinitionName': 'Sentinel-2_L2A_Tile', 'supportedUriFilters': [ { 'name': 'Tile', 'allowedProducts': [ 'Sentinel-2_L2A_Tile' ], 'supportsOrthorectification': False, 'supportedTemplates': [ 'Composite20mBandsCloud' ] } ], 'processingTemplates': [ { 'name': 'Composite20mBandsCloud', 'enabled': True, 'outputDatasetTag': '20m-10Band', 'primaryInputDatasetTag': '20m', 'isProductTemplate': True, 'functionTemplate': Rxm['20c']['rasterFunctionTemplate'] } ], 'bandProperties': [bandProperties[k] for k in bandProperties if k in Rxm['20c']['bandKeys']], 'fields': [self.sensorName_auxField, self.productName_auxField, self.acquisitionDate_auxField, self.cloudCoverage_auxField, self.vegetationPercentage_auxField] } ] return rasterTypes
print(infile1_fieldnames) # print(infile2_fields) for field in infile2_fields: field_name = field.name if field_name in ["FID", "Shape"]: continue field_map = arcpy.FieldMap() if field_name in infile1_fieldnames: field_map.addInputField(infile1, field_name) field_map.addInputField(infile2, field_name) # define the resulting field based on infile2 definition out_field = arcpy.Field() out_field.name = field_name out_field.type = field.type out_field.length = field.length out_field.scale = field.scale out_field.precision = field.precision field_map.outputField = out_field print( " field_map inputFieldCount={} mergeRule={} outputField.name=[{}] type={} length={} field2.length={}" .format(field_map.inputFieldCount, field_map.mergeRule, field_map.outputField.name, field_map.outputField.type, field_map.outputField.length, field.length)) field_mappings.addFieldMap(field_map)
def getRasterTypesInfo(self): self.dacq_auxField = arcpy.Field() # center_dt self.dacq_auxField.name = 'AcquisitionDate' self.dacq_auxField.aliasName = 'Acquisition Date' self.dacq_auxField.type = 'date' self.platform_auxField = arcpy.Field() self.platform_auxField.name = 'Platform' self.platform_auxField.aliasName = 'Platform' self.platform_auxField.type = 'String' self.platform_auxField.length = 50 self.instrument_auxField = arcpy.Field() self.instrument_auxField.name = 'Instrument' self.instrument_auxField.aliasName = 'Instrument' self.instrument_auxField.type = 'String' self.instrument_auxField.length = 50 self.prodtype_auxField = arcpy.Field() self.prodtype_auxField.name = 'ProductType' self.prodtype_auxField.aliasName = 'Product Type' self.prodtype_auxField.type = 'String' self.prodtype_auxField.length = 50 self.id_auxField = arcpy.Field() self.id_auxField.name = 'ID' self.id_auxField.aliasName = 'ID' self.id_auxField.type = 'String' self.id_auxField.length = 50 return [{ 'rasterTypeName': 'DataCube-Landsat', 'builderName': 'LandsatDataCubeBuilder', 'description': ("Supports reading of Landsat8/Landsat7 DataCube data"), 'enableClipToFootprint': True, 'isRasterProduct': False, 'dataSourceType': (DataSourceType.File | DataSourceType.Folder), 'dataSourceFilter': '*.yaml', 'crawlerName': 'LandsatDataCubeCrawler', 'productDefinitionName': 'DataCube-Landsat', 'supportedUriFilters': [{ 'name': 'Level2', 'allowedProducts': [ 'LaSRC', ], 'supportsOrthorectification': True, 'enableClipToFootprint': True, 'supportedTemplates': [ 'DataCube_L8_MS_QA', 'DataCube_L8_MS', 'DataCube_L7_MS', 'DataCube_L7_MS_QA' ] }], 'processingTemplates': [{ 'name': 'DataCube_L8_MS_QA', 'enabled': True, 'outputDatasetTag': 'DataCube_L8_MS_QA', 'primaryInputDatasetTag': 'DataCube_L8_MS_QA', 'isProductTemplate': True, 'functionTemplate': 'DataCube_L8_MS_QA.rft.xml' }, { 'name': 'DataCube_L8_MS', 'enabled': True, 'outputDatasetTag': 'DataCube_L8_MS', 'primaryInputDatasetTag': 'DataCube_L8_MS', 'isProductTemplate': True, 'functionTemplate': 'DataCube_L8_MS.rft.xml' }, { 'name': 'DataCube_L7_MS_QA', 'enabled': True, 'outputDatasetTag': 'DataCube_L7_MS_QA', 'primaryInputDatasetTag': 'DataCube_L7_MS_QA', 'isProductTemplate': True, 'functionTemplate': 'DataCube_L7_MS_QA.rft.xml' }, { 'name': 'DataCube_L7_MS', 'enabled': True, 'outputDatasetTag': 'DataCube_L7_MS', 'primaryInputDatasetTag': 'DataCube_L7_MS', 'isProductTemplate': True, 'functionTemplate': 'DataCube_L7_MS.rft.xml' }], # GET THE CORRECT BAND INDEX , MIN MAX WAVELENGTH 'bandProperties': [{ 'bandName': 'blue', 'bandIndex': 1, 'wavelengthMin': 452.0, 'wavelengthMax': 512.0, 'datasetTag': 'MS' }, { 'bandName': 'green', 'bandIndex': 2, 'wavelengthMin': 533.0, 'wavelengthMax': 590.0, 'datasetTag': 'MS' }, { 'bandName': 'nir', 'bandIndex': 4, 'wavelengthMin': 851.0, 'wavelengthMax': 879.0, 'datasetTag': 'MS' }, { 'bandName': 'red', 'bandIndex': 3, 'wavelengthMin': 636.0, 'wavelengthMax': 673.0, 'datasetTag': 'MS' }, { 'bandName': 'swir1', 'bandIndex': 5, 'wavelengthMin': 1566.0, 'wavelengthMax': 1651.0, 'datasetTag': 'SWIR' }, { 'bandName': 'swir2', 'bandIndex': 6, 'wavelengthMin': 2107.0, 'wavelengthMax': 2294.0, 'datasetTag': 'SWIR' }, { 'bandName': 'aerosol_qa', 'bandIndex': 7, 'wavelengthMin': 0.0, 'wavelengthMax': 255.0, 'datasetTag': 'QA' }, { 'bandName': 'coastal_aerosol', 'bandIndex': 8, 'wavelengthMin': 435.0, 'wavelengthMax': 451.0, 'datasetTag': 'QA' }, { 'bandName': 'pixel_qa', 'bandIndex': 9, 'wavelengthMin': 0.0, 'wavelengthMax': 255.0, 'datasetTag': 'QA' }, { 'bandName': 'radsat_qa', 'bandIndex': 10, 'wavelengthMin': 0.0, 'wavelengthMax': 255.0, 'datasetTag': 'QA' }, { 'bandName': 'atmos_opacity', 'bandIndex': 11, 'wavelengthMin': 0.0, 'wavelengthMax': 255.0, 'datasetTag': 'QA' }, { 'bandName': 'cloud_qa', 'bandIndex': 12, 'wavelengthMin': 0.0, 'wavelengthMax': 255.0, 'datasetTag': 'QA' }], # GET THE CORRECT BAND INDEX , MIN MAX WAVELENGTH 'fields': [ self.dacq_auxField, self.platform_auxField, self.instrument_auxField, self.prodtype_auxField, self.id_auxField ] }]
def getRasterTypesInfo(self): self.dacq_auxField = arcpy.Field() # center_dt self.dacq_auxField.name = 'AcquisitionDate' self.dacq_auxField.aliasName = 'Acquisition Date' self.dacq_auxField.type = 'date' self.platform_auxField = arcpy.Field() self.platform_auxField.name = 'Platform' self.platform_auxField.aliasName = 'Platform' self.platform_auxField.type = 'String' self.platform_auxField.length = 50 self.instrument_auxField = arcpy.Field() self.instrument_auxField.name = 'Instrument' self.instrument_auxField.aliasName = 'Instrument' self.instrument_auxField.type = 'String' self.instrument_auxField.length = 50 self.prodtype_auxField = arcpy.Field() self.prodtype_auxField.name = 'ProductType' self.prodtype_auxField.aliasName = 'Product Type' self.prodtype_auxField.type = 'String' self.prodtype_auxField.length = 50 self.id_auxField = arcpy.Field() self.id_auxField.name = 'ID' self.id_auxField.aliasName = 'ID' self.id_auxField.type = 'String' self.id_auxField.length = 50 return [ { 'rasterTypeName': 'DataCube-Sentinel', 'builderName': 'SentinelDataCubeBuilder', 'description': ("Supports reading of Sentinel1 DataCube data"), 'enableClipToFootprint': True, 'isRasterProduct': False, 'dataSourceType': (DataSourceType.File | DataSourceType.Folder), 'dataSourceFilter': '*.yaml', 'crawlerName': 'SentinelDataCubeCrawler', 'productDefinitionName': 'DataCube-Sentinel', 'supportedUriFilters': [ { 'name': 'Level2', 'allowedProducts': [ 'gamma_0', ], 'supportsOrthorectification': True, 'enableClipToFootprint': True, 'supportedTemplates': [ 'DataCube_S1_SAR', ] } ], 'processingTemplates': [ { 'name': 'DataCube_S1_SAR', 'enabled': True, 'outputDatasetTag': 'DataCube_S1_SAR', 'primaryInputDatasetTag': 'DataCube_S1_SAR', 'isProductTemplate': True, 'functionTemplate': 'DataCube_S1_SAR.rft.xml' } ], # GET THE CORRECT BAND INDEX , MIN MAX WAVELENGTH 'bandProperties': [ { 'bandName': 'vh', 'bandIndex': 1, 'wavelengthMin': 180000000.0, # C band with central frequency of 5.405 GHz 'wavelengthMax': 180000000.0, 'datasetTag': 'SAR' }, { 'bandName': 'vv', 'bandIndex': 2, 'wavelengthMin': 180000000.0, # C band with central frequency of 5.405 GHz 'wavelengthMax': 180000000.0, 'datasetTag': 'SAR' } ], # GET THE CORRECT BAND INDEX , MIN MAX WAVELENGTH 'fields': [self.dacq_auxField, self.platform_auxField, self.instrument_auxField, self.prodtype_auxField, self.id_auxField] } ]
def getRasterTypesInfo(self): self.acquisitionDate_auxField = arcpy.Field() self.acquisitionDate_auxField.name = 'AcquisitionDate' self.acquisitionDate_auxField.aliasName = 'Acquisition Date' self.acquisitionDate_auxField.type = 'Date' self.acquisitionDate_auxField.length = 50 self.sensorName_auxField = arcpy.Field() self.sensorName_auxField.name = 'SensorName' self.sensorName_auxField.aliasName = 'Sensor Name' self.sensorName_auxField.type = 'String' self.sensorName_auxField.length = 50 self.sunAzimuth_auxField = arcpy.Field() self.sunAzimuth_auxField.name = 'SunAzimuth' self.sunAzimuth_auxField.aliasName = 'Sun Azimuth' self.sunAzimuth_auxField.type = 'Double' self.sunAzimuth_auxField.precision = 5 self.productName_auxField = arcpy.Field() self.productName_auxField.name = 'ProductName' self.productName_auxField.aliasName = 'Product Name' self.productName_auxField.type = 'String' self.productName_auxField.length = 50 self.sunElevation_auxField = arcpy.Field() self.sunElevation_auxField.name = 'SunElevation' self.sunElevation_auxField.aliasName = 'Sun Elevation' self.sunElevation_auxField.type = 'Double' self.sunElevation_auxField.precision = 5 return [{ 'rasterTypeName': 'TeLEOS-1', 'builderName': 'TeleosBuilder', 'description': ("Supports reading of TeLEOS-1 " "Level 1 and Level 2 products metadata files"), 'supportsOrthorectification': True, 'enableClipToFootprint': True, 'isRasterProduct': True, 'dataSourceType': (DataSourceType.File | DataSourceType.Folder), 'dataSourceFilter': '*_metadata.xml', 'supportedUriFilters': [{ 'name': 'Standard', 'allowedProducts': ['L1'], 'supportsOrthorectification': True, 'supportedTemplates': ['Panchromatic'] }, { 'name': 'OrthoReady', 'allowedProducts': ['L2'], 'supportsOrthorectification': True, 'supportedTemplates': ['Panchromatic'] }], 'processingTemplates': [{ 'name': 'Panchromatic', 'enabled': True, 'outputDatasetTag': 'Pan', 'primaryInputDatasetTag': 'Pan', 'isProductTemplate': True, 'functionTemplate': 'TeLEOS-1_stretch_pan.rft.xml' }], 'bandProperties': [{ 'bandName': 'Panchromatic', 'bandIndex': 0, 'wavelengthMin': 500.0, 'wavelengthMax': 900.0, 'datasetTag': 'Pan' }], 'fields': [ self.sensorName_auxField, self.productName_auxField, self.acquisitionDate_auxField, self.sunAzimuth_auxField, self.sunElevation_auxField ] }]
def getRasterTypesInfo(self): self.object_auxField = arcpy.Field() self.object_auxField.name = 'Object' self.object_auxField.aliasName = 'Object' self.object_auxField.type = 'String' self.object_auxField.length = 20 self.telescope_auxField = arcpy.Field() self.telescope_auxField.name = 'Telescope' self.telescope_auxField.aliasName = 'Telescope' self.telescope_auxField.type = 'String' self.telescope_auxField.length = 20 self.date_auxField = arcpy.Field() self.date_auxField.name = 'Date' self.date_auxField.aliasName = 'Date' self.date_auxField.type = 'Date' self.date_auxField.length = 50 self.instrument_auxField = arcpy.Field() self.instrument_auxField.name = 'Instrument' self.instrument_auxField.aliasName = 'Instrument' self.instrument_auxField.type = 'Text' self.instrument_auxField.length = 20 self.creator_auxField = arcpy.Field() self.creator_auxField.name = 'Creator' self.creator_auxField.aliasName = 'Creator' self.creator_auxField.type = 'Text' self.creator_auxField.length = 20 self.origin_auxField = arcpy.Field() self.origin_auxField.name = 'Origin' self.origin_auxField.aliasName = 'Origin' self.origin_auxField.type = 'Text' self.origin_auxField.length = 50 return [ { 'rasterTypeName': 'SINGS', 'builderName': 'SINGSBuilder', 'description': ("Supports Spitzer Space Telescop SINGS Data."), 'supportsOrthorectification': False, 'enableClipToFootprint': True, 'isRasterProduct': True, 'dataSourceType': (DataSourceType.File | DataSourceType.Folder), 'dataSourceFilter': '*.mrf, *.lrc, *.tif', # 'supportedUriFilters': [ # { # 'name': 'Levels', # 'allowedProducts':'Res01', # 'supportsOrthorectification': False, # 'supportedTemplates': 'Res01' # } # ], 'processingTemplates': [ { 'name': 'SINGS_Default', 'enabled': False, 'outputDatasetTag': 'Multispectral', 'primaryInputDatasetTag': 'Multispectral', 'isProductTemplate': False, 'functionTemplate': 'SINGS_Default.rft.xml' } ], 'bandProperties': [ { 'bandName': 'IRAC1', 'bandIndex': 1, 'datasetTag': 'Spiter IRAC' }, { 'bandName': 'IRAC2', 'bandIndex': 2, 'datasetTag': 'Spiter IRAC' }, { 'bandName': 'IRAC3', 'bandIndex': 3, 'datasetTag': 'Spiter IRAC' }, { 'bandName': 'IRAC ', 'bandIndex': 4, 'datasetTag': 'Spiter IRAC' } ], 'fields': [self.object_auxField, self.telescope_auxField, self.date_auxField, self.instrument_auxField, self.creator_auxField, self.origin_auxField] } ]
def getRasterTypesInfo(self): self.dacq_auxField = arcpy.Field() # Creation Date self.dacq_auxField.name = 'AcquisitionDate' self.dacq_auxField.aliasName = 'Acquisition Date' self.dacq_auxField.type = 'date' self.platform_auxField = arcpy.Field() self.platform_auxField.name = 'Platform' self.platform_auxField.aliasName = 'Platform' self.platform_auxField.type = 'String' self.platform_auxField.length = 50 self.instrument_auxField = arcpy.Field() self.instrument_auxField.name = 'Instrument' self.instrument_auxField.aliasName = 'Instrument' self.instrument_auxField.type = 'String' self.instrument_auxField.length = 50 self.prodtype_auxField = arcpy.Field() self.prodtype_auxField.name = 'ProductType' self.prodtype_auxField.aliasName = 'Product Type' self.prodtype_auxField.type = 'String' self.prodtype_auxField.length = 50 self.id_auxField = arcpy.Field() self.id_auxField.name = 'ID' self.id_auxField.aliasName = 'ID' self.id_auxField.type = 'String' self.id_auxField.length = 50 return [{ 'rasterTypeName': 'Geoscience-Landsat', 'builderName': 'GeoscienceBuilder', 'description': ("Supports reading of Geoscience Landsat8 nbart data"), 'enableClipToFootprint': True, 'isRasterProduct': False, 'dataSourceType': (DataSourceType.File | DataSourceType.Folder), 'dataSourceFilter': '*.yaml', 'crawlerName': 'GeoscienceCrawler', 'productDefinitionName': 'Geoscience-Landsat', 'supportedUriFilters': [{ 'name': 'Level2', 'allowedProducts': [ 'L8ARD', ], 'supportsOrthorectification': True, 'enableClipToFootprint': True, 'supportedTemplates': ['Geoscience_MS_NBART'] }], 'processingTemplates': [{ 'name': 'Geoscience_MS_NBART', 'enabled': True, 'outputDatasetTag': 'NBART', 'primaryInputDatasetTag': 'NBART', 'isProductTemplate': True, 'functionTemplate': 'Geoscience_MS_NBART.rft.xml' }], # GET THE CORRECT BAND INDEX , MIN MAX WAVELENGTH 'bandProperties': [{ 'bandName': 'blue', 'bandIndex': 1, 'wavelengthMin': 452.0, 'wavelengthMax': 512.0, 'datasetTag': 'MS' }, { 'bandName': 'green', 'bandIndex': 2, 'wavelengthMin': 533.0, 'wavelengthMax': 590.0, 'datasetTag': 'MS' }, { 'bandName': 'nir', 'bandIndex': 4, 'wavelengthMin': 851.0, 'wavelengthMax': 879.0, 'datasetTag': 'MS' }, { 'bandName': 'red', 'bandIndex': 3, 'wavelengthMin': 636.0, 'wavelengthMax': 673.0, 'datasetTag': 'MS' }, { 'bandName': 'swir1', 'bandIndex': 5, 'wavelengthMin': 1566.0, 'wavelengthMax': 1651.0, 'datasetTag': 'SWIR' }, { 'bandName': 'swir2', 'bandIndex': 6, 'wavelengthMin': 2107.0, 'wavelengthMax': 2294.0, 'datasetTag': 'SWIR' }], # GET THE CORRECT BAND INDEX , MIN MAX WAVELENGTH 'fields': [ self.dacq_auxField, self.platform_auxField, self.instrument_auxField, self.prodtype_auxField, self.id_auxField ] }]
def getRasterTypesInfo(self): self.sensorName_auxField = arcpy.Field() self.sensorName_auxField.name = 'SensorName' self.sensorName_auxField.aliasName = 'Sensor Name' self.sensorName_auxField.type = 'String' self.sensorName_auxField.length = 50 self.acquisitiondate_auxField = arcpy.Field() self.acquisitiondate_auxField.name = 'AcquisitionDate' self.acquisitiondate_auxField.aliasName = 'Acquisition Date' self.acquisitiondate_auxField.type = 'date' self.cloudcover_auxField = arcpy.Field() self.cloudcover_auxField.name = 'CloudCoverPercentage' self.cloudcover_auxField.aliasName = 'Cloud Cover Percentage' self.cloudcover_auxField.type = 'double' self.cloudcover_auxField.precision = 5 self.resolution_auxField = arcpy.Field() self.resolution_auxField.name = 'Resolution' self.resolution_auxField.aliasName = 'Resolution' self.resolution_auxField.type = 'String' self.resolution_auxField.precision = 50 self.resolutionmax_auxField = arcpy.Field() self.resolutionmax_auxField.name = 'ResolutionMax' self.resolutionmax_auxField.aliasName = 'Max Resolution' self.resolutionmax_auxField.type = 'double' self.resolutionmax_auxField.precision = 8 self.resolutionmin_auxField = arcpy.Field() self.resolutionmin_auxField.name = 'ResolutionMin' self.resolutionmin_auxField.aliasName = 'Min Resolution' self.resolutionmin_auxField.type = 'double' self.resolutionmin_auxField.precision = 8 return [{ 'rasterTypeName': 'GeoScene-Sentinel2', 'builderName': 'GeoSceneSentinelBuilder', 'description': ("Supports reading of GeoScene Sentinel2 Level1 and Level2"), 'supportsOrthorectification': True, 'enableClipToFootprint': True, 'isRasterProduct': False, 'dataSourceType': (DataSourceType.File | DataSourceType.Folder), 'dataSourceFilter': 'MTD_MSI*.xml', 'crawlerName': 'GeoSceneSentinelCrawler', # 'productDefinitionName': 'Geoscene-Sentinel', #'supportedUriFilters': [ # { # 'name': 'LEVEL1C', # 'allowedProducts': ['L1C'], # 'supportsOrthorectification': True, # 'enableClipToFootprint': True, # 'supportedTemplates': ['GeoScene_ALL_Composite'] # }, # { # 'name': 'LEVEL2A', # 'allowedProducts': ['L2A'], # 'supportsOrthorectification': True, # 'supportedTemplates': ['GeoScene_ALL_Composite'] # } #], #'processingTemplates': [ # { # 'name': 'GeoScene_ALL_Composite', # 'enabled': True, # 'outputDatasetTag': 'ALLBANDS', # 'primaryInputDatasetTag': 'ALLBANDS', # 'isProductTemplate': True, # 'functionTemplate': 'GeoScene_ALL_Composite.rft.xml' # } #], # GET THE CORRECT BAND INDEX , MIN MAX WAVELENGTH 'bandProperties': [{ 'bandName': 'azimuthal_exiting', 'bandIndex': 1, 'datasetTag': 'MS' }, { 'bandName': 'azimuthal_incident', 'bandIndex': 2, 'datasetTag': 'MS' }, { 'bandName': 'exiting', 'bandIndex': 3, 'datasetTag': 'MS' }, { 'bandName': 'fmask', 'bandIndex': 4, 'datasetTag': 'MS' }, { 'bandName': 'incident', 'bandIndex': 5, 'datasetTag': 'MS' }, { 'bandName': 'lambertian_blue', 'bandIndex': 6, 'wavelengthMin': 447.6, 'wavelengthMax': 545.6, 'datasetTag': 'MS' }, { 'bandName': 'lambertian_coastal_aerosol', 'bandIndex': 7, 'wavelengthMin': 430.4, 'wavelengthMax': 457.4, 'datasetTag': 'MS' }, { 'bandName': 'lambertian_contiguity', 'bandIndex': 8, 'wavelengthMin': 1550.0, 'wavelengthMax': 1590.0, 'datasetTag': 'CG' }, { 'bandName': 'lambertian_green', 'bandIndex': 9, 'wavelengthMin': 537.5, 'wavelengthMax': 582.5, 'datasetTag': 'MS' }, { 'bandName': 'lambertian_nir_1', 'bandIndex': 10, 'wavelengthMin': 762.6, 'wavelengthMax': 907.6, 'datasetTag': 'MS' }, { 'bandName': 'lambertian_nir_2', 'bandIndex': 11, 'wavelengthMin': 848.3, 'wavelengthMax': 881.3, 'datasetTag': 'MS' }, { 'bandName': 'lambertian_red', 'bandIndex': 12, 'wavelengthMin': 645.5, 'wavelengthMax': 683.5, 'datasetTag': 'MS' }, { 'bandName': 'lambertian_red_edge_1', 'bandIndex': 13, 'wavelengthMin': 694.4, 'wavelengthMax': 713.4, 'datasetTag': 'MS' }, { 'bandName': 'lambertian_red_edge_2', 'bandIndex': 14, 'wavelengthMin': 731.2, 'wavelengthMax': 749.2, 'datasetTag': 'MS' }, { 'bandName': 'lambertian_red_edge_3', 'bandIndex': 15, 'wavelengthMin': 768.5, 'wavelengthMax': 796.5, 'datasetTag': 'MS' }, { 'bandName': 'lambertian_swir_2', 'bandIndex': 16, 'wavelengthMin': 1542.2, 'wavelengthMax': 1685.2, 'datasetTag': 'SWIR' }, { 'bandName': 'lambertian_swir_3', 'bandIndex': 17, 'wavelengthMin': 2081.4, 'wavelengthMax': 2323.4, 'datasetTag': 'SWIR' }, { 'bandName': 'nbar_blue', 'bandIndex': 18, 'wavelengthMin': 447.6, 'wavelengthMax': 545.6, 'datasetTag': 'MS' }, { 'bandName': 'nbar_coastal_aerosol', 'bandIndex': 19, 'wavelengthMin': 430.4, 'wavelengthMax': 457.4, 'datasetTag': 'MS' }, { 'bandName': 'nbar_contiguity', 'bandIndex': 20, 'datasetTag': 'CG' }, { 'bandName': 'nbar_green', 'bandIndex': 21, 'wavelengthMin': 537.5, 'wavelengthMax': 582.5, 'datasetTag': 'MS' }, { 'bandName': 'nbar_nir_1', 'bandIndex': 22, 'wavelengthMin': 762.6, 'wavelengthMax': 907.6, 'datasetTag': 'MS' }, { 'bandName': 'nbar_nir_2', 'bandIndex': 23, 'wavelengthMin': 848.3, 'wavelengthMax': 881.3, 'datasetTag': 'MS' }, { 'bandName': 'nbar_red', 'bandIndex': 24, 'wavelengthMin': 645.5, 'wavelengthMax': 683.5, 'datasetTag': 'MS' }, { 'bandName': 'nbar_red_edge_1', 'bandIndex': 25, 'wavelengthMin': 694.4, 'wavelengthMax': 713.4, 'datasetTag': 'MS' }, { 'bandName': 'nbar_red_edge_2', 'bandIndex': 26, 'wavelengthMin': 731.2, 'wavelengthMax': 749.2, 'datasetTag': 'MS' }, { 'bandName': 'nbar_red_edge_3', 'bandIndex': 27, 'wavelengthMin': 768.5, 'wavelengthMax': 796.5, 'datasetTag': 'MS' }, { 'bandName': 'nbar_swir_2', 'bandIndex': 28, 'wavelengthMin': 1542.2, 'wavelengthMax': 1685.2, 'datasetTag': 'SWIR' }, { 'bandName': 'nbar_swir_3', 'bandIndex': 29, 'wavelengthMin': 2081.4, 'wavelengthMax': 2323.4, 'datasetTag': 'SWIR' }, { 'bandName': 'nbart_blue', 'bandIndex': 30, 'wavelengthMin': 447.6, 'wavelengthMax': 545.6, 'datasetTag': 'MS' }, { 'bandName': 'nbart_coastal_aerosol', 'bandIndex': 31, 'wavelengthMin': 430.4, 'wavelengthMax': 457.4, 'datasetTag': 'MS' }, { 'bandName': 'nbart_contiguity', 'bandIndex': 32, 'datasetTag': 'CG' }, { 'bandName': 'nbart_green', 'bandIndex': 33, 'wavelengthMin': 537.5, 'wavelengthMax': 582.5, 'datasetTag': 'MS' }, { 'bandName': 'nbart_nir_1', 'bandIndex': 34, 'wavelengthMin': 762.6, 'wavelengthMax': 907.6, 'datasetTag': 'MS' }, { 'bandName': 'nbart_nir_2', 'bandIndex': 35, 'wavelengthMin': 848.3, 'wavelengthMax': 881.3, 'datasetTag': 'MS' }, { 'bandName': 'nbart_red', 'bandIndex': 36, 'wavelengthMin': 645.5, 'wavelengthMax': 683.5, 'datasetTag': 'MS' }, { 'bandName': 'nbart_red_edge_1', 'bandIndex': 37, 'wavelengthMin': 694.4, 'wavelengthMax': 713.4, 'datasetTag': 'MS' }, { 'bandName': 'nbart_red_edge_2', 'bandIndex': 38, 'wavelengthMin': 731.2, 'wavelengthMax': 749.2, 'datasetTag': 'MS' }, { 'bandName': 'nbart_red_edge_3', 'bandIndex': 39, 'wavelengthMin': 768.5, 'wavelengthMax': 796.5, 'datasetTag': 'MS' }, { 'bandName': 'nbart_swir_2', 'bandIndex': 40, 'wavelengthMin': 1542.2, 'wavelengthMax': 1685.2, 'datasetTag': 'SWIR' }, { 'bandName': 'nbart_swir_3', 'bandIndex': 41, 'wavelengthMin': 2081.4, 'wavelengthMax': 2323.4, 'datasetTag': 'SWIR' }, { 'bandName': 'relative_azimuth', 'bandIndex': 42, 'datasetTag': 'MS' }, { 'bandName': 'relative_slope', 'bandIndex': 43, 'datasetTag': 'MS' }, { 'bandName': 'satellite_azimuth', 'bandIndex': 44, 'datasetTag': 'MS' }, { 'bandName': 'satellite_view', 'bandIndex': 45, 'datasetTag': 'MS' }, { 'bandName': 'solar_azimuth', 'bandIndex': 46, 'datasetTag': 'MS' }, { 'bandName': 'solar_zenith', 'bandIndex': 47, 'datasetTag': 'MS' }, { 'bandName': 'terrain_shadow', 'bandIndex': 48, 'datasetTag': 'MS' }, { 'bandName': 'timedelta', 'bandIndex': 49, 'datasetTag': 'MS' }], # GET THE CORRECT BAND INDEX , MIN MAX WAVELENGTH 'fields': [ self.sensorName_auxField, self.acquisitiondate_auxField, self.cloudcover_auxField, self.resolution_auxField, self.resolutionmax_auxField, self.resolutionmin_auxField ] }]
def getRasterTypesInfo(self): self.acquisitionDate_auxField = arcpy.Field() self.acquisitionDate_auxField.name = 'AcquisitionDate' self.acquisitionDate_auxField.aliasName = 'Acquisition Date' self.acquisitionDate_auxField.type = 'Date' self.acquisitionDate_auxField.length = 50 self.instrument_auxField = arcpy.Field() self.instrument_auxField.name = 'Instrument' self.instrument_auxField.aliasName = 'Instrument' self.instrument_auxField.type = 'String' self.instrument_auxField.length = 50 self.sensorName_auxField = arcpy.Field() self.sensorName_auxField.name = 'SensorName' self.sensorName_auxField.aliasName = 'Sensor Name' self.sensorName_auxField.type = 'String' self.sensorName_auxField.length = 50 self.sunAzimuth_auxField = arcpy.Field() self.sunAzimuth_auxField.name = 'SunAzimuth' self.sunAzimuth_auxField.aliasName = 'Sun Azimuth' self.sunAzimuth_auxField.type = 'Double' self.sunAzimuth_auxField.precision = 5 self.sunElevation_auxField = arcpy.Field() self.sunElevation_auxField.name = 'SunElevation' self.sunElevation_auxField.aliasName = 'Sun Elevation' self.sunElevation_auxField.type = 'Double' self.sunElevation_auxField.precision = 5 return [ { 'rasterTypeName': 'DEIMOS-2', 'builderName': 'DeimosBuilder', 'description': ("Supports reading of DEIMOS-2 " "Level 1B / 1C product metadata files"), 'supportsOrthorectification': True, 'enableClipToFootprint': True, 'isRasterProduct': True, 'dataSourceType': (DataSourceType.File | DataSourceType.Folder), 'dataSourceFilter': '*.dim', 'crawlerName': 'Deimos2Crawler', 'supportedUriFilters': [ { 'name': 'Level1', 'allowedProducts': [ 'L1C', 'L1B' ], 'supportsOrthorectification': True, 'supportedTemplates': [ 'Multispectral', 'Panchromatic', 'Pansharpen', 'All Bands' ] } ], 'productDefinitionName': 'DEIMOS2_4BANDS', 'processingTemplates': [ { 'name': 'Multispectral', 'enabled': True, 'outputDatasetTag': 'MS', 'primaryInputDatasetTag': 'MS', 'isProductTemplate': True, 'functionTemplate': 'D2_stretch_ms.rft.xml' }, { 'name': 'Panchromatic', 'enabled': False, 'outputDatasetTag': 'Pan', 'primaryInputDatasetTag': 'Pan', 'isProductTemplate': True, 'functionTemplate': 'D2_stretch_pan.rft.xml' }, { 'name': 'Pansharpen', 'enabled': False, 'outputDatasetTag': 'Pansharpened', 'primaryInputDatasetTag': 'MS', 'isProductTemplate': True, 'functionTemplate': 'D2_stretch_psh.rft.xml' }, { 'name': 'All Bands', 'enabled': False, 'isProductTemplate': False, 'functionTemplate': 'D2_stretch_allbands.rft.xml' } ], 'bandProperties': [ { 'bandName': 'Blue', 'bandIndex': 3, 'wavelengthMin': 466.0, 'wavelengthMax': 525.0, 'datasetTag': 'MS' }, { 'bandName': 'Green', 'bandIndex': 2, 'wavelengthMin': 532.0, 'wavelengthMax': 599.0, 'datasetTag': 'MS' }, { 'bandName': 'Red', 'bandIndex': 1, 'wavelengthMin': 640.0, 'wavelengthMax': 697.0, 'datasetTag': 'MS' }, { 'bandName': 'NearInfrared', 'bandIndex': 0, 'wavelengthMin': 770.0, 'wavelengthMax': 892.0, 'datasetTag': 'MS' }, { 'bandName': 'Panchromatic', 'bandIndex': 0, 'wavelengthMin': 560.0, 'wavelengthMax': 900.0, 'datasetTag': 'Pan' } ], 'fields': [self.sensorName_auxField, self.acquisitionDate_auxField, self.instrument_auxField, self.sunAzimuth_auxField, self.sunElevation_auxField] } ]