From 8818e25eda155daba49ee5b9f2f0eafacd54ab50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Poizl?= Date: Sat, 8 Jun 2024 20:21:46 +0200 Subject: [PATCH] Help documentation for batch processing --- about/help_en | 112 +++++++++++++++++++++++++++++++++++++++++++++++++- about/help_fr | 2 +- about/help_sk | 2 +- 3 files changed, 113 insertions(+), 3 deletions(-) diff --git a/about/help_en b/about/help_en index 420027f..5577467 100644 --- a/about/help_en +++ b/about/help_en @@ -14,7 +14,7 @@ img { margin: 5px; }
  • FITS 8, 16, 32 bit integer and 32, 64 bit float
  • XISF 8, 16, 32 bit integer and 32, 64 bit float
  • JPEG, PNG, BMP, GIF, PBM, PGM, PPM and SVG images
  • -
  • CR2, NEF, DNG raw images
  • +
  • CR2, CR3, NEF, DNG raw images
  • @@ -115,6 +115,116 @@ Pressing Enter or clicking on Filter button will filter out database reco

    This example filters for files where: "Bias" is in the file name, the OBJECT property is "M_42" (where the underscore can be any single character), and the DATE property begins with "2022".

    + + +

    Batch processing

    + +This module allow to write scripts in JavaScript that process image files. Batch Processing window consist from three main parts. On top is list of input files and directories. +You can add directories or individual files to this list. Directories are scanned recursively to find all files even non image files. This list of files is then passed to script in array named files. +In script you can then iterate through files like this. +
    for(file in files)
    +{
    +    if(file.suffix() == "fits")
    +    {
    +        core.log(file.fileName());
    +        file.convert(file.relativeFilePath(), "XISF");
    +    }
    +}
    +
    + +

    core

    +There is global object called core that have these methods. + + +

    File

    +In files array there are instances of type File objects that have these methods. + + +

    FITSRecordModify

    +This class is used to define modify operation FITS header in FITS and XISF files. It can remove update and add records. Order of operation is also remove then update and last add. +The keyword names may be up to 8 characters long and can only contain uppercase letters, the digits 0-9, the hyphen, and the underscore character. +
    let modify = new FITSRecordModify();
    +modify.updateKeyword("OBJECT", "M42");
    +modify.updateKeyword("MYTILE", "PART1", "adding custom keyword so WBPP can group it");
    +modify.removeKeyword("OBJECT");
    +// doesn't matter that it is specified as last. This will first remove
    +// existing OBJECT record and then add again OBJECT=M42
    +for(file in files)
    +{
    +    file.modifyFITSRecords(modify);
    +}
    + +
      +
    • new FITSRecordModify() create new instance of object.
    • +
    • removeKeyword(key); specify removing of record with key as keyword.
    • +
    • updateKeyword(key, value, comment = "") specify updating existing keyword with value and comment. Comment is optional parameter. If record with keyword doesn't exist then it will add new one. + Unless you want to have multiple records with same keyword (for example HISTORY) always use this method and not addKeyword.
    • +
    • addKeyword(key, value, comment = "") specify adding new keyword
    • +
    +

    PS: Kanji in icon means astronomy in Japanese

    diff --git a/about/help_fr b/about/help_fr index b8e9282..b35e412 100644 --- a/about/help_fr +++ b/about/help_fr @@ -14,7 +14,7 @@ img { margin: 5px; }
  • FITS 8, 16 bit entier et 32 bit point flottant
  • XISF 8, 16 bit entier et 32 bit point flottant
  • images JPEG, PNG, BMP, GIF, PBM, PGM, PPM et SVG
  • -
  • images RAW CR2, NEF, DNG
  • +
  • images RAW CR2, CR3, NEF, DNG
  • diff --git a/about/help_sk b/about/help_sk index 14f3400..889a2e2 100644 --- a/about/help_sk +++ b/about/help_sk @@ -13,7 +13,7 @@ p { padding:0px; margin:5px 5px 10px 5px; }
  • FITS 8, 16, 32 bitové celočíselné 32 a 64 bitové s plávajúcou čiarkou
  • XISF 8, 16, 32 bitové celočíselné 32 a 64 bitové s plávajúcou čiarkou
  • JPEG, PNG, BMP, GIF, PBM, PGM, PPM a SVG obrázky
  • -
  • CR2, NEF, DNG raw obrázky
  • +
  • CR2, CR3, NEF, DNG raw obrázky