Opened 4 months ago
Closed 2 months ago
#3414 closed help (answered)
moo select options
Reported by: | LesleyGray | Owned by: | um_support |
---|---|---|---|
Component: | Data | Keywords: | moo select |
Cc: | Platform: | Monsoon2 | |
UM Version: |
Description
Dear CMS Helpdesk
I'm trying to extract some zonal wind data using:
moo select —fill-gaps queryFile_U_1850 moose:/crum/u-bd839/ap6.pp /gws/nopw/j04/solar/lesley/temp_bd839
and my queryfile looks like this:
begin
stash=30201
year=[1858..1859]
end
It works fine, but the suite has output U in various different combinations e.g. with different time averaging, and on different numbers of model levels. So I get pp files that contain 5 different U fields.
If I xconv the pp file the fields all have the same title (U component of wind on p level) but have different numbers of nz levels. I only want the field that is on 39 levels. I've been making .nc files of this field using xconv but this is really laborious - I'm trying to extract 40+ years of daily data, in 1-yr chunks.
Is there a way to modify my query file to select only the field that's available on 39 levels? If I can just extract the one field that I want, then I could use some of your CF python scripts to convert to .nc.
I found this documentation http://artefacts.ceda.ac.uk/badc_datadocs/um/umdp_F3-UMDPF3.pdf that looked hopeful (e.g. list on page 28 with LBLEV options). I tried a few options but nothing worked - I don't really understand how these things work - and hoping you can help me.
thanks very much
Lesley
Change History (4)
comment:1 Changed 4 months ago by grenville
comment:2 Changed 4 months ago by david
Hi Lesley,
You could use a cf-python 2-liner to do this:
>>> import cf >>> fields = cf.read('file(s)').select_by_construct('Z') >>> f = cf.FieldList(x for x in fields if x.coordinate('Z').size == 39)
The first line picks out all the fields with Z coordinates, and the second line throws away all those without exactly 39 levels.
Hope that helps,
David
comment:3 Changed 4 months ago by andy
Hi David,
This is the same issue that was reported a while back but awaiting a fix. cf-python cannot aggregate the fields properly and so you don't end up with four fields of u but many slices of data one levels. I think Sadie was going to look at this as per our Slack discussion on Oct 6th.
Cheers
Andy
comment:4 Changed 2 months ago by ros
- Component changed from MOSRS to Data
- Keywords moo added
- Platform set to Monsoon2
- Resolution set to answered
- Status changed from new to closed
Hi Lesley
Sorry for the delay in replying. We don't have sufficient moo expertise/experience to provide a quick answer.
I shall forward your query to the MO team.
Grenville