Skip to main content

Extended interactive R-script with GUI to plot VStar models

12 posts / 0 new
Last post
mpyat2
mpyat2's picture
Extended interactive R-script with GUI to plot VStar models

Hi,

I’ve made an extended version of “plot_model.R” script (supplemental VStar script for visualization light curve models: it is provided as an addendum to VStar https://sourceforge.net/p/vstar/code/HEAD/tree/trunk/script/plot_model.R).

The original script is somewhat inconvenient because plotting a model requires modification of a text of the script.

My extended version has a graphical interface and allows one to select data, model and model equation(s) interactively (a model equation can be simply pasted from clipboard to a text field and plotted).

A screenshot of the script in action is attached.

The script and documentation can be downloaded here: https://drive.google.com/open?id=1Q0F5g1QaOINK_45CYAMoZ3WME3EyUYkI

Best regards,

Max (PMAK)

 

File Upload: 
David Benn
David Benn's picture
Nice!

Hi Max

Nice! Thanks.

The example R script I wrote was meant to be fairly bare-bones, just to give people the idea of what's necessary.

I like what you've done. One thing I had to remember when I ran it was that because the app was being run under X11 on my Mac, the R model equation had to be pasted with ctrl-V (rather than the usual command-V). So, one suggestion woukd be to add a load R model equation button rather than relying upon copy and paste. 

David

mpyat2
mpyat2's picture
"Equation from file" button.

Hi David,

Thank you for the response!

I've added "Equation from file" button (see attached picture) so it is possible now to load R expression from a text file. An update is in a VStarPlotter_v002.zip (https://drive.google.com/open?id=1Q0F5g1QaOINK_45CYAMoZ3WME3EyUYkI)

Regards,

Max

File upload: 
David Benn
David Benn's picture
Excellent

Hi Max

That's an excellent addition, making it a really useful tool. Thanks! This would be a good addition to the AAVSO software directory page IMHO.

David

mpyat2
mpyat2's picture
The script

Hi David,

Thank you for comments!

Would you like to include it into VStar project tree?

Best regards,

Max

P.S. I'm working on improved version which will be able to save/load "workspaces" (a workspace includes a light curve, a model and  model equation(s) to keep things together) and, probably, additional plotting options to tune the plot.

David Benn
David Benn's picture
Happy to do so

Hi Max

Happy to include it in the source code repository or allow you to maintain it and include it separately.

That improved version sounds great too.

David

mpyat2
mpyat2's picture
Repository

Hi David,

I will create SourceForge entry for VStarPlotter. Then a link can be placed in https://www.aavso.org/software-directory, am I right?

Best regards,

Max

David Benn
David Benn's picture
Repo

Hi Max

That seems fine to me. I would suggest GitHub vs SourceForge for anything new though. VStar still uses SF but may eventually move. It's purely historical.

I'm sure AAVSO would be happy to add a link to the software directory page but I'll leave it to Sara or Bert to weigh in on this.

David

BSJ
BSJ's picture
Software Directory page

Hi Max,

I would be happy to add a link to your code to the AAVSO's Software Directory page. Would you please also send me a brief description of what it is - just one or two sentences as with the other apps.

Many thanks!
Sara

mpyat2
mpyat2's picture
Hi Sara,

Hi Sara,

Hi David,

I will try to make GitHub repository for VStarPlotter soon and send the link.

"What it is": it is a supplementary program for VStar which plots light curve/Vstar model/Vstar model equations (Vstar generates an equation for a model as "R" language expression) in interactive mode.

Best regards,

Max

mpyat2
mpyat2's picture
VStar Model Plot

Hi Sara,

Hi David,

The project "VStar Model Plot" is on GitHub now: https://github.com/mpyat2/VStarModelPlot

I defined it as "A supplementary tool for VStar astronomical software to plot model equations"

So the link now could be placed on https://www.aavso.org/software-directory page (if you don't mind)

Now it is possible to save a "workspace", containing data, model, and model equations into one file to restore later. Also, a rudimental "Plot options" dialog was introduced; now it allows one to define plot's header and redefine axes' titles.

Best regards,

Max

mpyat2
mpyat2's picture
"VStar Model Plot" update

Update of "VStar Model Plot" is available. A GUI is now used "tcltk" R-library directly, without intermediate "gWidgets" layer so no additional libraries are required (works on basic R installation).

This also radically shortened startup time on some systems.

The program was tested under Windows and Linux (Debian), I have no opportunity to try MaxOS R installation.

Can be downloaded from here: https://github.com/mpyat2/VStarModelPlot (use "Clone and Download"/"Download ZIP").

For more info see

https://github.com/mpyat2/VStarModelPlot/blob/master/doc/VStarModelPlotDescription.pdf

 

Log in to post comments
AAVSO 49 Bay State Rd. Cambridge, MA 02138 aavso@aavso.org 617-354-0484