Author Topic: Getting Started?  (Read 12437 times)

Offline varmint

  • Newcomer
  • Posts: 35
    • Varmint's Astrophoto's
Getting Started?
« on: 2010 June 10 13:18:46 »
I apologize in advance if this is the wrong forum, please redirect if necessary.

I would like to learn how to program some scripts, but don't know how to get started.  It has been ~15 years since I last programmed in Fortran and C++, and I've never done any script generation (aside from possibly debugging an Excel Macro way back when, if that counts).  Over the last year at work I've done some simple programming in Industrial Control System applications (Function Block and Structured Text, debugged Ladder Logic, for those who may know what those are), but I won't claim to be a really proficient programmer.

I'd like to know what tools I'd need to get started, in the hopes I can help out with some future scripts for PI (I've already got a few ideas that I see other folks are working on, but I'd like to learn too).

Do I need a compiler and/or linker application?
Other tools (aside from text editor)?

Thanks,

Jim
Clear Skies,

Jim
--"Do or do not.  There is no Try" --Jedi Master Yoda

Offline Silvercup

  • PixInsight Addict
  • ***
  • Posts: 187
Re: Getting Started?
« Reply #1 on: 2010 June 10 13:33:45 »
Hi Jim:

You only need a text editor, and some knowledge on Javascript. Read scripts already done. When you want to add a process module just throw it in a ProcessContainer and you get the source code.

Silvercup

Offline varmint

  • Newcomer
  • Posts: 35
    • Varmint's Astrophoto's
Re: Getting Started?
« Reply #2 on: 2010 June 10 13:37:59 »
Thanks Silvercup,

I just borrowed one of my coworker's Java Programming books, I hope to learn the syntax from it.
Clear Skies,

Jim
--"Do or do not.  There is no Try" --Jedi Master Yoda

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Getting Started?
« Reply #3 on: 2010 June 10 13:44:39 »
Java isn't quite javascript so watch out :)
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 Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: Getting Started?
« Reply #4 on: 2010 June 10 13:51:55 »
Hi Jim,

I am from a very similar background to you - although I certainly find it VERY difficult to start 'from the beginning', and certainly not 'from a book'.

So, when I wanted to see what I could do in PJSR - out of a need that nobody else could be bothered to resolve (i.e. deBayering CMYG images from a DSI Colour camera), I started with code written by others - all of whom were far more skillful than I.

The result, after months of hard graft, was my Batch deBayer script, now included as part of the 'standard distribution' - thanks to Juan.

Now, the only reason that I am mentioning it is that I spent a LOT of effort trying to comment the ENTIRE script - mostly for my own benefit, as I learned each new step. But I also realised that, with Juan's intention to include it in the standard distribution, the effort into adding these comments might be helpful to others.

So, please, feel free to start with my script (and the efforts of others) - and rip it into manageable chunks to suit your needs.

Don't ask 'me' too many questions though - it has been a year since I last looked at the code in detail, and I probably have a LOT of re-learning to do already :'(

Good luck - and have fun!

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline varmint

  • Newcomer
  • Posts: 35
    • Varmint's Astrophoto's
Re: Getting Started?
« Reply #5 on: 2010 June 10 14:31:08 »
Java isn't quite javascript so watch out :)

Thanks for that.  I did wonder based on some conversations with my IT fellows at work who live in Java and Javascript land (but are too busy to throw me a bone...go figure).
Clear Skies,

Jim
--"Do or do not.  There is no Try" --Jedi Master Yoda

Offline varmint

  • Newcomer
  • Posts: 35
    • Varmint's Astrophoto's
Re: Getting Started?
« Reply #6 on: 2010 June 10 14:33:48 »
So, please, feel free to start with my script (and the efforts of others) - and rip it into manageable chunks to suit your needs.

Don't ask 'me' too many questions though - it has been a year since I last looked at the code in detail, and I probably have a LOT of re-learning to do already :'(

Good luck - and have fun!

Cheers,

Niall, thanks for your offer.  I was planning on dissecting some of the current scripts to learn and understand the nuances.  Code Comments are quite valuable as well (I can tend to go overboard on comments sometimes), so thanks for letting me know about a target to start with.  And I'll ask the forum and not pester individuals much (if I can avoid it).  :angel:
Clear Skies,

Jim
--"Do or do not.  There is no Try" --Jedi Master Yoda

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Getting Started?
« Reply #7 on: 2010 June 10 14:34:29 »
I should add that since javascript is very popular for all kinds of web stuff there should be no shortage of online tutorials.
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 Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: Getting Started?
« Reply #8 on: 2010 June 10 14:55:57 »
Code: [Select]
And I'll ask the forum and not pester individuals much
In fact, the Forum is always your 'best' arena for posing questions - that way you can reach a FAR larger audience, and you might be surprised just how quickly a reply comes back!

Have fun,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline varmint

  • Newcomer
  • Posts: 35
    • Varmint's Astrophoto's
Re: Getting Started?
« Reply #9 on: 2010 June 15 19:40:40 »

The result, after months of hard graft, was my Batch deBayer script, now included as part of the 'standard distribution' - thanks to Juan.

Now, the only reason that I am mentioning it is that I spent a LOT of effort trying to comment the ENTIRE script - mostly for my own benefit, as I learned each new step. But I also realised that, with Juan's intention to include it in the standard distribution, the effort into adding these comments might be helpful to others.

So, please, feel free to start with my script

I decided to give it a whirl tonight and take a look at some scripts, but I can't seem to find the Batch Debayer script in the list of scripts.  I was using the Edit Scripts function off of the pulldown and it defaults to the PCL\include\pjsr folder but none include debayer...

Also, I only have PixInsight Core installed, should I also install the PCL?  Sorry if this question is daft...I'm not used to doing this yet.
Clear Skies,

Jim
--"Do or do not.  There is no Try" --Jedi Master Yoda

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
Re: Getting Started?
« Reply #10 on: 2010 June 15 20:18:33 »
I can't seem to find the Batch Debayer script in the list of scripts.  I was using the Edit Scripts function off of the pulldown and it defaults to the PCL\include\pjsr folder but none include debayer...
Read :PixInsight Forum > General > Announcements | Anuncios > PixInsight 1.6.0 Released  ;)

Quote
Also, I only have PixInsight Core installed, should I also install the PCL? 
Use PCL version if you like to see the source code of some PCL module. For scripting it's not important.

Offline varmint

  • Newcomer
  • Posts: 35
    • Varmint's Astrophoto's
Re: Getting Started?
« Reply #11 on: 2010 June 16 18:03:44 »
Read :PixInsight Forum > General > Announcements | Anuncios > PixInsight 1.6.0 Released  ;)


Thanks, I guess this refers to Juan's comments about not including the Debayer script?  I find that a little odd as I have it in the Core application under Scripts\Utilities\BatchDebayer, but I can't find the source code using the "Edit Script" function.

Does this mean that the BatchDebayer script is embedded into the Core application, but the source code/files are not available yet?
Clear Skies,

Jim
--"Do or do not.  There is no Try" --Jedi Master Yoda

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: Getting Started?
« Reply #12 on: 2010 June 16 23:50:54 »
Hi Jim,

Assuming that you have installed to the 'default' PixInsight directory (and assuming Windoze as well), then the path to the CMYG Batch deBayer script should be as follows:-

C:\PCL\src\scripts
or
C:\PCL64\src\scripts
(if you have installed a 64-bit version)

I seem to have 23 script files in that directory, not including extras that I have been downloading and testing (for example the excellent Animator scripts from Nikolay)

My particular script is called <CMYG Batch deBayer v1_16.js> and is 149KB (huge, simply because of the extensive inclusion of comments throughout the script).

If you still do not have this, or cannot find it, then drop me a line and I will email it to you directly.

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline varmint

  • Newcomer
  • Posts: 35
    • Varmint's Astrophoto's
Re: Getting Started?
« Reply #13 on: 2010 June 17 00:16:48 »
Thanks Niall, I found it.

Too tired to get started tonight, but sometime this weekend.
Clear Skies,

Jim
--"Do or do not.  There is no Try" --Jedi Master Yoda

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: Getting Started?
« Reply #14 on: 2010 June 17 03:19:42 »
Hi Jim,

Have fun :D
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC