core.log("This script convert any FITS file into XISF with ZSTD compression");

let compression = {"compressionType": "zstd+sh"};

for(file of files)
{
    if(file.suffix() == "fits" || file.suffix() == "fit")
    {
        core.log("Converting " + file.fileName());
        file.convertAsync(file.relativeFilePath(), "XISF", compression);
    }
}
