Home |
Search |
Today's Posts |
![]() |
|
uk.sci.weather (UK Weather) (uk.sci.weather) For the discussion of daily weather events, chiefly affecting the UK and adjacent parts of Europe, both past and predicted. The discussion is open to all, but contributions on a practical scientific level are encouraged. |
Reply |
|
LinkBack | Thread Tools | Display Modes |
#1
![]() |
|||
|
|||
![]()
Amongst the old Soviet block synops many report rainfall incorrectly in
the 6**** group. I think there should be a 2 at the end of the group not a 0. e.g... 28879 119// 82004 11226 21274 39990 40307 57008 69900 77171 8802/ 333 11190= 28909 11999 81703 11179 21212 30115 40224 57007 69900 70232 82032 333 11170= 28952 119// 82005 11184 21210 30044 40251 57009 69970 77173 8802/ 333 11179= Unfortunately the programme I run when decoding does not recognise the '0' so I have to trawl through the data and manually change these '0's to 2's. Can anyone think of a quick way I can change this in one hit? It would save me so much time. I tend to view the raw data in either Notepad or Wordpad. Any quick fixes would be much appreciated. Thanks -- Keith (Southend) http://www.southendweather.net |
#2
![]() |
|||
|
|||
![]() Keith (Southend) wrote: Amongst the old Soviet block synops many report rainfall incorrectly in the 6**** group. I think there should be a 2 at the end of the group not a 0. e.g... 28879 119// 82004 11226 21274 39990 40307 57008 69900 77171 8802/ 333 11190= 28909 11999 81703 11179 21212 30115 40224 57007 69900 70232 82032 333 11170= 28952 119// 82005 11184 21210 30044 40251 57009 69970 77173 8802/ 333 11179= Unfortunately the programme I run when decoding does not recognise the '0' so I have to trawl through the data and manually change these '0's to 2's. Can anyone think of a quick way I can change this in one hit? It would save me so much time. I tend to view the raw data in either Notepad or Wordpad. Any quick fixes would be much appreciated. In Word: Edit Replace Replace 0= with 2= I don't know if that will work in other programmes. You can replace spaces with more than one or vice versa and you can replace stuff with tabs too. A paragraph or a tab is written in as: ^p or ^t. If you wanted a column instead of a line across you would just replace a space or spaces with a ^p And if you wanted to put the line across into a spread-sheet with the blocks in different cells you would replace the space(s) with tabs (^t) I imagine Open Office does something similar but the way it inserts stuff between spread-sheets and word-processors is different. |
#3
![]() |
|||
|
|||
![]()
On 27 Jan 2006 15:59:49 -0800, Weatherlawyer wrote:
Amongst the old Soviet block synops many report rainfall incorrectly in the 6**** group. I think there should be a 2 at the end of the group not a 0. e.g... 28879 119// 82004 11226 21274 39990 40307 57008 69900 77171 8802/ 333 11190= In Word: Edit Replace Replace 0= with 2= Presumably the = means space? Yes, that will work but a global replace would begger up any other block ending in 0 like block 39990 above. Keith, the regex: s/^6(\d\d\d)0$/6$1\x32/g; Will do it. I'd bung it in a bit of PERL to read the file, process each line and write out the result. The sanity checking to make sure it only changes the expected blocks will be the hard bit. As it stands it will change *all* blocks that start with 6, end with 0 and have three digits between the 6 and 0. -- Cheers Dave. pam is missing e-mail |
#4
![]() |
|||
|
|||
![]()
Weatherlawyer wrote:
Keith (Southend) wrote: Amongst the old Soviet block synops many report rainfall incorrectly in the 6**** group. I think there should be a 2 at the end of the group not a 0. e.g... 28879 119// 82004 11226 21274 39990 40307 57008 69900 77171 8802/ 333 11190= 28909 11999 81703 11179 21212 30115 40224 57007 69900 70232 82032 333 11170= 28952 119// 82005 11184 21210 30044 40251 57009 69970 77173 8802/ 333 11179= Unfortunately the programme I run when decoding does not recognise the '0' so I have to trawl through the data and manually change these '0's to 2's. Can anyone think of a quick way I can change this in one hit? It would save me so much time. I tend to view the raw data in either Notepad or Wordpad. Any quick fixes would be much appreciated. In Word: Edit Replace Replace 0= with 2= I don't know if that will work in other programmes. You can replace spaces with more than one or vice versa and you can replace stuff with tabs too. A paragraph or a tab is written in as: ^p or ^t. If you wanted a column instead of a line across you would just replace a space or spaces with a ^p And if you wanted to put the line across into a spread-sheet with the blocks in different cells you would replace the space(s) with tabs (^t) I imagine Open Office does something similar but the way it inserts stuff between spread-sheets and word-processors is different. No that won't work as the 6***0 series is rarely at the end were the '=' is. Thanks all the same. -- Keith (Southend) http://www.southendweather.net |
#5
![]() |
|||
|
|||
![]()
Dave Liquorice wrote:
On 27 Jan 2006 15:59:49 -0800, Weatherlawyer wrote: Amongst the old Soviet block synops many report rainfall incorrectly in the 6**** group. I think there should be a 2 at the end of the group not a 0. e.g... 28879 119// 82004 11226 21274 39990 40307 57008 69900 77171 8802/ 333 11190= In Word: Edit Replace Replace 0= with 2= Presumably the = means space? Yes, that will work but a global replace would begger up any other block ending in 0 like block 39990 above. Keith, the regex: s/^6(\d\d\d)0$/6$1\x32/g; Will do it. I'd bung it in a bit of PERL to read the file, process each line and write out the result. The sanity checking to make sure it only changes the expected blocks will be the hard bit. As it stands it will change *all* blocks that start with 6, end with 0 and have three digits between the 6 and 0. Dave, I'm sure this will do the job, even if I can 'find' before I 'change', as it would be much quicker. However, I'm not familiar with PERL, what do I need to do for this to work.? Anything will save me so much time and eyesight ;-) Thanks -- Keith (Southend) http://www.southendweather.net |
#6
![]() |
|||
|
|||
![]()
In message , "Keith (Southend)"
writes Amongst the old Soviet block synops many report rainfall incorrectly in the 6**** group. I think there should be a 2 at the end of the group not a 0. e.g... 28879 119// 82004 11226 21274 39990 40307 57008 69900 77171 8802/ 333 11190= 28909 11999 81703 11179 21212 30115 40224 57007 69900 70232 82032 333 11170= 28952 119// 82005 11184 21210 30044 40251 57009 69970 77173 8802/ 333 11179= Unfortunately the programme I run when decoding does not recognise the '0' so I have to trawl through the data and manually change these '0's to 2's. Can anyone think of a quick way I can change this in one hit? It would save me so much time. I tend to view the raw data in either Notepad or Wordpad. Any quick fixes would be much appreciated. Thanks Keith, According to the WMO Manual on Codes, '0' is a valid number in that group. Although code table 4019 gives specific definitions only for figures 1-9 there is a note at the bottom of the table which says "If the duration of the period of reference is not covered by Code Table 4019 or the period does not end at the time of the report tR shall be coded 0". This would appear to mean that the group would then give a rainfall total for an unspecified period, which is not overly helpful. Incidentally, the full Manual on Codes is available for download from the WMO website. Go to www.wmo.ch then open the scroll box that says "Search by Alphabetical Topics" and click on "Codes". Scroll down to the section headed "Manual on Codes" then click on "Vol 1.1 part A". That contains very detailed explanation of all the alphanumeric code forms. Vol II is also useful as it gives some regional varriations. It's quite a tome but very well worth downloading to have on the shelf for reference. Norman. (delete "thisbit" twice to e-mail) -- Norman Lynagh Weather Consultancy Chalfont St Giles 85m a.s.l. England |
#7
![]() |
|||
|
|||
![]() Keith (Southend) wrote: I have downloaded these now and will have a good looksee. However, it would still be nice to be able to make those subtle changes because the programme I use does not pick up any with a '0' at the end. Could you not just chang the number at the end (the zero) to a different code? Or a text equivalent? To tell the processor to change just the end zero Just change zerospace or zeroequalsign (or whatever immediately follows the zero) into the code you want it to read? Edit Replace "0=" to "intermittently read" or whatever. |
#8
![]() |
|||
|
|||
![]()
Weatherlawyer wrote:
Keith (Southend) wrote: I have downloaded these now and will have a good looksee. However, it would still be nice to be able to make those subtle changes because the programme I use does not pick up any with a '0' at the end. Could you not just chang the number at the end (the zero) to a different code? Or a text equivalent? To tell the processor to change just the end zero Just change zerospace or zeroequalsign (or whatever immediately follows the zero) into the code you want it to read? Edit Replace "0=" to "intermittently read" or whatever. Unfortunately there isn't a 'common' factor here. It's a shame I can't use replace 6***0 with 6***2 ignoring the three numbers i the middle, but in wordpad etc it has to be exact, no wildcards, as far as I know. -- Keith (Southend) http://www.southendweather.net |
#9
![]() |
|||
|
|||
![]() "Keith (Southend)" wrote in message news:drfkki$1s0$1 Unfortunately there isn't a 'common' factor here. It's a shame I can't use replace 6***0 with 6***2 ignoring the three numbers i the middle, but in wordpad etc it has to be exact, no wildcards, as far as I know. .... as Norman has written, the '0' indicator is perfectly valid, and seems to be used widely in both the Russian Federation, and the old Soviet asian republics. Within the same collective, you can find both the tR=0 and tR= 1 or 2, so they obviously are aware of the distinction. The only explanation of why they persist in using '0' (when it clearly is a 12hr precipitation .. and allowed for within the National coding practices on the WMO site), is that the precipitation is measured at some time *other* than at the nominal SYNOP time. For example, I could imagine a situation where snowfall has to be melted out to gain a rainfall equivalent, but given the desperately low temperatures and sometimes high snowfall in these regions, the process would have to be started a couple of hours beforehand to get a figure ready for the observation. In this case, it would be misleading to indicate that tR=1 or 2, because those code figures imply that the precipitation is for the 6 or 12 hours up to ob time, whereas in this case, it *would* be a 12hr PPN figure, but not for the nominal period indicated. There may also be 'regional' / historical reasons why PPN is measured at different times, other than the nominal WMO main SYNOP times. I emphasise that is a *guess*, but can't come up with a different answer. Is it not possible in your routine to simply declare that '0' has the same meaning as '2' when decoding? I'm not sure if anywhere else in the world uses this convention, but from memory, I think that '0' has always indicated 12hr rainfall totals in this particular region. Martin. -- FAQ & Glossary for uk.sci.weather at:- http://homepage.ntlworld.com/booty.weather/uswfaqfr.htm and http://booty.org.uk/booty.weather/metindex.htm |
#10
![]() |
|||
|
|||
![]()
Felly sgrifennodd Mike Causer :
You need one of the popular pattern-matching programs, namely Awk, Perl or Python. It is a trivial operation for them. If I understand the original question, it's even more trivial in sed. cat filename | sed 's/0/2/g' newfilename Just run that on any UNIX system to replace all 0's with 2's, and write to a new file. Use regular expressions for matching if required (ask again! ![]() Sorry don't know if sed is available for MS. Adrian -- Adrian Shaw ais@ Adran Cyfrifiadureg, Prifysgol Cymru, aber. Aberystwyth, Ceredigion, Cymru ac. http://users.aber.ac.uk/ais uk |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Someone help with my maths | uk.sci.weather (UK Weather) | |||
Can Someone Help me out and tell me what happens next? | uk.sci.weather (UK Weather) | |||
This husbend can't fu ck his wife... can u help him | uk.sci.weather (UK Weather) | |||
Can someone please help me? | sci.geo.meteorology (Meteorology) | |||
Can someone explain | uk.sci.weather (UK Weather) |