Download ESO ALMA NG/AMS
Transcript
ESO
ALMA
NG/AMS - User's Manual
Number
Issue
Date
Page
VLT-MAN-ESO-19400-2739
4
28/12/2009
77 of 110
ngamsPlugInApi.execCmd("gunzip " + workingFile)
if (workingFile.find(".Z") != -1):
workingFile = workingFile[:-2]
else:
workingFile = workingFile[:-3]
else:
workingFile = stageFile
# Check file (size + checksum).
ngamsFitsPlugIn.checkFitsFileSize(workingFile)
ngamsFitsPlugIn.checkChecksum(parDic, workingFile)
# Get various information about the file being handled.
arcFile, dpId, dateDirName = ngamsFitsPlugIn.getDpIdInfo(workingFile)
fileVersion, relPath, relFilename,\
complFilename, fileExists =\
ngamsPlugInApi.genFileInfoReg(srvObj.getDb(), srvObj.getCfg(),
reqPropsObj, diskInfo,
stageFile, dpId)
# Generate status.
info(4,"Generating status ...")
fileSize = ngamsPlugInApi.getFileSize(stageFile)
if (stageFile.find(".Z") != -1):
format = "application/x-cfits"
compresion = "compress"
elif (stageFile.find(".gz") != -1):
format = "application/x-gfits"
compresion = "gzip"
else:
format = "image/x-fits"
compresion = ""
uncomprSize = ngamsPlugInApi.getFileSize(workingFile)
# Delete the processing directory (would be done later by the
# Janitor Thread, but it is better to clean up explicitly).
if (procDir): rmFile(procDir)
info(3,"Register Plug-In finished processing of file")
return ngamsPlugInApi.genRegPiSuccessStat(diskInfo.getDiskId(),relFilename,
dpId, fileVersion, format,
fileSize, uncomprSize,compresion,
relPath, diskInfo.getSlotId(),
fileExists, complFilename)
# EOF
Figure 44: Example Register Plug-In (FILE: “ngams/ngamsPlugIns/ngamsFitsRegPlugIn.py”).
1.63 EXPERT: The Data Processing Plug-In - DPPI
The purpose of the Data Processing Plug-In (DPPI) is to provide a specific type of processing to be applied on a
specific type of data when data is being retrieved from an NGAS Host. Processing could be as trivial as simply
uncompressing a data file, which is stored in compressed format. It could also be far more complex and involve
advanced image processing and parameter extraction. How the DPPI actually processes the data, is left up to
the DPPI implementation. The DPPI only has to obey the set of rules for interfacing as for any other plug-in
defined for NG/AMS.
.0.17 EXPERT: Interface of a DPPI
The DPPI must be contained in a Python module (file), which has a function of the same name as the module.
The latter is the actual DPPI, which is invoked by NG/AMS.
A DPPI has an interface as shown in Figure 45.
NG/AMS – Next Generation Archive Management System