Giter VIP home page Giter VIP logo

smrt's People

Contributors

carlomarin avatar ghislainp avatar julienmeloche avatar maiwinstrup avatar mjsandells avatar ninamaass avatar robbiemallett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smrt's Issues

Substrate with geometrical_optics or iem_fung92

Hi,
I've seen you have been working lately on geometrical_optics and iem_fung92, interface and substrate module. I don't know if they are ready to use since no documentation appears on SMRT/doc but I'm having this same issue when I try to run both module for substrate. It will be very useful If I can work with correlation length for my soil roughness work I've presented at the workshop...

code_errorGEo

Here's the error I get, it is the same for both module and I also get the same thing if I replace the generic stack by a snowpack.

error_substrate_geo

Thank you again for your time,
Julien

IEM interface in SMRT

Hi all,

I am working on the implementation of SMRT for wet snowpacks. I tried using the IEM interface for rough surface scattering in the SMRT model. While performing the sensitivity analysis, I came across different trends of backscatter as a function of liquid water content. When I used only SMRT (without adding a rough interface), then I see the decreasing trend of backscatter as the liquid water content increased. However, after adding the rough interface via IEM in the snowpack, I observed a sudden increase of backscatter from the one in SMRT. Moreover, as the liquid water content increases, the backscatter (SMRT + IEM) increases. I am confused in interpreting the behavior of backscatter as a function of liquid water content. In the SAR image, as I can see low backscatter values when there is an increased melt (or liquid water content), I would be grateful if you could let me know the increasing trend of modeled backscatter when the IEM interface is added in the SMRT.

Thanks a lot for your time,

Cheers,
Shashwat

implementing geometrical optics for rough interfaces within ice column

My colleagues and I are interested in implementing a snow pack over rough ice interface, at least for the top layer of an ice column. Our goal is to model polarimetric brightness temperature at several microwave frequencies.

As a first cut, I've attempted to implement GO to describe the rough ice interface via:

<import smrt libraries>
from smrt.core.interface import make_interface

<boiler plate variables, build snow pack, ice column>

rough_interface = make_interface("geometrical_optics",\
                                 mean_square_slope=mean_square_slope)
								 
ice_column = make_ice_column(ice_type              = ice_type,
                             thickness             = thickness,
                             temperature           = temperature,
                             microstructure_model  = "sticky_hard_spheres",
                             brine_inclusion_shape = "spheres", 
                             salinity              = salinity, 
                             brine_volume_fraction = .02,
                             radius                = radius,
                             stickiness            = stickiness,
                             density               = density,
                             add_water_substrate   = "ocean",
                             interface = rough_interface
                            )

<rest of code>

When executing this code I saw some divergent results. It was only after doing so that I noticed the following admonition within /smrt/interface/__init.py__:

""" This module contains different type of boundary conditions between the layers.
Currently only flat interfaces are implemented. 

.. admonition::  **For developers**

    All the different type of interface must defined the methods: `specular_reflection_matrix` and `coherent_transmission_matrix`.

    It is currently not possible to implement rough interface, a (small) change is needed in DORT. Please contact the authors.

"""

QUESTIONS:
1.) What "small change" is needed for the DORT solver? Would this be something we could help with?
2.) There is a warning message originating from geometrical_optics.py:

to be optimised

Does this refer to a speed optimization or a convergence issue?

how to use non-default wet snow permittivity formula with IBA

In make_snowpack (and make_snow_layer) it is possible to define non standard permittivity formula for ice/wetice and air. How a non-default formula for wetsnow can be used in IBA e.g., the formulation used in MEMLS or Ulaby2014?

thanks,
carlo

Using the model for non snow packs

Hello,

Not sure if this is the best place to ask.

Is it possible to use the model for layers composed of other things than snow ?

My current approach to this is to use make_generic_stack as follows:

# For a case with no scattering

from smrt import make_model, core, sensor_list
import numpy as np
from smrt.core.globalconstants import C_SPEED
from smrt.inputs.make_medium import make_generic_stack

sensor = sensor_list.passive(562e9, 40)
l = 2
nl = l//2 # // Forces integer division
thickness = np.array([0.1, 0.1]*nl)
thickness[-1] = 100  # last one is semi-infinit
temperature = np.array([150.0, 150.0]*nl)
permitivity = np.array([3+0.1*1j, 2.5+0.08*1j])

k0 = 2 * np.pi * sensor.frequency / C_SPEED
ka = 2 * k0 * np.sqrt(permitivity).imag
ks = 0

genericpack = make_generic_stack(thickness=thickness, 
						  temperature=temperature, 
						  ks=ks, 
						  ka=ka, 
						  effective_permittivity=permitivity)

m = make_model("prescribed_kskaeps", "dort")
result = m.run(sensor, genericpack)

print(np.mean(result.Tb().values))

Now if I want to add scattering to the model what would be the best way to proceed ? I assume it is not simply a case of changing the ka and ks values as such (for Rayleigh scattering):

lmda = C_SPEED / sensor.frequency

radius = 1e-4
eps = permitivity 
e0 = 1 # vacuum

f = 0.6 # the faction of scatteres such that 1-f = porosity

k0 = 2 * np.pi / lmda
ks = f * 2 * abs((eps - e0) / (eps + 2 * e0))**2 * radius**3 * k0**4
ka = f * 9 * k0 * eps.imag / e0 * abs(e0 / (eps + 2 * e0))**2

Is this a correct approach ?

Thank you very much for your help,

Issues with iem_fung92_interface

Hello,

I'm trying to implement "iem_fung92" interface in my medium but SMRTError raised an exception as "Parameter roughness_rms must be specified" even though I specified it.

Here is the code:

temperature = 273 - 15
brine_volume_fraction=[0.15]
corr_length = [5e-3]
roughness_rms=[0.4]

ic = make_ice_column('firstyear', thickness=[0.5], microstructure_model='exponential', interface="iem_fung92",
                     temperature=temperature, brine_volume_fraction=brine_volume_fraction, roughness_rms=roughness_rms, corr_length=corr_length, add_water_substrate=True)

SMRTError: Parameter roughness_rms must be specified

Please advise on what I doing wrong.

Thanks!

Bug in make_medium.py

Hi,
I'm trying to simulate Tb from soil only by adding a transparent layer.

First, what is the best way to do this?
My idea was to use make_generic_stack to use make soil with a transparent layer with ka = 0, ks = 0 and effective_permittivity = 1.

Second,
When using make_generic_stack from make_medium, I get the following error saying 'get' is not define. I quickly fixed this adding 'lib.' at line 445 of make_medium.py

Selection_001

Should we submit a pull-request?

Julien et Paul

Porosity ranges 0-1

Hi all, thought I'd point out a small mistake in the docs concerning make_ice_column.

Currently reads "porosity โ€“ porosity of ice layer (in %). Default is 0."

Should be 0 - 1, or fractional porosity. If the user supplies a value greater than one, a negative density is generated by bulk_ice_density (which does not trigger an error). Then upon running the model like this an error is thrown:

"SMRTError: the imaginary part of the permittivity must be positive, by convention, in SMRT"

I'll also make a pull request to handle the negative density error in the bulk_ice_density function (so users don't have to trace a negative permittivity in m.run back to a negative ice density), but wanted to raise the docs issue here.

I also think that the default (if porosity is not supplied) is that the porosity is non-zero and calculated from the ice density?

image

image

crosspol -ve intensity

@ghislainp This generates -ve crosspol backscatter intensity. Possibly just numerics.

from smrt import make_snowpack, make_model, sensor
from smrt.substrate.reflector_backscatter import make_reflector

# Make model
model = make_model("iba","dort")

# Set observation angle
theta = [30, 40, 50, 60]
# Make active sensor
scatt_frequencies = [10.2e9, 13.3e9, 16.7e9]
scatterometer = sensor.active(scatt_frequencies, theta)


thickness = [0.1]*8
density = [100, 135, 170, 210, 235, 225, 245, 300]
temperature = 270
radius = [1.1e-4, 0.9e-4, 1.1e-4, 1.1e-4, 1.4e-4, 2.3e-4, 2.9e-4, 3.4e-4]
tau = [120, 20, 15, 5, 0.11, 0.11, 0.1, 0.1]

subs = make_reflector(temperature=270, specular_reflection=0., 
                           backscattering_coefficient={'VV': 0.05, 'HH': 0.05}) # -13dB

sp = make_snowpack(thickness=thickness, microstructure_model="sticky_hard_spheres",
                  density=density, temperature=temperature, radius=radius, stickiness=tau, substrate=subs)

res = model.run(scatterometer, sp)

print(res.sigmaHV())

Inclusion of Vant effective permittivity for sea ice at L-band

In order to include the Vant effective permittivity formulation for sea ice (Vant et al. 1978, "The complex-dielectric constant of sea ice at frequencies in the range 0.1โ€“40 GHz", only for L-band as it employs distinct coefficients for each frequency), I'm facing some difficulties. I have successfully incorporated the permittivity function into the saline_ice.py file. However, I'm encountering some ambiguity regarding its usage within the make_medium function. After reviewing the code, it seems that both the "ice_permittivity_model" (for firstyear ice) and the "saline_ice_permittivity" (for multiyear ice) determine the background permittivity, which is then mixed with the scatterers. The Vant formulation is empirical, and it computes the permittivity of the saline ice by itself (it doesn't have to be then mixed).

Backscatter at nadir (zero degrees) from specular reflector

Thought I'd query the behaviour of the reflector substrate at low, snow-penetrating frequencies at zero degrees. Seems that it's scattering rather than reflecting.

When a thin (1cm), low-density snowpack is placed over a totally reflecting plate I would expect the (monostatic) backscatter to be high at zero degrees, since there's normal reflection from the plate and negligible scattering.

Similarly at non-zero angles I would expect backscatter to be negligible, as waves geometrically reflect like a mirror and do not return to the sensor.

Instead the backscatter intensity is a very smooth function of angle, as if the waves are being scattered by the reflecting plate rather than specularly reflected. Furthermore, there's a relatively high cross-pol return, which also implies the plate is scattering rather than reflecting.

Can anybody explain this behaviour to me?

image

Working example:


import numpy as np
from smrt import make_snowpack, make_model, sensor_list, make_ice_column, PSU
from smrt.permittivity.saline_snow import saline_snow_permittivity_geldsetzer09
import matplotlib.pyplot as plt
import itertools
import smrt
from smrt.substrate.reflector_backscatter import make_reflector

frequency = 10e9
angles = np.arange(-10,70,5)

snow_depth = [0.05]
snow_CL_e5 = 10
snow_density = 400
snow_temperature = 265
snow_salinity = 0

substrate = make_reflector(temperature=265,
                           specular_reflection={'V': 1,
                                                'H': 1},
                          )

snowpack = make_snowpack(thickness= snow_depth,
                 microstructure_model="exponential",
                 density=snow_density,
                 temperature= snow_temperature,
                 corr_length= snow_CL_e5*1e-5,
                 salinity= snow_salinity,
                 substrate=substrate
                )


sensor = smrt.sensor.active(frequency, angles, polarization_inc= ['V'],polarization=['V','H'])

m = make_model("iba", "dort")

res = m.run(sensor, snowpack)

###############################################

# Process results

results = {}

for pol in ['V','H']:
    
    s_res = res.sigma_dB_as_dataframe(polarization_inc='V',
                                  polarization=pol)


    results[f'V{pol}'] = np.array(s_res['sigma'])

##################################################

# Plot results
    
for key in results.keys():

    if 'VV' in key:
        linestyle = '-'
    else:
        linestyle = '--'

    plt.plot(angles,results[key], label = key,
         marker='.', linestyle = linestyle,
         color='b')

plt.legend(fontsize='x-large',
   loc='lower left')


plt.ylabel('Backscatter (dB)',fontsize='xx-large')
plt.xlabel('Angle',fontsize='xx-large')
plt.xticks(fontsize='x-large')
plt.yticks(fontsize='x-large')
plt.show()



Some expectations

Do you have any plans to convert this code into C++or MATLAB language code?Is there a plan to add a 3D model electromagnetic scattering calculation module?

Looking forward to your reply.

Problem of Diagonalisation Error

Hi all,

I am working on the implementation of SMRT for a wet snowpack. First, I made the snowpack by giving the desired inputs, i.e. density, thickness, stickiness, liquid water content, temperature, and grain size, with "Sticky Hard Spheres" microstructure model. Next, I made the model using IBA and DORT, after which the model is implemented under active sensor configuration. However, I got an error of "Diagonalisation". I would be grateful if you could help me in understanding the error and what can be done in order to eliminate this.

Thanks a lot for your time,

Cheers,
Shashwat

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.