Hi Patrick!
Thanks for your reply. I think I made some progress, but I'm still
running into error messages (now with PSD)
The single scattering data I'm happy with. Basically I'm doing this:
ArrayOfScatteringMetaDataCreate( scat_meta_1habit )
ArrayOfSingleScatteringDataCreate( scat_data_1habit )
#--- TMatrix calculation:
scat_data_singleTmatrix(
shape = part_shape,
diameter_volume_equ = part_dveq,
aspect_ratio = part_ar,
mass = part_mass,
ptype = "totally_random",
data_f_grid = data_f_grid,
data_t_grid = data_t_grid,
data_za_grid = data_za_grid,
data_aa_grid = data_aa_grid,
)
#--- Set up scat_data
Append(scat_data_1habit, scat_data_single)
Append(scat_data_raw, scat_data_1habit)
# and meta data ...
Append(scat_meta_1habit, scat_meta_single)
Append(scat_meta, scat_meta_1habit)
#
scat_dataCalc(scat_data, scat_data_raw, f_grid)
scat_data_checkedCalc( scat_data_checked, scat_data, f_grid, 0.1,
"none", 5e-2 )
WriteXML( "ascii", scat_data, "scat_data.xml" )
and when I try to use pnd_agenda_array with psdMonoDispersive I do it
like this:
#-- PND AGENDA ARRAY
ArrayOfStringSet( pnd_agenda_input_names, [ "HWC" ] )
ArrayOfStringSet( dpnd_data_dx_names, [ "HWC" ] )
# The input data in pnd_agenda_input shall be number densities, in unit
of [#/m3].
ReadXML( pnd_agenda_input, "hail_pnddata.xml" )
ArrayOfAgendaAppend( pnd_agenda_array ){
VectorSet(pnd_size_grid, [1])
VectorSet(psd_size_grid, [1])
psdMonoDispersive(psd_data, dpsd_data_dx, pnd_agenda_input_t,
pnd_agenda_input,
pnd_agenda_input_names, dpnd_data_dx_names, scat_meta,
agenda_array_index, 220, 260)
pndFromPsdBasic
}
Append( scat_species, species_id_string )
Append( pnd_agenda_array_input_names, pnd_agenda_input_names )
But the error message is that:
The method requires that length of *psd_size_grid* is >= 2.
If I understand correctly, pnd_size_grid is the size of each scattering
element considered. If I run a monodisperse psd then all scattering
elements are the same size ... (?)
The other option I tried to avoid pnd_agenda_array, was reading directly
pnd_field from the file. But when doing cloudbox_checkedCalc I run into
this error:
The atmospheric field *pnd_field* has wrong size.
Expected size is 1 x 204 x 1 x 1,
while actual size is 1 x 231 x 1 x 1.
Stopping ARTS execution.
Related with cloudboxSetManuallyAltitude
cloudboxSetManuallyAltitude( z1=-2e3, z2=25e3, lat1=-0, lat2=0, lon1=-0,
lon2=0 )
I don't understand as my pnd_field is the size of my p_grid.
Thank you!
Vito
On 14.12.2022 12:32, Patrick Eriksson wrote:
Hi,
Yes, this is not totally streamlined. And nothing we will change now
as the handling of scattering data is being rewritten from scratch.
You must do a bit more than you included, as scat_dataCalc requires
scat_data_raw. Not clear from where you get that.
I think you can use Append to move scat_meta_single t0 scat_meta. And
same thing for scat_data_single to scat_data_raw.
Bye,
Patrick
On 2022-12-14 14:14, vito.gallig...@cima.fcen.uba.ar wrote:
Hello!
I have a bit of an ARTS 'coding-language' question here. I'm trying to
run a very simple simulation where I use the T-matrix and I read its
corresponding pnd_field_raw from a file. I mainly do the following:
ReadXML( particle_bulkprop_names, "particle_bulkprop_names.xml" )
ReadXML( particle_bulkprop_field, "particle_bulkprop_field.xml" )
scat_data_singleTmatrix
ReadXML( pnd_field_raw, "hail_pnddata.xml" )
scat_dataCalc
scat_data_checkedCalc
WriteXML( "ascii", scat_data, "scat_data.xml" ) # VB: store scat_data
cloudboxSetManuallyAltitude( z1=-9e3, z2=20e3, lat1=-0, lat2=0,
lon1=-0, lon2=0 )
pnd_fieldCalcFromParticleBulkProps
and here is when I run into: 'Method
pnd_fieldCalcFromParticleBulkProps needs input variable: scat_meta'
I cant seem to find in the built-in documentation server how to get
scat_meta from scat_meta_single. What is the method that does that?
thank you!!!
Vito