Skip to main content

Generate synthetic Healpix or 2D data using Cross Scattering Transform

Project description

foscat

Read the Docs

A python package dedicated to image component separation based on scattering transform analysis designed for high performance computing.

the concept

The foscat genesis has been built to synthesise data (2D or Healpix) using Cross Scattering Transform. For a detailed method description please refer to https://arxiv.org/abs/2207.12527. This algorithm could be effectively usable for component separation (e.g. denoising).

A demo package for this process can be found at https://github.com/jmdelouis/FOSCAT_DEMO.

usage

Short tutorial

https://github.com/IAOCEA/demo-foscat-pangeo-eosc/blob/main/Demo_Synthesis.ipynb

FOSCAT_DEMO

The python scripts demo.py included in this package demonstrate how to use the foscat library to generate synthetic fields that have patterns with the same statistical properties as a specified image.

Install foscat library

Before installing, make sure you have python installed in your enviroment. The last version of the foscat library can be installed using PyPi:

pip install foscat

Load the FOSCAT_DEMO package from github.

git clone https://github.com/jmdelouis/FOSCAT_DEMO.git

Recommended installing procedures for mac users

It is recomended to use python=3.9*.

micromamba create -n FOSCAT
micromamba install -n FOSCAT ‘python==3.9*’
micromamba activate FOSCAT
pip install foscat
git clone https://github.com/jmdelouis/FOSCAT_DEMO.git

Recommended installing procedures HPC users

It is recomended to install tensorflow in advance. For DATARMOR for using GPU ;

micromamba create -n FOSCAT
micromamba install -n FOSCAT ‘python==3.9*’
micromamba install -n FOSCAT ‘tensorflow==2.11.0’
micromamba activate FOSCAT
pip install foscat
git clone https://github.com/jmdelouis/FOSCAT_DEMO.git

Spherical data example

compute a synthetic image

python demo.py -n=32 -k -c -s=100

The demo.py script serves as a demonstration of the capabilities of the foscat library. It utilizes the Cross Wavelet Scattering Transform to generate a Healpix map that possesses the same characteristics as a specified input map.

  • -n=32 computes map with nside=32.
  • -k uses 5x5 kernel.
  • -c uses Scattering Covariance.
  • -l uses LBFGS minimizer.
  • -s=100 computes 100 steps.
python demo.py -n=8 [-c|--cov][-s|--steps=3000][-S=1234|--seed=1234][-k|--k5x5][-d|--data][-o|--out][-r|--orient] [-p|--path][-a|--adam]

  • The "-n" option specifies the nside of the input map. The maximum nside value is 256 with the default map.
  • The "--cov" option (optional) uses scat_cov instead of scat.
  • The "--steps" option (optional) specifies the number of iterations. If not specified, the default value is 1000.
  • The "--seed" option (optional) specifies the seed of the random generator.
  • The "--path" option (optional) allows you to define the path where the output files will be written. The default path is "data".
  • The "--k5x5" option (optional) uses a 5x5 kernel instead of a 3x3.
  • The "--data" option (optional) specifies the input data file to be used. If not specified, the default file "LSS_map_nside128.npy" will be used.
  • The "--out" option (optional) specifies the output file name. If not specified, the output file will be saved in "demo".
  • The "--orient" option (optional) specifies the number of orientations. If not specified, the default value is 4.
  • The "--adam" option (optional) makes the synthesis using the ADAM optimizer instead of the L_BFGS.

plot the result

The following script generates a series of plots that showcase different aspects of the synthesis process using the demo.py script.

python test2D.py

python plotdemo.py -n=32 -c

2D field demo

python test2Dplot.py

compute a synthetic turbulent field

The python scripts demo2D.py included in this package demonstrate how to use the foscat library to generate a 2D synthetic fields that have patterns with the same statistical properties as a specified 2D image. In this particular case, the input field is a sea surface temperature extracted from a north atlantic ocean simulation.

python testHealpix.py

python demo2d.py -n=32 -k -c

python testHplot.py

The following script generates a series of plots that showcase different aspects of the synthesis process using the demo2D.py script.

python plotdemo2d.py -n=32 -c

For more information, see the documentation.

mpirun -np 3 testHealpix_mpi.py

Authors and acknowledgment

Authors: J.-M. Delouis, P. Campeti, T. Foulquier, J. Mangin, L. Mousset, T. Odaka, F. Paul, E. Allys

This work is part of the R & T Deepsee project supported by CNES. The authors acknowledge the heritage of the Planck-HFI consortium regarding data, software, knowledge. This work has been supported by the Programme National de Télédétection Spatiale (PNTS, http://programmes.insu.cnrs.fr/pnts/), grant n◦ PNTS-2020-08

License

BSD 3-Clause License

Copyright (c) 2022, the Foscat developers All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

Project status

It is a scientific driven development. We are open to any contributing development.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

foscat-3.3.3.tar.gz (68.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

foscat-3.3.3-py3-none-any.whl (73.5 kB view details)

Uploaded Python 3

File details

Details for the file foscat-3.3.3.tar.gz.

File metadata

  • Download URL: foscat-3.3.3.tar.gz
  • Upload date:
  • Size: 68.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.3

File hashes

Hashes for foscat-3.3.3.tar.gz
Algorithm Hash digest
SHA256 030da8f941d2026e76ce7dab8db6ace44724b86306de2843c671e019a2825887
MD5 7242f6e3605af5017958a7a1e0c1c78e
BLAKE2b-256 8a33667f2ebed0c0fee0cfac35f19eba73df79bff00a93c6c1519fab2776fe45

See more details on using hashes here.

File details

Details for the file foscat-3.3.3-py3-none-any.whl.

File metadata

  • Download URL: foscat-3.3.3-py3-none-any.whl
  • Upload date:
  • Size: 73.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.3

File hashes

Hashes for foscat-3.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e497bca66e3ffe499ca99b18e97346d5e103aa30b3da7bd73b4d16ddf0d1168d
MD5 8f9f13284802698cb064754a32a122d1
BLAKE2b-256 3e2e14e5b78dd3edfa6faff6328dd1d7a9b5976e779a8e3f9631bcae03d209c9

See more details on using hashes here.

Supported by

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