Embeded scripts

This commit is contained in:
2024-06-16 00:14:51 +02:00
parent ca1a13ed9d
commit af4be850cb
5 changed files with 62 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
if(files.length == 0)
{
core.files("No files");
throw "";
}
let compression = {"compressionType": "zstd+sh"};
for(file of files)
{
if(file.suffix() == "fits" || file.suffix() == "fit")
{
core.log("Converting " + file.fileName());
convertedFiles.push(file.convertAsync(file.relativeFilePath(), "XISF", compression));
}
}
+29
View File
@@ -0,0 +1,29 @@
// how to get input from user
let d = core.getFloat("Getting float value");
let i = core.getInt("Getting integer value");
let s = core.getString("Getting string value");
// print user input
core.log("Your input " + d + " " + i + " " + s);
for(file of files)
{
if(file.suffix() == "fits" || file.suffix() == "fit" || file.suffix() == "xisf")
{
let keywords = file.fitsKeywords();
let item = core.getItem(keywords);
core.log("You selected keyword " + item); core.log(file.fitsKeywords());
// some sample files
core.log("fileName() " + file.fileName());
core.log("absoluteFilePath() " + file.absoluteFilePath());
core.log("absolutePath() " + file.absolutePath());
core.log("relativeFilePath() " + file.relativeFilePath());
core.log("relativePath() " + file.relativePath());
core.log("baseName() " + file.baseName());
core.log("completeBase() " + file.completeBaseName());
core.log("suffix() " + file.suffix());
core.log("size() " + file.size());
break;
}
}
+6
View File
@@ -0,0 +1,6 @@
<RCC>
<qresource prefix="/scripts">
<file>example script</file>
<file>convert to XISF</file>
</qresource>
</RCC>