husseinaluie / FlowSieve

FlowSieve coarse-graining code base
https://flowsieve.readthedocs.io/en/latest/
Other
18 stars 9 forks source link

Filering on cartesian grid #31

Closed hmkhatri closed 1 year ago

hmkhatri commented 1 year ago

I want to coarse-grain a scalar on a regular cartesian grid. I compiled coarse_grain_scalars.x by setting CARTESIAN = true in constants.hpp file. However, when I try to coarse_grain the field, I get the following output (see output in grey shading),

Commandline flag "--input_file" got value "./input_file.nc" Commandline flag "--time" received no value - will use default "time" Commandline flag "--depth" received no value - will use default "depth" Commandline flag "--latitude" got value "y" Commandline flag "--longitude" got value "x" Commandline flag "--is_degrees" received no value - will use default "true" Commandline flag "--do_PEKE_conversion" received no value - will use default "false" Commandline flag "--Nprocs_in_time" received no value - will use default "1" Commandline flag "--Nprocs_in_depth" received no value - will use default "1" Commandline flag "--region_definitions_file" received no value - will use default "region_definitions.nc" Commandline flag "--region_definitions_dim" received no value - will use default "region" Commandline flag "--region_definitions_var" received no value - will use default "region_definition" Commandline flag "--variables" got value "var" Commandline flag "--filter_scales" got value "1 5 10 20" Filter scales (20) are: 1m, 5m, 10m, 20m,

The first output says "--is_degrees" received no value - will use default "true" even though I set CARTESIAN = true.

Am I missing something here?

bastorer commented 1 year ago

Hi Hemant

Thanks for pointing this out. coarse_grain_scalars default to assuming inputs in degrees and then converting to radians. I forgot to add a flag to turn off that behaviour when running on Cartesian. I'll fix that, but if you pass --is_degrees false when you run the current code, it will disable the conversion [ alternatively you could give the filter scales in radians, but that's probably less pleasant ].

hmkhatri commented 1 year ago

Thanks @bastorer.

In short, to run on a cartesian grid, I need to set CARTESIAN = true while compiling (the rest of the parameters do not change) and pass --is_degrees = false when I execute the coarse_grain_scalars.x file.