Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic BUFR scan for mobile stations #199

Closed
edigiacomo opened this issue Oct 2, 2019 · 4 comments
Closed

Generic BUFR scan for mobile stations #199

edigiacomo opened this issue Oct 2, 2019 · 4 comments
Assignees
Labels

Comments

@edigiacomo
Copy link
Member

@pat1 propose to use the following scanner for generic BUFR:

function scan(msg, md)
    local proddef = bufr_read_proddef(msg)
    local report = msg:find("rep_memo")
    local area = nil
    if report:enqc() == "mobile"
    then
       area = bufr_read_area_mobile(msg)
    else
       area = bufr_read_area_fixed(msg)
    end
    if area then md:set(arki_area.grib(area)) end
    if proddef then md:set(arki_proddef.grib(proddef)) end
    if report then md:set(md.product:addValues{t=report:enqc()}) end
    md:set(bufr_scan_forecast(msg))
end

The only difference that I can find with the current scanner is that when the report name is the mobile string it scans the area as a mobile station. E.g. a mobile station with lon = 12.12345 and lat = 43.12345 will have area:GRIB:type=mob,x=12,y=43, whereas a fixed station will have area:GRIB:lat=1212345,lon=4312345.

This means that only the stations with rep_memo=mobile will be considered as mobile stations. At SIMC, we don't have any mobile stations with generic template, then for me it's not a real problem, but maybe we could write a more customizable scanner, e.g.

-- This can be easily changed by the user
mobile_reports = {"mobile", "bicycle", "drone", "scooter"}

-- Function to check the mobile_reports array
function is_mobile_report(report)
  ...
end

function scan(msg, md)
    ...
    if is_mobile_report(report:enqc())
    then
       area = bufr_read_area_mobile(msg)
    else
       area = bufr_read_area_fixed(msg)
    end
    ...
end

Note: the scanner will be implemented in Python (see #177).

A final thought: in the past, a station was considered a mobile station if its ident was not null: are we officially dropping this rule?

@spanezz
Copy link
Contributor

spanezz commented Oct 2, 2019

A final thought: in the past, a station was considered a mobile station if its ident was not null: are we officially dropping this rule?

Technically, we cannot. The database has no field for distinguishing mobile from fixed stations except for ident: when ident is present, the station is considered mobile, and when ident is NULL, the station is considered fixed.

If there is a need to change that requirement, it shuold be discussed separately, as it is a significant API and behavioural change, and repercussions need to be evaluated. See for example ARPA-SIMC/dballe#150

@pat1
Copy link

pat1 commented Oct 2, 2019

I agree with @spanezz. The scan proposed is too simple for any cases.
I have to explain better the problem (also to me).

In the rpm package the scan files are not marked as configuration so is not possible any adaptation for special use; any update remove any changes. So I think should be useful to permit some local configuration.

In my special user case I have three cases:

  1. fixed station without ident
  2. fixed station with ident
  3. mobile station with ident

I use the network to discriminate the special case 2) because I want search them with a standard lat/log query (that is possible with dballe too) and not using boxes.

@spanezz
Copy link
Contributor

spanezz commented Nov 5, 2019

Since now we made the scanner registration system more flexible, we can package the standard scanners as part of the arkimet python modules, and ship an empty directory in /etc/ where one can install further local overrides

@edigiacomo
Copy link
Member Author

Questa issue è stata chiusa per inattività. Nel caso in cui sia un argomento ancora rilevante, si prega di riaprirla con una motivazione che tenga conto delle modifiche applicate nel corso degli anni al progetto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants