grid_skel#
- crispy.grid_ridge.grid_skel(readFile, imgFile, writeFile, **kwargs)[source]#
Map raw CRISPy results onto a reference image grid and save the gridded results.
Takes ungridded CRISPy results and aligns them with the grid of a reference image (typically the image from which CRISPy was run). The gridded results are saved to a specified output file in FITS format.
- Parameters:
readFile (str) – Path to the .txt file containing the ungridded (raw) CRISPy results.
imgFile (str) – Path to the .fits file of the reference grid image.
writeFile (str) – Path to the .fits file where the gridded CRISPy results will be saved.
**kwargs (dict, optional) –
Additional keyword arguments to customize the behavior of the clean_grid function. Defaults are:
- coord_in_xfirstbool, default=True
Whether the input coordinates have the x-dimension first.
- start_indexint, default=0
Starting index for gridding the skeleton.
- min_lengthint, default=6
Minimum length of structures to retain.
- methodstr, default=”robust”
Gridding method, either “robust” or “fast”.
- Returns:
The gridded skeleton is saved directly to the specified writeFile.
- Return type:
None
Notes
The clean_grid function is responsible for handling the gridding and filtering of skeleton structures.
The output file is saved in FITS format with the reference image’s header metadata.
Examples
Grid CRISPy results and save them to a FITS file:
>>> from crispy import grid_ridge >>> grid_ridge.grid_skel("results.txt", "reference_image.fits", "gridded_results.fits", min_length=10, method="fast")