Skip to main content

streamPy

To create a stream model you need the following files:

  • the IMAGE file
  • a MASK of all neabry, and overlapping sources
  • if other stars or galaxies contaminate the stream's central region, create an additional INTERPOLATION MASK for sources to interpolate over

All have to be the same size, otherwise an error is raised. RGB .TIF, .jpg or .png does not work, they need to be in gray scale .fits format. The IMAGE header must contain the following keys:

  • 'FILTER' : char, the band in which the image was taken.
  • 'PSF' : float, the mean FWHM of the sources across the image in arc seconds. If there is no interest in the true intrinsic shape parameters of the stream set it to 1.
  • 'PXSCALE' : float, the pixel scale of the image in arc seconds/pixel.
  • 'ZP' : float, the photometric zero point.

Walkthrough

First import all necessary classes and methods and define the files as variables.

from astrostreampy.Image.stream import Stream
from astrostreampy.Image.point import Point
from astrostreampy.BuilModel.autobuild import Model
from astrostreampy.BuildModel.modify import Modifier
from astrostreampy.BuildModel.aperture import fwhm_mask_from_paramtab

image = "image.fits"
mask = "mask.fits"
intmask = "interpolationmask.fits"

Start by applying the masks using the Stream class. Note that the masks are parsed as a list. This allows for multiple masks of the same type to apply simultaneously.

stream = Stream(image,[mask],[intmask])
stream.apply_masks()

Then the initial box position and dimensions can be set with the Point class. It opens a figure where the point can be set with left mouse click and the box dimensions are chosen with the sliders on the left. When satisfied close the plot by closing the window. stream.data() is the masked image.

init_box = Point(stream.data)

The modeling is setup and started with the Model class. The example presents its shortest and simplest form.

model = Model(stream.original_data, stream.data, stream.header, 
                  init_box.x, init_box.y, init_box.width, init_box.height, output="model")
model.build() # for further access get full model with .data
model.show() # for quality checks

If model.show() reveals that the algorithm went beyond the stream call the ````Modifier``` class to cut those regions off. A window opens displaying the image, model and residual. Type in the terminal the lower and upper indices sperated by "," and press ENTER. The model and residual changes based on the input. Repeat it as often as desired. When finished leave the line empty and press ENTER again. It saves the modified files with prefix "mod_".

Modifier("model_multifits.fits","model_paramtab.fits")

If you are interested in photometric measurements use

aperture = fwhm_mask_from_paramtab("mod_model_multifits.fits","mod_model_paramtab.fits"

to create an aperture mask, which is a numpy.ndarray.

Metadata

Release files for astrostreampy 1.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for astrostreampy 1.9.0
File Size Uploaded
astrostreampy-1.9.0.tar.gz 36.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for astrostreampy 1.9.0
File Interpreter ABI Platform
astrostreampy-1.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 76.7 kB

Release files / astrostreampy-1.9.0.tar.gz

Download URL astrostreampy-1.9.0.tar.gz
Size 36.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9172de7c4235d88b72670f98d2fc0cc658185a13f65cdbd2da96be9a0c479ac6
BLAKE2b-256 checksum
How to use checksums
3a588737f25af5cd9d15a6f7485e0c28a1f98db55c134cb3f192b2d8906bf8ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / astrostreampy-1.9.0-py3-none-any.whl

Download URL astrostreampy-1.9.0-py3-none-any.whl
Size 40.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0feac8cdbc43015fe11961a3e422e025c568bfebcbf19d9d16dd864c301c8e8e
BLAKE2b-256 checksum
How to use checksums
725661d8fa78196739aec160bc28303d5f33552c2caf96bde201e9b1127774b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

1.9.0 This release

2 release files

1.8.0

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page