Author Topic: Using PI modules from a linux shell?  (Read 5645 times)

Offline JE

  • Newcomer
  • Posts: 3
Using PI modules from a linux shell?
« on: 2011 January 20 08:14:07 »
Hi.
I am wondering whether it is possible to invoke PI modules from a linux shell. I know it is possible to do it from the internal processing console, but I haven't been able to find how to do it from a shell.

Is it possible?

Regards JE

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Using PI modules from a linux shell?
« Reply #1 on: 2011 January 20 11:22:57 »
Modules are implemented as dynamically loaded libraries, not executables. They depend on framework services and events to do their thing. It would conceivably be possible to write PI in such a way that it can take commands remotely (say through a socket connection) but I'm pretty sure it's not there now. Since this is a multi platform app there's no COM either.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Using PI modules from a linux shell?
« Reply #2 on: 2011 January 20 14:06:11 »
But I would think it is possible to call PI from a shell, handing in a command script. I have not yet tried that myself, but I guess it is possible.
Unfortunately, Pixinsight.exe --help does not output anything useful.

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Using PI modules from a linux shell?
« Reply #3 on: 2011 January 20 14:13:42 »
Sorry, I was wrong. Here is the output of Pixinsight.exe --help. On Windows, it appears not in the shell window, but in a separate window. Probably --run=<scipt_file> does what you need.

Georg

Code: [Select]
PixInsight Core 01.06.01.0625 (x86_64)
Copyright (C) 2003-2010 Pleiades Astrophoto

Usage: PixInsight [<arg_list>] [<url_list>]

<url_list>

      is a sequence <url> [<url_list>]

<url>

      is a URL specification to an existing file. Supported file types include
      images of any installed image format, Process Set Module files (.psm),
      script files (.js, .jsh, .scp), and plain text files (.txt, files with no
      suffix, and a number of source code file types such as .c, .cpp, .h, etc).

      URLs must conform to the URI specification from RFC 3986 (Uniform Resource
      Identifier: Generic Syntax). For remote URLs, the HTTP and FTP protocols
      are fully supported with optional user authentication.

      For local path specifications, wild file names are fully supported via
      standard * and ? wildcards.

<arg_list>

      is a sequence <arg> [<arg_list>]

<arg>

      is a valid argument specification. Valid arguments are:

-s=<file_path> | --startup-script=<file_path>

      <file_path> is a path specification to a local script file that will be
      executed as part of the startup procedure. By default, the standard
      "startup.scp" script is executed, unless the --no-startup-script
      argument is specified (see below).

--no-startup-script

      Don't execute a startup script.

--no-splash

      Don't show a nice splash window during startup.

-m=<file_path> | --module=<file_path>

      <file_path> is a local path specification to a PixInsight module that
      will be installed upon startup. This argument can be used multiple
      times to define a set of modules that will be installed in the order
      they appear on the command line.

-r=<file_path> | --run=<file_path>

      <file_path> is a path specification to a local script file that will be
      loaded and executed just after the startup procedure. This argument can
      be used multiple times to define an ordered set of scripts that will be
      executed after the startup script.

--backup-conf

      Write a backup copy of the current PixInsight configuration file on the
      user's home directory. The backup file is generated prior to any reset of
      configuration settings.

--reset-all

      Forces a reset of all configuration settings. This includes all
      preferences, pixel readout options, color management settings, and global
      RGBWS parameters.

--reset-color-management

      Resets color management settings to default values.

--reset-preferences

      Resets all user preferences to default settings.

--reset-readout-options

      Resets pixel readout options to default settings.

--reset-RGBWS

      Resets global RGB Working Space parameters to default values.

--reset-printer

      Resets the global printer object to default settings.

--default-modules

      Resets the set of installed modules to the default standard set. After
      scanning the bin installation directory looking for valid PixInsight
      modules, the core application will try to install all modules found.
      Other modules that could have previously been installed will be ignored.

--default-scripts

      Resets the set of featured scripts. After scanning the src/scripts
      installation directory looking for scripts, the core application will
      create entries for all valid scripts found under the Script menu. Other
      scripts that could have previously been featured will be ignored.

--default-favorites

      Resets the Favorite Processes category to the factory-default set, which
      is version-dependent. The previous selection is lost.

--no-modules

      Do not install any modules. This option allows for changing global
      security settings, as enabling or disabling module authentication, with
      no module installed. The core application will reload all installed
      modules normally the next time it is executed without this argument.

--uninstall

      Runs the PixInsight core application in uninstall mode. This is a special
      execution mode reserved to erase all PixInsight configuration settings
      for the current user. A modal dialog box asks for confirmation before
      actually erasing all settings. The uninstall mode can also be triggered
      by running the core application with the Ctrl key pressed.

--r[+|-]

      Enables/disables recursive directory search for wildcard local file
      specifications. Each occurrence of this argument applies to local file
      items following it on the command line.

--help

      Displays this help and exits.
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline JE

  • Newcomer
  • Posts: 3
Re: Using PI modules from a linux shell?
« Reply #4 on: 2011 January 21 02:47:51 »
Yeah, that's right. But my question is about using PI withuot GUI, this is, execute the script over a set of images and then let the result on a different file. Is this possible?

Regards,
 
  JE

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Using PI modules from a linux shell?
« Reply #5 on: 2011 January 21 03:33:16 »
Hi,

No, that isn't possible.

However, note that you can pass one or more scripts that will be executed just after the startup process. Scripts can dynamically generate and execute process instances, and the last of those scripts can issue an "exit" command (or even "exit --force" to exit unconditionally ignoring any modified images etc.), so you can cause PixInsight to terminate and return to the caller.

Note also that PixInsight's graphical interface cannot be avoided; it will always be initialized because a significant part of PI's infrastructure depends on GUI resources.

BTW, just for the record, command line arguments have changed slightly in version 1.6.9 due to a redesign of PI's internal security system, the new updates sytem and other improvements. Here is the output of "./PixInsight --help" for version 1.6.9.652:

Code: [Select]
PixInsight Core 01.06.09.0652 (x86_64)
Copyright (C) 2003-2010 Pleiades Astrophoto

Usage: PixInsight [<arg_list>] [<url_list>]

<url_list>

      is a sequence <url> [<url_list>]

<url>

      is a URL specification to an existing file. Supported file types include
      images of any installed image format, Process Set Module files (.psm),
      script files (.js, .jsh, .scp), and plain text files (.txt, files with no
      suffix, and a number of source code file types such as .c, .cpp, .h, etc).

      URLs must conform to the URI specification from RFC 3986 (Uniform Resource
      Identifier: Generic Syntax). For remote URLs, the HTTP and FTP protocols
      are fully supported with optional user authentication.

      For local path specifications, wild file names are fully supported via
      standard * and ? wildcards.

<arg_list>

      is a sequence <arg> [<arg_list>]

<arg>

      is a valid argument specification. Valid arguments are:

--startup-script=<file_path>

      <file_path> is a path specification to a local script file that will be
      executed as part of the startup procedure. By default, the standard
      "startup.scp" script is executed, unless the --no-startup-script
      argument is specified (see below).

--no-startup-script

      Don't execute any startup script.

--no-splash

      Don't show a nice splash window during startup.

-m=<file_path> | --module=<file_path>

      <file_path> is a local path specification to a PixInsight module that
      will be installed upon startup. This argument can be used multiple
      times to define a set of modules that will be installed in the order
      they appear on the command line.

-s=<file_path> | --script=<file_path>

      <file_path> is a local path specification to a script that will be featured
      (if the script provides valid feature preprocessor directives) upon startup.
      This argument can be used multiple times to define a ser of scripts that
      will be featured in the order they appear on the command line.

-r=<file_path> | --run=<file_path>

      <file_path> is a local path specification to a script file that will be
      loaded and executed just after the startup procedure. This argument can
      be used multiple times to define an ordered set of scripts that will be
      executed after the startup script.

--backup-conf

      Write a backup copy of the current PixInsight configuration file on the
      user's home directory. The backup file is generated prior to any reset of
      configuration settings.

--reset-all

      Forces a reset of all configuration settings. This includes all
      preferences, pixel readout options, color management settings, and global
      RGBWS parameters.

--reset-color-management

      Resets color management settings to default values.

--reset-preferences

      Resets all user preferences to default settings.

--reset-readout-options

      Resets pixel readout options to default settings.

--reset-RGBWS

      Resets global RGB Working Space parameters to default values.

--reset-printer

      Resets the global printer object to default settings.

--default-modules

      Resets the set of installed modules to the default standard set. After
      scanning the bin installation directory looking for valid PixInsight
      modules, the core application will try to install all modules found.
      Other modules that could have previously been installed will be discarded.

--default-scripts

      Resets the set of featured scripts. After scanning the src/scripts
      installation directory looking for scripts, the core application will
      create entries for all valid scripts found under the Script menu. Other
      scripts that could have previously been featured will be discarded.

--default-favorites

      Resets the Favorite Processes category to the factory-default set, which
      is version-dependent. The previous selection is lost.

--no-modules

      Do not install any modules. Any modules installed during this session will
      be discarded. The core application will install the current set of modules
      the next time it is executed without this argument.

--no-scripts

      Do not feature any scripts. Any scripts featured during this session will
      be discarded. The core application will load the current collection of
      featured scripts the next time it is executed without this argument.

--uninstall

      Runs the PixInsight core application in uninstall mode. This is a special
      execution mode reserved to erase all PixInsight configuration settings
      for the current user. A modal dialog box asks for confirmation before
      actually erasing all settings. The uninstall mode can also be triggered
      by running the core application with the Ctrl key pressed.

--print-environment

      Writes the names and values of all environment variables to stdout.

--r[+|-]

      Enables/disables recursive directory search for wildcard local file
      specifications. Each occurrence of this argument applies to local file
      items following it on the command line.

--help

      Displays this help and exits.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline JE

  • Newcomer
  • Posts: 3
Re: Using PI modules from a linux shell?
« Reply #6 on: 2011 January 21 04:39:08 »
OK, thanks a lot for the answers !!! ;) ;)

Cheers