Contents 

Mira Pro x64
Contents
New Features
Getting Application Help
About this Document
Tech Support
Getting Started
Glossary of Terms
Selecting Source Images
Setting Application Properties
Command Dialogs
Screen Capture
Mira's Special Folders
Changing the GUI Theme
Critical Concepts
Tip of the Day
Tutorials
Overview
Displaying an Image
Displaying an Image Set
Creating Plots from Images
Introduction to Image Registration
Making a Scatter Plot of Measurements
Using FITS Keywords to Analyze Image Data
Introduction to Aperture Photometry
Doing Time Series Photometry
Introduction to File Event Scripting
Cleaning Artifacts from an Image Set
Introduction to Source Extraction
Introduction to Astrometric Calibration
Examples
File Lists
Creating File Lists
Opening Files from File Lists
Images
The Boost Transfer Function Option
Image Rotation
Adding Labels to an Image
Editing the FITS Header
Image Registration
Plots
Plot Windows
Plotting Examples
Plotting an Averaged Line
Row Plots
Adding Series to a Line Profile Plot
Changing Plot Series Attributes
Plotting in World Coordinates
Comparison of Histogram Preferences
Contour Plotting Smoothing
3-D Plots
3-D Pixel Representations
3-D Z-Scaling
Measurements
Distance and Angle
Selecting Cells in a Grid Control
Tutorial: Making a Scatter Plot of Measurements
Fixing Header Problems in Photometric Data
Importing a Photometry Catalog
Image Basics
Image Types
Image Sets
Overview
Image Set Flags
Image Set Properties
Image Set Toolbar
Image Set Applications
Image Sets Menu
Duplicating an Image Set
File Lists
Overview
Creating file lists
Editing file lists
Opening files from file lists
Opening Images
Overview
File opening and saving commands
Using Drag & Drop
Opening image files
Creating an image catalog
Duplicating an Image
Duplicating an Image Set
Opening files from file Lists
Using File Opening Plug-ins
Selecting Source Images
Importing a Binary Image
Importing a Text Image
Saving Images
Saving a single image
Saving an image set
Saving all image set members
Saving an image set to a Folder
Saving an image set with a filename Suffix
Saving an image set to a file list
Exporting as a binary image
Exporting as a text image
Palettes
Overview
Image Palettes
Palette Pane
Palette Properties
Using the Palette Property Trackbars
Rubber Banding the Palette Graph
Importing Palettes
Transfer Functions
Overview
Choosing Transfer Function Properties
Using the Boost Transfer Function Option
Default Transfer Function Properties
Transfer Function Pane
Transfer Function Popup Menus
Image Cursor
Overview
Image Cursor Properties
Setting default and local properties
Image Window Properties
Image Plot Properties
Histogram Properties
Centroid Properties
FWHM Preferences
Radial Profile Properties
Palette Properties
Transfer Function Properties
General Properties
Selecting source images for commands
Overview
Image Display
Image Windows
Image Bar
Animation Bar
User Interface
User Interface Overview
Working with Toolbars
Initializing Toolbars and Docking Panes
Docking Panes
Command Dialogs
Command Toolbars
Main Message Pane
Image Cursor Toolbar
Image Keys Pane
Status Bar
Accelerator Keys
Profile Control
Status Bar
Save Window Position
GUI Theme
Changing the GUI theme
Context Menus
Image Context Menu
Image Context Menu for an image set
Plot Context Menu
3-D Plot Context Menu
Grid Context Menu
Dialog Styles
Command Dialogs
Dialog Buttons
Docking Panes
Overview of Docking Panes
Docking Panes Toolbar
Image Bar
Animation Bar
Image Keys Pane
Measurement Panes
Initializing Toolbars and Docking Panes
Property Profiles for Commands
Overview
Profile Control
Grid Controls
Overview
Report Windows
Grid Context Menu
Measurement Panes
Table Properties
Overview
Table Appearance Properties
Table Printing Properties
Menus
Tear-off menus
Main Context Menu
Default Menu Bar
Align Images Menu
Pictures of Menus
Creating new text documents
Default File Menu
Calibration Menu
Diagnostics menu
Edit Menu
File Menu
Measure Menu
Mira Windows
Image Windows
Plot Windows
Grid Controls
Image
Overview
Animation Pane
Image Bar
Image Set Toolbar
Image Window Keystroke Commands
Image Keys Pane
Adjusting the Image Cursor
Command Modes
Cursor Command Modes
Roam Mode
Cursor Mode
Plot
Overview
Plotting Images and Data
Creating a Plot from Table Data
Plotting Examples
Plot Bar
Plot Animation Bar
Plot Properties
Plot Series Properties
Plot Marker Properties
Image Plot Properties
Save Window Position
Chart
Chart Windows
Plotting Images and Data
Creating a Chart from Table Data
Chart Command Menu
Chart Axis Limits
Chart Properties Pane
Chart Series Properties
Chart Titles
Chart Legend Properties
Save Window Position
3-D Plot
Overview
3-D Animation Toolbar
3-D Rotation Toolbar
3-D Drawing Attributes
3-D Light Source Dialog
3-D Viewpoint Dialog
3-D Window Dialog
Save Window Position
File Open
Open Command
Opening & Saving Files
Opening Files from File Lists
Report
Overview
Grid Controls
Report Commands
Report Window Menu
Save Window Position
Grid Properties
Overview
Table Appearance Properties
Table Printing Properties
Text Editor
Overview
Creating a new text document
Text Editor Edit Menu
Text Editor View Menu
Save Window Position
Script Editor Window
Script Editor Toolbar
Script Editor Context Menu
Script Editor View Menu
Save Window Position
Plug-ins
File Opening Plug-ins
Image Processing Plug-ins
Toolbars
Working with Toolbars
Command Toolbars
Image Keys Pane
3-D Animation Toolbar
3-D Rotation Toolbar
Cursor Tools Toolbar
Image Cursor Toolbar
Image Plot Toolbar
Image Set Toolbar
Image Tools Toolbar
Image Bar
Calibration Tools Toolbar
Interactive Repair Toolbar
Main Toolbar
Measurements Toolbar
Working with FITS Format
Overview
FITS Format Definition
FITS keywords
FITS Header Editor
FITS Header Pane
FITS image orientation
List COMMENT Keywords
List HISTORY Keywords
List Statistics Keywords
List WCS keywords
MIRAPROC keyword
Editing the FITS header
Modifying keywords
Adding metadata at file open or file save
Creating an image list from keywords
Searching images for keyword values
Viewing the FITS File Header
Fixing Header Problems in Photometric Data
Image Information Editor (RGB images)
Coordinate Systems
Overview
Image Coordinate System
Pixel Coordinate Definition
Subpixel Coordinate Definition
World Coordinate System
Image Display Orientation
FITS Image Orientation
Image Coordinate Display
Coordinate Commands
Go to cursor coordinates
Go To Object
Astrometric Calibration
Set an arcsecond scale
Set an equatorial scale
Set a linear scale
Set independent linear scales
Set linear world coordinate units
Setting brightness units
Alignment Commands
High precision image registration
Align on Object
Align on Point
Align by WCS
Coordinate Readout
Set X-Axis Linear Format
Set Y-Axis Linear Format
Set Pixel Value Format
Select Image Properties
World Coordinate System
Overview
World Coordinate System Keywords
Deleting the WCS
Astrometric Calibration
Overview
Tutorial
Entering coordinate data
Changing reference point data
Calibration Preferences dialog
Plate Solution Strategy
Other preferences
Measuring Images
Overview
Measurement Panes
Image Measurements Toolbar
Image Cursor Toolbar
Image Keys Pane
Moving the image cursor to a coordinate
Setting Application Properties
Testing using synthetic images
Setting statistical estimator properties
Opening a table in Microsoft Excel
Tutorial: Working with Measurements in a Grid
Angle Measurements
Command overview
Marker properties
Aperture Photometry
Overview of aperture photometry
Apphot Pane for photometry results
Tutorial: Introduction to Aperture Photometry
Tutorial: Doing Time Series Photometry
How Magnitude and Errors are calculated
Editing target data and standard star data
Automatic detection of objects
Plotting a light curve
Kwee - van Woerden
Setting marker attributes
Preparing a report for the AAVSO
Setting the aperture size and shape
Setting photometry keywords
Fixing header problems in photometric data
Importing a photometry catalog
Calculate Julian Date
Definitions of measurements
Definitions of errors
Understanding signal to noise ratio
Aperture Photometry Toolbar
Aperture Photometry Properties
Aperture Photometry Properties dialog
Point Markers
Calibration Results
Image Information
Photometry Keywords
AAVSO Reporting
Other Properties
Measurement Output
Astrometric Calibration
Overview
Tutorial
Plate Solution Strategy
Centroid Measurements
Command overview
Centroid properties
Distance & Angle Measurements
Command overview
Measuring Distance and Angle
Example
Angle Measurement Definition
FWHM Measurements
Command overview
FWHM properties
PSF Fit Properties
Labeling Images
Overview
Label Properties
Examples
Line Measurements
Command overview
Marker properties
Plot Line Measurements
Command overview
Marker Properties
Plot Point Measurements
Plot Point Measurements
Marker Properties
Shape Properties
Point Measurements
Command overview
Marker properties
Region Measurements
Command overview
Marker properties
Region properties
Statistics Measurements
Command overview
Statistics Measurements
Statistics properties
List Statistics Keywords
Remove Statistics Keywords
Marker Properties
Overview
Drawing Properties
Centroid Properties
Region Properties
Copying & Pasting Markers
Copy Markers
Paste Markers
Scatter Plots
Scatter Plot command
Tutorial: Making a Scatter Plot of Measurements
Selecting Cells in a Grid Control
Point Sampling
Overview
Pixel Table Pane
Viewing and editing pixel values
Report Windows
Overview
Grid Controls
Grid Context Menu
Optimizing the column width
Opening a table in Excel
Table Properties
Table Printing Properties
Table Appearance Properties
Plotting Images and Data
Overview
Plot Bar Pane
Creating a Chart from Table Data
Creating a Plot from Table Data
Examples of plot types
Examples of row plots
Setting Application Properties
Horizontal Slice Plot
Vertical Slice Plot
Plot Windows
Overview
Creating a Plot from Table Data
Plot Bar
Plot Animation Bar
Plot Keys Pane
Plot Context Menu
Set X-Axis Format
Set Y-Axis Format
Plot Series Data
Plot Measurements
Go to Source Image
Plot Averaging Modes
Saving a plot as a text file
Save Window Position
Window Properties
Plot Properties
Plot Series Properties
Chart Windows
Chart Windows
Creating a Chart from Table Data
Chart Command Menu
Chart Axis Limits
Chart Properties Pane
Chart Series Properties
Chart Titles
Chart Legend Properties
Save Window Position
Working with Plot Series
Changing Plot Series Attributes
Overplotting & Animating
Go to Source Image
Copying & pasting plot series
Adding series to a line profile plot
Plot Default Marker Properties
Setting marker attributes before the plot
Default Series Properties
Plot Series Properties
Plot Series Data
Column and Row Profile Plots
Column profile plots
Making a column profile plot
Row profile plots
Making a row profile plot
Plotting an averaged line
Overview
Plot Averaging Modes
Changing the Plot Appearance
Changing Plot Attributes
The Plot Attributes dialog
Using a dialog shortcut
X Axis Properties
Y Axis Properties
Plot Labels
Frame Properties
Selecting a Coordinate System
Plot coordinate systems
Using World Coordinates
Comparison of coordinate systems
Line profile plots
Command
Creating a Line Profile plot
Adding series along different lines
Adding parallel series
Preferences
Setting Line Profile preferences
Centroid Preferences
Marker Properties
Radial profile plots
Making a radial profile plot
Radial Profile Properties
PSF Fit Properties
Histogram plots
Making a Histogram plot
Histogram Properties
Comparison of Histogram Preferences
Making a Bit Histogram plot
Plot Measurements
Overview
Plot Point Measurements
Plot Line Measurements
Statistics Measurements
Statistics Properties
Mark Statistic
Plot Marker Properties
Plot Notes Pane
Scatter plots
Scatter Plot command
Tutorial: Making a Scatter Plot of Measurements
Selecting Cells in a Grid Control
Pixel Series plots
Plotting a value through an image set
3-D plots
3-D Surface Plot command
3-D Plot Type Examples
3-D Z-Scaling Examples
Preferences
3-D Viewpoint
3-D Window Dialog
3-D Drawing Attributes
3-D Light Source
Surface Plot Z Limits
Contour plots
Contour Plot command
Contour Plot Properties
Contour Drawing Properties
Interactive Contour Plot command
Interactive Contour Properties
Contour Plot Smoothing
Copy & Paste
Example
Copying plot data to the clipboard
Pasting plots from the clipboard
Copying the window bitmap
Printing Plots
Overview
Properties
Overview
Printing Placement Properties
Printing Overlay Properties
Printing Heading Properties
Printing Text Properties
Calibrating Images
Selecting Source Images
Overview
Creating synthetic images
Trimming an image section
Adding metadata at File Open or Save
Modifying header keywords
Creating a Pixel Mask
Applying a Pixel Mask
Image Combining Strategy
Editing and Creating a Blemish Mask
Applying a Blemish Mask
File Event Scripting
Astrometric Calibration
Express Image Calibration
Express Image Calibration
Bias Correction Properties
Dark Correction Properties
Flat Correction Properties
Cosmetic Correction Properties
Creating a Master Bias
Create Master Bias
Image Combining Strategy
Creating a Master Dark
Create Master Dark
Image Combining Strategy
Create Master Flat
Create Master Flat
Flat Frame Selection Criteria
Image Combining Strategy
Create Illumination Flat
Create Illumination Flat
Flat Correction Properties
Image Combining Strategy
Create Pixel Flat
Create Pixel Flat
Flat Correction Properties
Image Combining Strategy
Repairing Artefacts and Cosmetic Defects
Overview of Methods
Cleaning artefacts from an image set
Interactively Repairing Defects
Evaluating repair techniques using synthetic images
Blemish Masks
Creating and editing a blemish mask
Applying a Blemish Mask
Pixel Masks
Creating a Pixel Mask
Editing a Pixel Mask
Applying a Pixel Mask
Removing Stars from Images
Overview
Changing the aperture properties
Viewing data for template samples
Properties
Overview
Point Properties
Other Properties
Processing Images
Overview
Command Dialogs
Selecting Source Images
Image Types
Image Region Commands
Testing calibration strategies using synthetic images
Image Keys Pane
File Event Scripting
Adding metadata at File Open or Save
Creating an image list from keywords
Searching images for keyword values
Cosmetic Repairs
Interactive Repair
Interactive Repair Properties
Removing cosmic rays from an image set
Blemish Masks
Creating and editing a blemish mask
Applying a blemish mask
Pixel Masks
Creating a pixel mask from an image
Editing a pixel mask
Applying a pixel mask
Removing Stars from Images
Overview
Changing the aperture properties
Viewing data for template samples
Properties
Overview
Markers
Background
Sample Data
Combining Images
Combine Image Set
Combine Files
Image combining methods
Setting normalization preferences
Region Statistics
Aligning Images
Overview
Aligning on a point
Aligning on an extended object
Aligning using the WCS calibration
High Precision Registration command
Overview
Tutorial: Introduction to Image Registration
Example using Point Tracking
Image Registration Properties
Image Registration Properties Dialog
Resampling
Background
Image Registration Residuals
Marker Properties
Resampling Properties
Tracking Properties
Image Region Statistics
Overview
Estimators
Editing & Copying
Overview
Duplicating to a new window
Emptying the Clipboard
Math Commands
Overview
Arithmetic Operations
Change Pixel Type
Combine Image Set
Fit Background
Image Arithmetic
Normalize Image
Region Statistics
Value Arithmetic
Using Plug-ins
Geometry Commands
Overview
Rotating Images
Rotation Menu
Affine Transformation
Expand Image
Imbed Image
Mirror
Reverse
Rotate
Rotate by angle (from Image Toolbar)
Scale
Shift
Transpose
Cropping to specified bounds
Cropping to the Image Cursor
Cropping by a rectangle
Align Horizontal
Align Vertical
Commands for RGB data
Working with RGB Images
Applying a palette to the pixels
Converting to RGB
Converting to Grayscale
Converting to 16 bit Luminance
Converting to 8 bit Luminance
Removing color noise
Extracting channels
Making an LRGB Image
Making an RGB Image
Commands for Intensity data
Extracting byte planes
Converting the data type
Converting to RGB
Undo
Using undo
Filtering Images
Overview
Removing Extreme Pixel Values
Cosmic Ray Filter
De-speckle Filter command
Clip High Values
Clip Low Values
Rank Filtering
Rank Filter
Median Filter
Minimum Filter
Maximum Filter
Smoothing Image Details
Rectangle Filter
Elliptical Filter
Binomial Filter
Gaussian Filter
Block Average Filter
Block Sum Filter
Sharpening Image Details
High Pass Filter
Unsharp Mask
Maximum Entropy command
Maximum Entropy example
Enhancing Edges
Gradient Filter
Rotational Gradient Filter
Rotational Gradient example
Laplacian Filter
Miscellaneous Kernel Filters
Custom Filter Kernel
3x3 Custom Filter command
Extracting Sources from Images
Using the MExtract Module
Definitions of Extracted Properties
Running the Pipeline
Tutorial
Preferences
Properties for the Source Extraction Tutorial
Source Extraction dialog
Procedure page
Background page
Detect page
Filter page
Match page
Difference page
Post Process page
Post Processing Options
Centroid Properties (Source Extraction)
FWHM Properties (Source Extraction)
PSF Fit Properties
Aperture Photometry Properties
Variability Properties
Image Diagnostics and Calculations
Overview
Create Synthetic Image
Bit Histogram Plot
Calculate Airmass
Calculate Gain
Calculate Image Scale
Calculate Julian Date
Calculate Readout Noise
Using the Pro Script Module
Working with scripts
Using the Script Editor Window
Using the Script Manager
Editing script keywords
Save Window Position
Related Topics
Script Editor Toolbar
Script Editor View Menu
Script Editor Context Menu
File Event Scripting
File Event Scripting
Tutorial: Introduction to File Event Scripting

Mira Pro x64 User's Guide

Prev Page Next Page

Tutorial: Using FITS Keywords to Analyze Image Data


The Mira User Interface provides powerful tools to analyze image properties using quantities stored in FITS header keywords. This tutorial shows how to combine some of the user interface tools to accomplish some high-level data analysis. Of course, nearly any kind of analysis may be accomplished using a script. For example, you may wish to evaluate the stability in the sky transparency by graphing the sky (background) brightness versus time for a series of images. Doing this requires a series of images spanning the time of interest plus calculation of two quantities: the background brightness and some measure of time. Both of these quantities are calculated for each image and saved to their FITS headers. These data are then extracted from the headers and graphed. This tutorial covers the procedure to produce such a graph via user interface commands and also provides an equivalent script.

User Interface Procedure

1. Open a set of "science" (not calibration) images spanning the time period of interest. Select the "Hyakutake*.fts" images from the "<Documents>/Mira Pro x64 Data/Sample Images" folder images and open them as an Image Set in a single Image Window as shown below. Move the Image Cursor off the image center onto an area of sky. Since we will be using the sigma-clipped mean estimator, the cursor does not have to be devoid of stars.

 

2. For the time value (X Axis), ensure that the Julian Date exists in each image header.

  • If Julian Date already exists in all image headers, skip to the next section regarding the brightness estimator.

  • If Julian Date is not present, use the DATE-OBS keyword to calculate it using the menu command Process > Utilities > Calculate Julian Date to calculate it from DATE-OBS. The Julian Date will be stored in all image headers. If adding the Julian Date to the images, MJD is recommended because it gives the shortest number. The picture below shows the Heliocentric Julian Date ("HJD") selected. If using JD or MJD, the Right Ascension and Declination are not required from the image headers.

3. For the background brightness estimator (Y Axis), ensure that a background estimate exists in each image header.

  • The statistics will appear in a grid window belonging to the Image Window.

4. Open the the Create Image Keyword List dialog using the File > Create Image Keyword List command.

  • In the Create Image Keyword List dialog, selectLoad from Image and click [Load Keywords].

  • Scroll the left-hand list to find MJD (or another Julian Date value) and use [>] to move it to the right-hand list.

  • Scroll the left-hand list to find S_SCMEAN and move it to the right-hand list.

  • Scroll the left-hand list to find S_SDEV and move it to the right-hand list.

  • Also move any other keywords you wish to list in the catalog.

  • Click [Process] to create a Report Window containing a catalog of all keywords from the right-hand list.

5. The Image Keyword Catalog opened in Step 4 appears below. Note the column headings.

  • Right click inside the Image Keyword Catalog to open its menu as shown below. Then select Create Plot from Grid from the menu.

 

6. The Create Plot from Grid command opens the dialog shown below. THis dialog will procude the scatter plot.

  • Select the variable MJD (or other Julian Date value) for the X Axis.

  • Select the variable S_SCMEAN (sigma-clipped mean) for the Y Axis.

  • For the Y Axis, check Show Error Bars and selectS_SDEC from the list.

  • In the Image Keyword Catalog window, right-click to open its menu. Select the plotting command you want to use: Create Chart from Grid or Create Plot from Grid. You might also wish to simply use Open Table in Excel and do further analysis there.

  • Select the grid columns to plot. In this example, the X-Axis variable will be JD and theY-Axis variable will be S_SCMEAN.

7. Click [Plot] to create the scatter plot of S_SCMEAN vsMJD with M_SDEV as the Y Axis error bars:

8. Compute the mean value of the 6 S_SCMEAN values and mark it on the plot:

  • With the Plot Window on top, use the Statistics > Statistics Properties command to open the Statistics Properties dialog. You may also execute this command using the Properties command from the drop menu of the button on the main Measurements Toolbar.

  • From the statistical estimators, select Mean.

  • With the Plot Window on top, compute the mean statistic for the plot series. This calculates the average sky brightness for the 6 images in the plot series. There are 3 ways to do this: 1) Use the Measure > Statistics command from the Plot Window menu, 2) click the button on the main Measurements Toolbar, or 3) use the 's' keystroke (see Plot Window Keystroke Commands).

  • The statistics will appear in a grid window belonging to the Image Window.

9. Mark the mean of the estimators for all 6 images on the plot:

  • In the Statistics pane at the bottom of the Plot Window, right-click on the line containing the estimator to draw in the Plot Window. This opens the grid popup menu.

  • In the popup menu, select Mark Statistic. The estimator name and value are marked on the plot with a line indicating the value.

Script Procedure

A script can be written to perform the processing shown above, then launched from the Image Window displaying the Image Set. The script below, named "Image Statistics versus JD Plot.lua", is included in the "<Documents>\Mira Pro x64 Data\Sample Scripts" folder. Only 17 lines of code are needed to do the script's work, and the rest involves comments and "bullet proofing" to check the input data and trap errors. Following the script listing is a screenshot showing the resulting graph. The result is identical to the graph produced with the user interface procedure. Although this script does not save the 3 calculated quantities to the image headers, 3 more lines of code would be needed to do that.

-- /////////////////////////////////////////////////////

-- This script creates a scatter plot of mean sky brightness versus time for an image set.

-- Time (x-axis) uses the Modified Julian Date calculated from the UT date and time of the observation.

-- The mean sky brightness (y-axis) uses the sigma-clipped mean over a rectangle containing few stars.

 

-- When a script is executed from a Mira Image Window, two values are passed to the script:

-- 1) ParentImageView is a CImageView class object for the Image Window.

-- 2) ParentImage is a CImage class object for the current top-most image in the Image Window.

 

-- To run the script:

-- 1) Open an image set into an Image Window

-- 2) Right click on the image to open the menu and select "Execute Script"

-- 3) Navigate to the sample scripts and click [Open] to run the script.

 

-- ////////////////// Script processing starts here

 

-- Check that ParentImageView is a valid image window sent to the script:

if ParentImageView == nil or ParentImageView.class ~= "CImageView" then      

     Exit("The Image window is not valid\n")

end

 

-- Attach the CImageSet from the CImageView object

ImageSet = ParentImageView:GetImageSet()

if ImageSet == nil or ImageSet:Count() < 1 then

     Exit("Cannot attach the window's image set\n")

end

 

-- Create 3 tables to hold values for x, y, and y error bars.

-- Since these are tables of numbers, a good habit is prefixing their names with "n"

nMJD = {}

nMean = {}

nSdev = {}

 

-- Create a statistics object:

S = new_stats()

 

-- Create a rectangle object:

R = new_rect(600,655,400,455)

 

nDone = 0      -- counter for the number of images processed

 

-- Loop over the images. The value of ImageSet:Count() is the number of images

for n = 1, ImageSet:Count() do

 

     -- Get the next image from the image set

     I = ImageSet:GetImage(n)      -- returns a CImage object

     if I == nil then

           Printf("Image [%d] is invalid\n", n)

           goto NEXT_IMAGE

     end

 

     -- Get the value of the DATE-OBS keyword from the image header

     strDate = I:DateStr("DATE-OBS")

     if strDate == nil then

           Printf("DATE-OBS keyword not in '%s'\n", I:Path())

           goto NEXT_IMAGE

     end

 

     -- Get the value of the TIME-OBS keyword from the image header

     strTime = I:TimeStr("TIME-OBS")

     if strTime == nil then

           Printf("TIME-OBS (=DATE-OBS) keyword not in '%s'\n", I:Path())

           goto NEXT_IMAGE

     end

 

     -- After passing the keyword tests, list the image in a text window.

     -- List the full path abbreviated to no more than 60 characters

     Printf("Adding image '%s'\n", I:Path(60))

 

     -- Calculate the Julian Date the strDate and strTime strings

     nJD = CalcJD( strDate, strTime )

     -- Convert JD to MJD to reduce the length of x axis labels

     nMJD[nDone] = CalcMJD(nJD)

 

     -- Increment the counter for images processed

     nDone = nDone + 1

 

     -- Calculate the mean and standard deviation and save to nMean and nSdev

     nMean[nDone], nSdev[nDone] = S:SigmaClipMeanSdev(I,3,3,5,R)

 

     ::NEXT_IMAGE::

end

 

-- Make a scatter plot from the 3 tables:

-- x axis = nMean

-- x axis error bars: there are none, so enter nil in their place

-- y axis = nMJD

-- y axis error bars = +/- nSdev

-- Use "MJD" and "S_SCMEAN" as the x-axis and y-axis labels

-- Note: only the first two parameters are required to create a plot

scattererr( nMJD, nMean, nil, nSdev, "MJD", "S_SCMEAN", "Scatter plot of S_SCMEAN vs MJD")

-- end of the script

 

Here is the basic script without comment lines or error checking:

ImageSet = ParentImageView:GetImageSet() -- get the image set from the image window

nMJD = {}

nMean = {}

nSdev = {}

S = new_stats() -- Create a statistics object

R = new_rect(600,655,400,455) -- Create a rectangle object

nDone = 0      -- counter for the number of images processed

for n = 1, ImageSet:Count() do -- Loop over the images.

     I = ImageSet:GetImage(n)      -- returns a CImage object

     strDate = I:DateStr("DATE-OBS") -- get the date string

     strTime = I:TimeStr("TIME-OBS") -- get the time string

     nJD = CalcJD( strDate, strTime ) -- calculate the Julian Date

     nMJD[nDone] = CalcMJD(nJD) -- convert to Modified Julian Date

     nDone = nDone + 1 -- increment the counter

     nMean[nDone], nSdev[nDone] = S:SigmaClipMeanSdev(I,3,3,5,R) -- calculate mean and sdev

end

scattererr( nMJD, nMean, nil, nSdev, "MJD", "S_SCMEAN", "Scatter plot of S_SCMEAN vs MJD")

 

Related Topics

Tutorials

Statistics Measurements

Statistics Properties

Calculate Julian Date

Create Image Keyword List

Create Plot from Grid


Mira Pro x64 User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.