Hello!

Perfect. I adapted everything to use only the bulk approach. Thanks for the help.

Cheers,
Vito

On 03.02.2023 04:08, Patrick Eriksson wrote:
Vito,

Sorry, but partly filling pnd_field manually and partly filling it by
using the PSD methods will likely never work. At least this deviates
from how ARTS is designed. There are two main options here:

1: To fill pnd_field "manually". But this is likely more easily done
outside of ARTS.
2: To do all byparticle_bulkprop_field and PSD methods

If you explain what you want to do, it would be easier to give advice.
It would also be helpful to know if you use Matlab or Python?

Bye,

Patrick


On 2023-02-02 15:04, Galligani wrote:
Hello !

Yes, for example this:

ReadXML( pnd_field, "hail_pnddata1.xml" )
Tensor4Create(pnd_field2)
ReadXML( pnd_field2, "hail_pnddata2.xml" )
Append( pnd_field, pnd_field2)

#---- RWC
ScatSpeciesSizeMassInfo( species_index=5, x_unit="dveq" )
Copy( psd_size_grid, scat_species_x )
Copy( pnd_size_grid, scat_species_x )
psdModifiedGammaMass( n0=8e6, mu=0, la=-999, ga=1, t_min = 230, t_max = 999 )
pndFromPsdBasic

# append pnd_data to pnd_field? For example I tried:
Append( pnd_field, pnd_data)

and I get:

Workspace variable belongs to the wrong group:
pnd_data is not Tensor3, it is Matrix

If I comment that out I've also realized that my psdModifiedGammaMass method also fails:

Method psdModifiedGammaMass needs input variable: pnd_agenda_input_t

Is it even possible to call this method outside the pnd_agenda_array? This open another question: Can I call a pnd_agenda_array only for RWC and not the other hail species?

I'm running into many errors in everything I tried.

Thanks for the time!

On 02.02.2023 03:15, Patrick Eriksson wrote:
Vito,

Can you explain how it failed?

Bye,

Patrick

On 2023-02-01 16:34, Galligani wrote:
Hi Patrick! Thanks that worked out!

I'm now running a Frankeinstein of code with pnd_data saved outside ARTS for different hail species, and using the ARTS psdModifiedGammaMass. Basically I'm trying to append the RWC pnd_data from

psdModifiedGammaMass
pndFromPsdBasic

to the pnd_field from the previous estructure:

i.e.,

ReadXML( pnd_field, "hail_pnddata1.xml" )

Tensor4Create(pnd_field2)
ReadXML( pnd_field2, "hail_pnddata2.xml" )
Append( pnd_field, pnd_field2)

etc. It this possible? All my attempts have failed.

Thank you!
Vito


On 25.01.2023 19:15, Patrick Eriksson wrote:
Vito,

scat_data and scat_data_raw are of type
ArrayOfArrayOfSingleScatteringData. The first Array dimension matches scat_species and the second one size. So you need multiple Append to
scat_data_raw and scat_meta.

If I get it right, you should do this for each habit:

ReadXML( scat_data_single, "TestTMatrix.scat_data_single_hail1.xml" ) ReadXML( scat_meta_single, "TestTMatrix.scat_meta_single_hail1.xml" )
Append(scat_data_1habit, scat_data_single)
Append(scat_meta_1habit, scat_meta_single)
Append(scat_data_raw, scat_data_1habit)
Append(scat_meta, scat_meta_1habit)
Append(scat_species, species_id_string )

Delete(scat_data_1habit)  # To remove appended data
Delete(scat_meta_1habit)

The creation of pnd_field looks fine, if I remember correctly how
works for appending a Tensor4 to a Tensor4.

Bye,

Patrick


On 2023-01-24 16:08, Galligani wrote:
Hello everyone,

I re-open this question because I am adding species to my simulations now (before I was running with only one species)

I've run into the following error:

'Number of scattering species specified by scat_species does
not agree with number of scattering species in scat_data:
scat_species has 5 entries, while scat_data has 1.
Stopping ARTS execution.
Goodbye.'

I have 5 different species. This is essentially what my code is doing (I will show only two of the species)

ArrayOfScatteringMetaDataCreate( scat_meta_1habit )
ArrayOfSingleScatteringDataCreate( scat_data_1habit )


ReadXML( scat_data_single, "TestTMatrix.scat_data_single_hail1.xml" ) ReadXML( scat_meta_single, "TestTMatrix.scat_meta_single_hail1.xml" )
Append(scat_data_1habit, scat_data_single)
Append(scat_meta_1habit, scat_meta_single)
Append( scat_species, species_id_string )

ReadXML( scat_data_single, "TestTMatrix.scat_data_single_hail2.xml" ) ReadXML( scat_meta_single, "TestTMatrix.scat_meta_single_hail2.xml" )
Append(scat_data_1habit, scat_data_single)
Append(scat_meta_1habit, scat_meta_single)
Append( scat_species, species_id_string )

[... repeats for 3 more species]

Append(scat_data_raw, scat_data_1habit)
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" )


scat_dataCalc needs scat_data_raw to be an ArrayOfArrayOfSingleScatteringData, so essentially when I do Append(scat_data_raw, scat_data_1habit) I convert scat_data_1habit (ArrayOfSingleScatteringData) that has the right shape for the 5 species into an ArrayOfArrayOfSingleScatteringData and makes this error.


Am I taking a bad approach at doing this?
Later I add the pndf_fields by doing something similar:

Tensor4Create(pnd_field2)
ReadXML( pnd_field2, "hail_pnddata2.xml" )
Append( pnd_field, pnd_field2)


I hope this helps someone else too
Thank you!
Vito











On 15.12.2022 18:39, Patrick Eriksson wrote:
Hi,

Thanks Oliver, I looked in the wrong function!

Hm, it seems that I forgot about fixing the full chain for the mono PSDs, and that nobody has tried to use them until now. My mistake is a bit shameful, but I feel reluctant to fix it now, as the present PSD
system hopefully will be replaced soon.

Vito, it seems that you already have considered generating pnd_field yourself. I hope you can live with this solution for the mono PSD. If
you get confused about the cloudbox limits, you can try to use
pnd_fieldCalcFrompnd_field_raw. That method will adjust pnd_field to
the selected cloudbox.

Bye,

Patrick



On 2022-12-15 07:51, Lemke, Oliver wrote:
Hi Patrick, hi Vito,

On 14. Dec 2022, at 20:04, Patrick Eriksson <patrick.eriks...@chalmers.se> wrote:

   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.

I must ask what ARTS version you are using? In the version I have on my computer it looks OK. At least, I can not find this error message.

Tbe check does exist in ARTS master as well as 2.4. It's the first check in pndFromPsdBasic in m_microphysics.cc.

Cheers,
Oliver



Reply via email to