Skip to content

Anthony96/JWSTmorph

Repository files navigation

JWSTmorph

This package, working with python3, allows to calculate morphological parameters of galaxies, namely Gini, M20, concentration, asymmetry, shape asymmetry, smoothness, maximum radius (Rmax), and clumpiness. It is specifically adapted to be used on multiwavelength images from JWST-NIRCAM. The code can be already used on a small sample of images simulated with MIRAGE (included in the package). For any problem contact me at antonello.calabro@inaf.it.

Python packages required :

matplotlib,skimage,pandas,astLib,astropy,photutils,statmorph,scipy

Instructions : To run the code simply type:

python main_super_easy_from_catalog.py

Input of the code (user defined input parameters, to be modified directly in the main code) :

  • which_subset : write your favourite label to distinguish your subset of galaxies (the name of the subset is included in the name of final table saved).
  • segmap_detection_type : 'automatic' = to define the object, it takes automatically all segmentation regions in a central box whose size should be defined for each galaxy in the input catalog. If nothing is detected in this central box, an empty segmentation map is returned ; 'indices' = the user should write for each galaxy the corresponding index in the segmentation map (in the file /data/galaxy_segmap_indices.txt), and then perform a first run to check the right index and update that file. [N.B. currently working only with the automatic setup]
  • use_statmorph : True = also calculates the morphological parameters with the statmorph package (https://statmorph.readthedocs.io/en/latest/) (Rodriguez-Gomez et al. 2019). ; False = the program skips statmorph (-9 is returned for all the output parameters starting with the prefix 'SM_' .
  • segmentation_type : = can be 'Pawlik' [DEFAULT] = the segmentation map is derived following Pawlik et al. (2016). Other possible choices are: 'petrosian_based', 'photutils', and 'square'. [currently fully tested with the default option only]

In the section 'INPUT CATALOG', the program looks for a catalog named 'assembled_catalog.cat' in the data folder, which includes the list of galaxies to process, with their ID, redshift, and boxsize for the initial detection. Then, it looks for fits images in the data folder with the following structure name: 'ID_'+str(IDgal)+'_'+band+'.fits', where IDgal is an integer, and band is a string specifying the photometric band (can be 'f090w', 'f115w', 'f150w', 'f200w', 'f277w', 'f356w', or 'f444w'). The number of bands, the pixel size of the images, and the FWHM resolution for each filter can be modified in the first part of the main code. Image cutouts centered on each objects should be created with your favourite tool prior to running this program. In this package, example cutouts are given for all the 7 different bands listed above.



Output of the code (column name and brief description) :

  • c1 : clumpiness parameter, derived as explained in Calabrò et al. (2019) https://doi.org/10.1051/0004-6361/201935778 . The pixel coordinates of the galactic nuclei to remove should be specified in the file file_nuclei.txt . No nucleus is removed if the table contains all zeros.
  • Rmax : maximum radius of the galaxy Rmax, following the definition of Pawlik et al. (2016)
  • gini : gini parameter, calculated following the definitions of Abraham et al. (2003) and Lotz et al. (2004)
  • m20 : M20 parameter, following the definition of Lotz et al. (2004)
  • C : concentration parameter
  • A1 : asymmetry parameter
  • shapeasy : shape asymmetry, as defined in Pawlik et al. (2016)
  • S : smoothness parameter, as in Conselice et al. (2003)
  • SNpixel1 : average S/N per pixel of the galaxy
  • SM_gini, SM_m20, SM_C, SM_A, SM_S, SM_SNpixel SM_Rpetro : Gini, M20, concentration, asymmetry, smoothness parameters, average S/N per pixel and petrosian radius calculated with statmorph.
  • SM_flag : statmorph flag (0= good fit, 1= indicates a problem with the basic morphological measurements, such as a discontinuous Gini segmentation map).




Example of output images for a set of simulated clump configurations as described in Treu, Calabrò, Castellano, et al. (2022) : ID_400_distclumps_0.4_mag_27.0.png 400_clumpmap_distclumps_0.4_mag_27.0.png

The latter figure is a composition of 6 simulated images for the same configuration in different filters (F090W, F200W, F277W, F444W), including also F090W and F277W bands, convolved respectively to the psf resolution of F200W and F444W. All the stamps are 2'' on a side. image_cutouts_1_distclumps_0.2_mag_27.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages