Currently an ASTERIX application will decided how to read some data from a file using a call such as (see file bdi_get.f),
CALL ADI_FEXEC( 'FileItemGet', 3, ARGS, DID, STATUS )This will execute the subroutines BDI1_GET or BDI2_GET depending on whether the opened file is of type HDS or FITS. All the underlying code to define and implement these methods can be replaced with the following simple section of code,
CALL ADF_GETREP( ID, REP, STATUS ) IF ( REP .EQ. 'HDS' ) THEN CALL BDF1_GET( ID, LID, ITEM, DID, STATUS ) ELSE IF ( REP .EQ. 'FITS' ) THEN CALL BDF2_GET( ID, LID, ITEM, DID, STATUS ) END IFN.B. Some more checking and sub-division of calls might be required if an operation depends on image, spectrum or time series data being present. It is expected that this can be accommodated by using an added complexity in the IF-THEN-ELSE clause.