Skip to main content

Package to model stellar tidal streams.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

astrostreampy-1.3.0.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

astrostreampy-1.3.0-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file astrostreampy-1.3.0.tar.gz.

File metadata

  • Download URL: astrostreampy-1.3.0.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for astrostreampy-1.3.0.tar.gz
Algorithm Hash digest
SHA256 d2bc761a590cfdbac99853f5d6e827f0092b1cce5c256f6673c09082e0254532
MD5 1bde18ba5614eda0dc8907f691873b27
BLAKE2b-256 e013b5c04a5e1a540b336d469bc0cc964e202f7e1f7e6045e90812d4f1a544bf

See more details on using hashes here.

File details

Details for the file astrostreampy-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for astrostreampy-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd129316d0ed0a724e3f6b366e925ab7635694a4621d675b6c42586f4004f8c0
MD5 5a3ad1d056adfe8829611384e1e3d427
BLAKE2b-256 ddc63916d36a0703c551652d171b1de7aaa55281b4410c7e42932c419e6a2be1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page