Giter Site home page Giter Site logo

Comments (11)

WPringle avatar WPringle commented on June 20, 2024

@Jiangchao3 The time_vector needs to be a datetime vector, not a float vector like you have. The time_interval is using the "seconds" function to convert datetime to a float inside. It seems to be doing some weird thing where it gives a duration if you provide a float. I guess you can make a catch so you don't have to provide a datetime vector, and assumes what you provide is in seconds.

from oceanmesh2d.

Jiangchao3 avatar Jiangchao3 commented on June 20, 2024

@WPringle Thanks, I will have a try and let you know the result.

from oceanmesh2d.

Jiangchao3 avatar Jiangchao3 commented on June 20, 2024

Hi @WPringle, I use a datetime vector for time_interval, it works well.

t1 = datetime(2017,9,6,1,0,0); t2 = datetime(2017,9,12,0,0,0); time_vector = t1:hours(1):t2;

But the offset time series in the generated offset.63 file still have been rounded:

image

the following is the original offset data:

image

I guess all the values less than 0.5 are rounded down to 0, while numbers greater than 0.5 are rounded up to 1.
Does this make sense?

I look through the source code in writeoffset63, i thinkt he source code do not have any problem,
for tt = 1: f63dat.num_times fprintf(fid,'%d \t %12.6f \n',[f63dat.offset_nodes; f63dat.offset_values(tt,:)]); fprintf(fid,'%s \n','##'); end

but why the generated file have such a digital error? a bit confused.

from oceanmesh2d.

Jiangchao3 avatar Jiangchao3 commented on June 20, 2024

@WPringle in additon, how to understand the concept of
dynamicWaterLevelCorrectionRampStart and dynamicWaterLevelCorrectionRampEnd?

if my bia correction period start from t1 = datetime(2017,9,6,1,0,0) and end at t2 = datetime(2017,9,12,0,0,0),

so should I set dynamicWaterLevelCorrectionRampStart as the time t1 relative from the coldstart time
and set dynamicWaterLevelCorrectionRampEnd as the time t2 relative from the coldstart time?

or just give it one or two days to spin up for the dynamic water level correction like tidal rampup?

I am not sure if I understand it correctly, although there is a example about it on https://wiki.adcirc.org/Dynamic_water_level_correction#Controlling_Water_Level_Correction

from oceanmesh2d.

WPringle avatar WPringle commented on June 20, 2024

@Jiangchao3 What do the values in msh.offset63 look like?

The ramp is like the tidal ramp, just give it like a couple of days spinup.

from oceanmesh2d.

Jiangchao3 avatar Jiangchao3 commented on June 20, 2024

Hi @WPringle , in msh.offset63, the values is as following:

image

from oceanmesh2d.

WPringle avatar WPringle commented on June 20, 2024

how does msh.offset63 (the struct) look?

from oceanmesh2d.

Jiangchao3 avatar Jiangchao3 commented on June 20, 2024

I am sorry i am not in the office right now, i can share the msh object tomorrow morning for inspecting more details.

but i think the msh.offset63 (struct) is just like the following, except the time_intervel has been updated using a datetime

image

from oceanmesh2d.

Jiangchao3 avatar Jiangchao3 commented on June 20, 2024

Hi @WPringle ๏ผŒHere is my msh object with offset63 and the original data for offset time series

the following is my code to deal with the offset.

%% Make dynamic water level offset file
% read into offset dataset
offset_values = readtable('/data/users/qiujch24/OceanMesh2D/florida/validation_irma/offset.csv')
offset_values = table2array(offset_values);
offset_values = offset_values(:, 2:3);
offset_values = single(offset_values);
station = m.f15.elvstaloc;
[offset_nodes,dst] = ourKNNsearch(m.p',station',1);
t1 = datetime(2017,9,6,1,0,0);
t2 = datetime(2017,9,12,0,0,0);
time_vector = t1:hours(1):t2;
m = Make_offset63(m,time_vector,offset_nodes,offset_values);
m.f15.controllist(2).var(1).val = 'fort.fortset.63';
m.f15.controllist(2).var(3).val = 1243600; % RampStart
m.f15.controllist(2).var(4).val = 2243600; % RampEnd
%%

m.zip

really appreciate with you for help check it out

from oceanmesh2d.

WPringle avatar WPringle commented on June 20, 2024

@Jiangchao3 I found the problem, it is a bit esoteric. When the offset_nodes are of type int, it converts the offset_values to type int when they are combined during the writing process.

You can see the fix in #287

from oceanmesh2d.

Jiangchao3 avatar Jiangchao3 commented on June 20, 2024

clear,thanks very much @WPringle

from oceanmesh2d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.